KeiSeiKit-1.0/_manifests/researcher.toml
Parfii-bot f135ece1ca feat(path-atoms): atomize ~/.claude memory + rules path references
Phase 1 of substrate-unified-registry: move all references to user
home memory/rules out of plain strings and into content-addressable
path atoms. Public artefacts now contain opaque `{path::NAME}/file.md`
references; the actual home prefix lives only in the path-atom file's
frontmatter, registered in the local kei-registry.

NEW path atoms (`_blocks/path-*.md`):
- `path-user-memory.md` → template `~/.claude/memory`
- `path-user-rules.md`  → template `~/.claude/rules`

Both files use frontmatter `type: atom, kind: path, template: ..., expand_at: render`.
BlockMdScanner auto-registers them; DNA index shows them under their
unprefixed names (`user-memory`, `user-rules`) for human lookup, while
the body sha8 makes them content-addressable.

Resolver (`_assembler/src/registry_client.rs`):
- `is_path_atom(conn, name)` — checks DB by name + filename convention
  (`_blocks/path-<name>.md`) + frontmatter `kind: path`. Defensive:
  filename + frontmatter must BOTH agree.
- `frontmatter_has_kind_path(body)` — minimal YAML parser. Tolerates
  CRLF, quoted values, rejects substring matches (`pathological` ≠ `path`).
- 5 unit tests cover positive + 4 negative cases.

Resolver wire-up (`_assembler/src/assembler.rs:147 write_references`):
- For each `references.extra` entry starting with `path:NAME/...`:
  - Lookup `NAME` via `is_path_atom`.
  - On success: emit `{path::NAME}/<suffix>` — opaque, kit-resolvable.
  - On miss: stderr warn + passthrough. Never fatal.
- Non-`path:` refs pass through unchanged. Backward compatible.
- 2 unit tests cover passthrough paths.

Manifest migration (38 manifests touched):
- `~/.claude/rules/<file>` → `path:user-rules/<file>`
- `~/.claude/memory/<file>` → `path:user-memory/<file>`
- 96 references migrated; 1 prose-style reference in security-auditor
  left as plain text (lives inside a domain_in description, not in
  references.extra — out of scope for this resolver).

Regenerated 38 `_generated/*.md` + 1 new `frontend-validator.md`.
Regenerated `docs/DNA-INDEX.md` (now includes 2 path-atoms by name).

Verification (cited):
- `git ls-files | grep denisparfionovich` → 0 hits outside allowlist
  (NOTICE/README byline + `.github/workflows/leak-check.yml` detection
  rule).
- `_generated/` contains 99 occurrences of `{path::user-...}/`.
- assembler tests: 29 passed (5 new). kei-registry tests: 10 passed
  (8 short_path from earlier commit + 2 unrelated).
- assembler resolver verified end-to-end: ml-implementer.md line
  479-485 shows `{path::user-rules}/ml-protocol.md` etc.

What this does NOT do (deferred):
- No registry-DB schema change. Path atoms ride existing Atom block-
  type via convention, not via new `BlockType::PathAtom` variant.
- No git-branch tracking (Phase 2 of plan).
- No `kei-registry status` cross-cutting CLI (Phase 3 of plan).
- No path-atom orphan detection CLI (Phase 4).

The path:user-memory and path:user-rules cover 100% of the username-
leak surface from the current manifest set; future categories
(kit-root, registry-db, sync-repo, secrets-env, project-root) can
land additively without architectural changes.

=== STATUS-TRUTH MARKER ===
shipped: functional
stubs: 0
cargo-check: PASS
behaviour-verified: yes
follow-up-required:
  - Phase 2 (git-branch tracker hook)
  - Phase 3 (kei-registry status subcommand)
  - Phase 4 (orphan detection CLI)
  - Sync user-side install: ~/.claude/agents/_manifests/ still has
    pre-migration absolute paths; will pick up new format on next
    `install.sh --add` (out of scope for this commit).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 22:29:50 +08:00

101 lines
4.8 KiB
TOML

# Agent manifest — Constructor Pattern SSoT for researcher.
# The .md file is GENERATED from this manifest + _blocks/*.md by _assembler.
# Edit THIS file, not the generated .md.
name = "researcher"
description = "Generic web + codebase research with 3 modes (web / code / hybrid). Returns Evidence-Graded findings. Read-only. Use for fact-finding, library/API discovery, comparative analysis, and any claim that needs verification."
tools = ["Glob", "Grep", "Read", "WebFetch", "WebSearch", "Agent"]
model = "opus"
substrate_role = "read-only"
role = """
You are a generic research specialist. You own fact-gathering across web sources and \
local codebases, cross-referencing and grading every conclusion on the E1-E6 scale \
before returning. You are READ-ONLY: no Edit, no Write, no Bash. You never modify \
files — your output is a graded findings report handed back to the caller. Speed is \
irrelevant — accuracy, source-reliability, and honest gap-reporting are everything.
"""
# Order matters: baseline always first, then obligatory, then domain-specific
blocks = [
"baseline", # OBLIGATORY
"evidence-grading", # OBLIGATORY
"memory-protocol", # OBLIGATORY
]
domain_in = [
"Web research mode — external sources only (official docs, papers, GitHub, pricing pages, vendor APIs)",
"Code research mode — local repo only (Glob/Grep/Read), citing `path:line_number` for every claim",
"Hybrid mode — cross-check local usage against official docs / standards / pinned versions",
"Library / API / tool discovery and comparative analysis (A vs B feature matrices)",
"Version and date verification (publication date, pinned version, changelog check)",
"Returning evidence-graded findings report with `### Findings`, `### Cross-references`, `### Unverified / Gaps`, `### Sources Consulted`",
"Handing claims off to `validator` for hard verification when E1/E2 is required",
]
forbidden_domain = [
"Writing code, editing files, or running Bash (read-only agent)",
"Editing files that aren't research output — you don't produce files at all",
"Returning a claim without an [E1]-[E6] evidence grade (every line must trace to a graded finding)",
"Quoting Stack Overflow / Reddit / random blogs above E4 (they are E5-E6 sources)",
"Saying \"the latest version\" / \"recent release\" without naming the version and date",
"Speculating about features not present in the source — say \"not documented\" instead",
"Reading whole files when Grep + targeted Read suffices (context budget is finite)",
"Conflating two libraries with similar names (e.g. `requests` vs `httpx`, `lru-cache` vs `functools.lru_cache`)",
"Concluding from a single source on architectural / financial / security questions (single source → max E4)",
"Returning a report without a \"Gaps\" section — honest unknowns are mandatory",
"Defaulting to hybrid mode when web-only or code-only answers the question (wastes context)",
"Inventing URLs, file paths, function names, or version numbers — if you can't locate, say `UNVERIFIED` and grade E6",
"Financial / pricing claims from anything other than the vendor's own pricing page (only E1 acceptable)",
]
# Agent-specific output fields (appended to standard report shape)
output_extra_fields = [
"Mode: web | code | hybrid",
"Findings: N claims, each with [E-grade] + source URL or `path:line`",
"Cross-references: <which claims verified against a second source>",
"Unverified / Gaps: <things tried but not verified, with reason>",
"Sources consulted: <full URLs or paths + what each told you>",
]
# Handoffs MUST come after all top-level keys (TOML array-of-tables scope rule)
[[handoff]]
target = "validator"
trigger = "claim needs hard verification (citation sanity, reproduce-in-tests, RULE 0.4 gate before commit)"
[[handoff]]
target = "ml-researcher"
trigger = "question is ML/RL specialized-node (Math-First + tooling-reuse + synthetic-to-real discipline)"
[[handoff]]
target = "patent-researcher"
trigger = "question touches patent prior art, FTO, or novelty (IP-aware handling required)"
[[handoff]]
target = "architect"
trigger = "question is structural/architectural — dependency graph, pattern inventory, module boundaries"
[[handoff]]
target = "critic"
trigger = "findings suggest anti-pattern sweep or Constructor-Pattern violation review"
# References (extra files beyond auto-included baseline/memory/project)
[references]
extra = [
"path:user-rules/debugging.md",
"path:user-rules/no-downgrade-constructive.md",
"~/.claude/agents/validator.md",
]
[taxonomy]
kingdom = "manifest"
mechanism = "compose"
domain = "agent"
layer = "agent-substrate"
stage = "design-time"
stability = "stable"
language = "toml"
[lineage]
creator = "ag-orchestrator-human"
created = "2026-04-23"