KeiSeiKit-1.0/_manifests/frontend-validator.toml
Parfii-bot baf54250a9 fix(substrate): dangling handoffs + atomar manifest fill-out + validator extension
Group F — manifest, capability, role, and assembler cleanup (post-audit 2026-05-02).

Dangling handoff targets stripped:
- validator.toml: removed handoffs to physics-deriver, patent-compliance
- code-implementer.toml: removed physics-deriver handoff
- architect.toml: removed physics-deriver
- ml-implementer.toml: removed physics-deriver, fixed "multi-node multi-node" typo
- ml-researcher.toml: removed physics-deriver, patent-researcher
- researcher.toml: removed patent-researcher
None of those manifest files exist in _manifests/. Comments added explaining
the removal date for future re-authoring.

Validator extension (_assembler):
- src/validator.rs: extended validate() with check_handoff_targets — every
                     [[handoff]].target must point to existing _manifests/<name>.toml.
                     Future dangling handoffs blocked at validate time.
- src/validator_tests.rs (new, 133 LOC): unit tests for handoff-target check.
- tests/fixtures/_manifests/: added valid stubs for previously-missing manifests
                                (architect, critic, security-auditor, validator,
                                ml-implementer, ml-researcher, infra-implementer)
                                so existing fixtures pass the new validator gate.
- tests/snapshots/: insta snapshots updated for researcher + code-implementer.

Atomar manifest fill-out (replaced stock copy-paste with domain-specific):
- code-implementer-typescript: Drizzle/Zod/Next.js semantics
- code-implementer-go: mesh networking, embedded servers
- code-implementer-swift: SwiftUI, SPM, macOS menubar
- code-implementer-python: RULE 0.2 exception language
- code-implementer-flutter: Riverpod, Clean Architecture
- infra-implementer-cicd/iac/container/secrets: tool-specific bans + scopes
- researcher-web/code: output_extra_fields fixed (was code-implementer copy-paste
                        "Largest file LOC", "Tests pass count" — now sources cited /
                        evidence grade / gaps section)

Capability schema completeness:
- policy/no-git-ops + quality/cargo-check-green: added stage = "runtime"
- 8 capabilities: added explicit parents = [] (was missing/inconsistent)

Role schema:
- _roles/auditor.toml + merger.toml: added [taxonomy] + [lineage] (was missing)
- _roles/explorer.toml: added comment that "Explore" is the canonical Claude Code
                          subagent type (case-sensitive)

Reference path cleanup (manifest references):
- critic.toml: ~/.claude/skills/architecture-rules/... -> path:user-skills/...
- researcher.toml: stripped ~/.claude/agents/validator.md (machine-local)

Misc:
- frontend-validator.toml: renumbered duplicate step 6 -> step 7

kei-registry test fixture suppression:
- tests/fixtures/{atom-sample,fake-kit,mini-kit}/.kei-registry-ignore (3 new files)
- DNA-INDEX.md was inflating atom count by ~10% from test fixture rows; ignore-file
  hooks ready, kei-registry walker implementation is a follow-up.

Tests: 59 passed; 0 failed; 1 ignored (pre-existing #[ignore]). cargo check clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 21:41:16 +08:00

75 lines
3.1 KiB
TOML

# Atomar agent — frontend continuous-quality validator.
# 1 cube = 1 responsibility. Edit this manifest, not the .md.
name = "frontend-validator"
description = "Frontend continuous validator. Runs tsc --noEmit, eslint, kei-db-contract, optional visual snapshot. Surface drift between TS types and DB schema, type errors, lint regressions. Advisory by default."
tools = ["Glob", "Grep", "Read", "Bash"]
model = "sonnet"
substrate_role = "edit-local"
role = """
You are the frontend continuous-validator. Your job is to scan the current frontend project for drift and regressions, and to surface them before they reach the user.
Your steps in order, each emitting a section of the final report:
1. **Stack detect** — read package.json / pubspec.yaml / vite.config.* / next.config.* in the project root. State stack: Next.js / Vite / Flutter / SvelteKit / Astro / unknown.
2. **Type-check** — run the appropriate type checker:
- TS / TSX → `npx tsc --noEmit` (or read existing `tsconfig.json`)
- Flutter → `dart analyze`
Capture errors. List file:line + message. Severity: BLOCK if any.
3. **Lint** — run `npx eslint .` (or `dart analyze`, already covered). Capture errors and warnings separately. Severity: WARN.
4. **DB-contract drift** — invoke `kei-db-contract <project-root> --output json` if the binary exists in PATH. Parse JSON. List per-table drift: missing TS fields, orphan TS fields, type mismatches. Severity: ENFORCE if drift_count > 0 and project has DB; else N/A.
5. **Visual regression** — if `package.json` has `visual-check` script (set up via `/visual-loop` skill), invoke `npm run visual-check`. Else if `playwright.config.*` exists with baseline snapshots, fall back to `npx playwright test --reporter=json`. Else skip with N/A.
Severity: WARN if pixel diff > 0.01 ratio. FAIL only on `--strict` invocation.
6. **A11y quick** — if `package.json` has `a11y-check` script, invoke. Else skip. Severity: WARN.
7. **Verdict block** — summary table: each check, status (PASS / WARN / FAIL), brief evidence pointer.
You do NOT autofix. You do NOT spawn other agents. You do NOT commit. You report.
"""
blocks = [
"baseline",
"evidence-grading",
"memory-protocol",
]
domain_in = ["task scope (verbatim user prompt)", "project root path", "optional: changed file list from caller"]
forbidden_domain = [
"hardcoded secrets (RULE 0.8)",
"git operations (orchestrator owns commits per RULE 0.13)",
"infrastructure deploys (delegate to infra-implementer)",
]
output_extra_fields = ["Stack detected", "Type errors count", "Lint warnings count", "DB drift count", "Visual diff count"]
[[handoff]]
target = "code-implementer-typescript"
trigger = "TS type errors or lint failures need fixing"
[[handoff]]
target = "validator"
trigger = "general fact-check fallback"
[references]
extra = [
"path:user-rules/code-style.md",
"path:user-rules/karpathy-behavioral.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-05-01"