Skip to content

[pull] master from GaijinEntertainment:master#973

Merged
pull[bot] merged 10 commits into
forksnd:masterfrom
GaijinEntertainment:master
May 9, 2026
Merged

[pull] master from GaijinEntertainment:master#973
pull[bot] merged 10 commits into
forksnd:masterfrom
GaijinEntertainment:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 9, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

borisbat and others added 10 commits May 8, 2026 09:56
Fills the gap between skills/CLAUDE.md (categorical knowledge) and
the daslang MCP (symbol lookups) — covers the long tail of "how do
I X?" / "what's the pattern for Y?" answers an agent figured out
once and would otherwise lose.

Atomic .md docs with stable-slug cross-refs and inline question
aliases, dupe-on-add gate, FTS5+BM25 retrieval. .md is source of
truth; SQLite index is rebuildable. v0 ships BM25 only — embeddings
and LLM rerank are vNext.

CLAUDE.md gets an "Asking blind-mouse" section + tool responses
carry hint footers ("if stale, edit"; "research it then mouse__add")
so corpus hygiene is reinforced at the moment of decision.

30/30 dastest tests pass; lint + format clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- dedupe_slug: preserve verbatim slug on collision (don't re-slugify),
  so a valid slug_hint like 'my_doc' becomes 'my_doc-2', not 'my-doc-2'
- sanitize_fts5_query: drop '\t' from allow-list so tabs collapse to
  spaces upstream of split(" ") tokenization
- rebuild FTS row: drop the doc.questions loop -- doc.body already
  contains the '## Questions' section, so we were indexing aliases
  twice and skewing BM25
- search: clamp k to [1, 50]; SQLite LIMIT -1 = no-limit, untrusted
  callers shouldn't be able to scan the whole corpus
- main: reword 'mouse__get <slug>' hint to MCP-tool form

Tests: dedupe_slug preserves underscore on collision; search returns
empty for k<=0; tab-separated query still matches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- slug_from_title caps to MAX_SLUG_LEN with trailing-dash retrim, so
  long titles can't produce slugs that is_valid_slug later rejects.
- dedupe_slug truncates base before appending -N suffix, keeping the
  candidate within MAX_SLUG_LEN; preserves base verbatim when no
  collision (existing tests still hold).
- add_doc sanitizes the question before use: \r/\n collapse to spaces,
  empty-after-sanitize is rejected with an error. Closes a YAML
  injection vector via newline-bearing MCP input.
- LinkRow insert switched to insert_or_ignore so a doc accidentally
  listing the same link twice in frontmatter doesn't abort the
  rebuild transaction.

Drive-bys:
- is_valid_slug refactored to peek_data (clears pre-existing PERF002/
  PERF003 in the loop).
- Tests use repeat() helper instead of += loops, and one var fm became
  let fm in test_read_doc_clears_stale_error.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- rebuild: skip+warn docs whose frontmatter slug fails is_valid_slug
  (avoids indexing docs that cmd_get/tool_get would later refuse to
  open). Test seeds a `slug: Bad.Slug` doc and asserts only the valid-
  slug doc is indexed.
- README: drop `bash` fence around `mcp__daslang__format_file` (it's an
  MCP tool, not a shell command); reword to clarify the formatter has
  no CLI equivalent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- rebuild: skip+warn when basename != {slug}.md so search never returns
  unfetchable docs (cmd_get/tool_get build paths from slug, not DocRow.path)
- search: downcase cleaned query so user-typed FTS5 keywords (OR/AND/NOT/
  NEAR) become inert tokens instead of producing invalid OR-join syntax
- cmd_get/tool_get: surface parse_error to the user (warning log + [W]
  prefix in tool_get output) so corrupted docs aren't silently partial

Tests: test_rebuild_skips_basename_slug_mismatch,
test_search_handles_uppercase_fts_keywords. All 55 mouse tests pass.

Also: CLAUDE.md "Asking blind-mouse" — explicit planning-phase guidance
(sweep mouse__ask before code research, mouse__add rough answers freely).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat(mouse): blind-mouse v0 — personal Q&A cache MCP server
PERF013  a += 1 / a -= 1 → a++ / a--
PERF014  closed-interval char-class range → strings::is_alpha/is_alnum/is_number
PERF015  ternary min/max → math::min(a, b) / max(a, b)
PERF016  ternary abs → math::abs(x)
PERF017  length(x) == 0 → empty(x)  (avoids strlen on strings)
STYLE016 adjacent guards with identical exit → ||-merge
STYLE017 if (cond) return true; else return false → return cond / !cond
STYLE018 b == true / b != false → b / !b  (Yoda forms detected)
STYLE019 min(max(x, lo), hi) → math::clamp(x, lo, hi)

Each rule has a test file under utils/lint/tests/ (expect 31208:N for PERF,
expect 31209:N for STYLE — the prior skill claim that style expect doesn't
work was stale). 9 RST sections added to doc/source/reference/language/lint.rst.

Visitor changes:
* current_function.flags.generated suppresses warnings for macro-synthesized
  code (e.g. [CommandLineArgs] codegen)
* PERF017 self-skip when current_function (or fromGeneric) is empty — its own
  body is literally length(x) == 0 and the rule's whole job is to suggest it
* dropped redundant in_closure>0 early-return from preVisitExprOp2 — loop_depth
  already doesn't increment inside closure bodies, so PERF001's loop check is
  correctly scoped without it. Surfaces syntactic patterns (PERF014/017 etc.)
  inside the natural build_string() $(var w) { ... } idiom

Sweeps:
* utils/lint/main.das — 3 self-fixes (rule runner triggered its own rules)
* utils/mouse/ — ~15 hits cleaned up (PERF013/014/017/STYLE016)
* dogfooding: perf_lint.das and style_lint.das now lint-clean for the new
  rules (refactored their own internal guard chains)

Followup PR will sweep the remaining ~377 daslib hits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat(lint): 9 new perf/style rules — PERF013–017, STYLE016–019
@pull pull Bot locked and limited conversation to collaborators May 9, 2026
@pull pull Bot added the ⤵️ pull label May 9, 2026
@pull pull Bot merged commit 4e5bcf9 into forksnd:master May 9, 2026
1 of 4 checks passed
@pull pull Bot had a problem deploying to github-pages May 9, 2026 02:58 Error
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant