Skip to content

feat(config): unify kit.toml, inherit door_paths, drop agents_only shim - #1277

Merged
tieubao merged 9 commits into
masterfrom
feat/unified-kit-toml-and-agents-only
Dec 5, 2026
Merged

tieubao merged 9 commits into
masterfrom
feat/unified-kit-toml-and-agents-only

Conversation

@tieubao

@tieubao tieubao commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator
Field Summary
Verdict Ready for re-review: the three review blockers and the proof-class note are fixed
Proof docs/verification/unified-kit-toml-and-agents-only.md (green runs, 2 base-ref negative controls, 1 mutation control for the review fixes)
Risk Touches lib/gate/ (Core gates one-way door) and lib/config/kit-config.sh; backward-compatible fallback to .kit.toml and repokit.toml preserved and tested

What

  1. Unified project kit.toml ([dev.*] sections) with .kit.toml backward compatibility:

    • Canonical project config is now <project>/kit.toml under [dev.<section>] ([dev.modules], [dev.gate], [dev.adopt], [dev.lanes], [dev.lane.<name>], [dev.merge], [dev.output], [dev.proof], [dev.ledger], [dev.mega], [dev.sync], [dev.test], [dev.battery], [dev.wrap], [dev.observe], and [[dev.gate.hard_path_exempt]]), while [repo] / [repo.*] belongs to repokit and is untouched.
    • Updated lib/config/kit-config.sh and all config readers (config.sh, hook-module.sh, merge-command.sh, gate-policy.sh, lane-data.sh, proof-ledger.sh, ledger-key.sh, mega-merge.sh, wrap-adopt.sh, lane-classify.sh, dashboard.py) so project kit.toml [dev.*] wins over legacy .kit.toml [*], falling back to .kit.toml when absent. Unprefixed [<section>] in project kit.toml is never read as a project override, keeping devkit's own shipped-default kit.toml isolated from the operator layer.
    • Updated lib/adopt.sh so fresh adoption writes [dev.modules] and [dev.gate] to kit.toml (appending cleanly if kit.toml already exists with [repo]), and adopt.sh --refresh migrates legacy .kit.toml into kit.toml under [dev.*] while merging per key (kit.toml wins on a key it sets) and preserving [repo], removing .kit.toml via git rm (if tracked) or rm otherwise, idempotently.
  2. Auto-inherit [repo].door_paths (or repokit.toml fallback) into the hard-path lane floor:

    • Added pure POSIX awk _kit_toml_get_array (supporting single-line and multi-line TOML string arrays, comments, and single/double quotes) and lane_door_hard_paths in lib/gate/lane-data.sh.
    • Escapes ERE metacharacters properly (literal . in deploy/macos/firewall.sh, directory prefix internal/ghauth/, exact .md doors like SECURITY.md), gives kit.toml [repo].door_paths precedence over repokit.toml, unions cleanly with [dev.lanes] / [lanes] extra_hard_paths, and unions working tree + HEAD + KIT_FLOOR_CONFIG_AT.
  3. Fix adopt.agents_only = true redundant 1-line CLAUDE.md shim cleanup:

    • Fresh adopt with agents_only = true ([dev.adopt] in kit.toml or [adopt] in .kit.toml) never creates a CLAUDE.md shim, and --check passes when CLAUDE.md is absent.
    • During adopt.sh --refresh with agents_only = true, a pure 1-line @AGENTS.md CLAUDE.md shim (regular non-symlink file whose trimmed content equals @AGENTS.md) is removed via git rm -f (if tracked) or rm -f (if untracked), while any custom CLAUDE.md is left untouched.

Demo

$ bash tests/test-unified-kit-toml.sh
ok - kit.toml [dev.*] wins over .kit.toml [*]
ok - gate-policy: kit.toml [dev.gate] lane_gates=true wins over .kit.toml false
ok - gate-policy: falls back to .kit.toml proof_of_done=false when absent in kit.toml
ok - kit.toml [repo].door_paths raises floor to full (zero extra_hard_paths)
ok - classify --files matches [repo].door_paths directory prefix
ok - ERE metacharacter escaping: literal dot does not match X
ok - negative control: unrelated path stays normal
ok - negative control: removing door_paths drops floor to normal
ok - fallback: legacy repokit.toml door_paths raises lane floor to full
ok - precedence: kit.toml [repo].door_paths wins over repokit.toml and unions with extra_hard_paths
ok - adopt --refresh migrates .kit.toml into kit.toml preserving [repo], removes 1-line @AGENTS.md shim, --check passes
ok - migration (repo-first): per-key merge keeps lane_gates, proof_of_done, commit_format; [repo] untouched
ok - migration (gate-first): per-key merge keeps lane_gates, proof_of_done, commit_format; [repo] untouched
ok - migration: canaries and extra_hard_paths union; inert legacy light and exemption stay inert
ok - exempt: commented keys in kit.toml do not hide the .kit.toml exemption
ok - exempt: devkit own repo still exempts lib/session/**
ok - exempt: mixed config still enforces the legacy canary
ok - exempt: a kit.toml canary refuses a legacy exemption glob
ok - exempt: a dotted dev.gate canary outside a section refuses the exemption
ok - repokit.toml edit trips the full floor when a door is dropped with the edit
ok - proof: a kit.toml-only diff is not inert
---
PASS=21 FAIL=0

$ bash tests/test-meta.sh
Passed: 945 / 945

$ bash tests/run-all.sh --time
run-all: all 118 suites passed, 0 skipped for missing tooling

Review fixes

  • Migration merges per key. Three cases follow what the readers already did, so migrating cannot weaken a gate: extra_hard_paths and hard_path_canaries are unioned; a legacy lane light beside kit.toml phases stays a comment; legacy exemption tables beside kit.toml ones stay comments. An invalid extra_hard_paths ERE refuses the migration.
  • Exemption tables come from one file; canaries from both; comments declare nothing.
  • A root repokit.toml edit trips the full floor.
  • A kit.toml diff is no longer inert, so an adopt or --refresh commit that adds it owes proof where proof_of_done is on.
  • Shellcheck: SC2319 is disabled file-wide in two test files (the chk status idiom), and SC2046 on one line.

Proof

  • Spec: docs/specs/SPEC-434-unified-kit-toml-and-agents-only.md
  • Verification record (including the negative controls): docs/verification/unified-kit-toml-and-agents-only.md
  • Implementation notes: docs/implementation-notes/unified-kit-toml-and-agents-only.md

Bookkeeping

no-board-row: dispatched coordinator wave implementing unified kit.toml ([dev.*]), [repo].door_paths inheritance, and agents_only CLAUDE.md shim cleanup.

Use root kit.toml ([dev.*]) as canonical project config with .kit.toml fallback across all config readers, auto-inherit [repo].door_paths (or repokit.toml fallback) into the hard-path lane floor, migrate .kit.toml on adopt --refresh while preserving [repo], and remove pure 1-line @AGENTS.md CLAUDE.md shims under adopt.agents_only.
@tieubao tieubao changed the title feat(config): unify project kit.toml ([dev.*]), inherit door_paths, clean agents_only shim feat(config): unify kit.toml, inherit door_paths, drop agents_only shim Dec 5, 2026
@tieubao

tieubao commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

independent-check (failed at 1dd25271)

  • Verdict: fail (verifier timed out after 600s)
  • Proof: fresh-context claude re-run at 1dd252719bb76827421987b328198735df062227 (603.7s)
  • Risk: Fix proof or code, push, and re-run independent-check run consolelabs/devkit#1277.

Commands run:

  • (no proof command executed)

@tieubao
tieubao merged commit 054203e into master Dec 5, 2026
17 checks passed
@tieubao
tieubao deleted the feat/unified-kit-toml-and-agents-only branch December 5, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant