Shipped the intelligence-authoring rule + intelligence-architect agent, layout tokens, and evidence-driven skill bootstrap (0.7.0) - #10
Conversation
…ent from the engine, taught adapters to expand layout tokens, and made INIT derive skills from the repository instead of a catalogue as 0.7.0
…w migration cannot silently stop it from testing the chain
There was a problem hiding this comment.
Pull request overview
This PR releases intelligence-sync 0.7.0, adding engine-owned “authoring discipline” artifacts (a scoped rule + an architect agent) and introducing <umbrella> / <module> layout tokens that are expanded at adapter output time to avoid hardcoding the umbrella folder name.
Changes:
- Add engine-owned
rules/+agents/to the module, update bootstrap/INIT and examples to register them assources. - Introduce
finalize_output_file()to expand layout tokens and normalize line endings; update built-in adapters to use it. - Add a 0.7.0 migration and CI enforcement to ensure engine artifacts reach outputs and no literal tokens leak.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents module now shipping rules/ and agents/ directories. |
| intelligence/sync/scripts/VERSION | Bumps engine version to 0.7.0. |
| intelligence/sync/scripts/update.sh | Stages/applies engine-owned rules/ + agents/ during updates and shows diffs. |
| intelligence/sync/scripts/sync.sh | Exports repo-relative layout token values for adapters to expand. |
| intelligence/sync/scripts/lib/migrations.sh | Adds 0.7.0 migration and generalizes source registration helper. |
| intelligence/sync/scripts/lib/common.sh | Adds finalize_output_file() and switches bundle handling to use it. |
| intelligence/sync/scripts/adapters/pi.sh | Uses finalize_output_file() on generated outputs. |
| intelligence/sync/scripts/adapters/opencode.sh | Uses finalize_output_file() on generated outputs. |
| intelligence/sync/scripts/adapters/cursor.sh | Uses finalize_output_file() on generated outputs. |
| intelligence/sync/scripts/adapters/copilot.sh | Uses finalize_output_file() on generated outputs. |
| intelligence/sync/scripts/adapters/codex.sh | Uses finalize_output_file() on generated outputs. |
| intelligence/sync/scripts/adapters/claude.sh | Uses finalize_output_file() on generated outputs. |
| intelligence/sync/scripts/adapters/agents.sh | Uses exported layout token values and finalizes AGENTS.md. |
| intelligence/sync/rules/intelligence-authoring.md | New engine-owned, umbrella-scoped authoring discipline rule using layout tokens. |
| intelligence/sync/INIT.md | Updates bootstrap guidance and registers module rules/ + agents/ sources. |
| intelligence/sync/docs/CONVENTIONS.md | Documents module-shipped rule/agent and layout token system. |
| intelligence/sync/docs/ADAPTERS.md | Documents finalize_output_file() and layout token requirements for adapters. |
| intelligence/sync/agents/intelligence-architect.md | New engine-owned agent for designing/pruning the intelligence layer. |
| examples/with-remote-skills/config.yaml | Updates to 0.7.0 and adds module rules/ + agents/ sources. |
| examples/platform-with-submodules/config.yaml | Updates to 0.7.0 and adds module rules/ + agents/ sources. |
| examples/go-api/config.yaml | Updates to 0.7.0 and adds module rules/ + agents/ sources. |
| examples/go-api-with-pi-and-codex/config.yaml | Updates to 0.7.0 and adds module rules/ + agents/ sources. |
| examples/go-api-with-opencode/config.yaml | Updates to 0.7.0 and adds module rules/ + agents/ sources. |
| examples/dotnet-api-with-react-frontend/config.yaml | Updates to 0.7.0 and adds module rules/ + agents/ sources. |
| docs/CONVENTIONS.md | Mirrors the module conventions updates (rule/agent + layout tokens). |
| docs/ADAPTERS.md | Mirrors the module adapter docs updates (finalize + tokens). |
| CHANGELOG.md | Adds 0.7.0 release notes, including breaking change + postconditions. |
| .github/workflows/ci.yml | Adds CI gate to ensure engine artifacts reach outputs and no tokens leak. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| local base rules_entry agents_entry | ||
| base="$(basename "$umbrella")" | ||
| rules_entry="$base/$module_name/rules" | ||
| agents_entry="$base/$module_name/agents" |
There was a problem hiding this comment.
Right, and it was worse than described — migrate_to_0_3_1 already carried the same basename assumption for its skills entry, so a nested umbrella has been registering a source that resolves nowhere since 0.3.1. Both now go through one helper, _mig_umbrella_rel, which asks git for the real repo-relative prefix (git -C "$umbrella" rev-parse --show-prefix) and falls back to basename only when there is no git — which is the flat case anyway.
Verified with an umbrella at platform/intelligence/: migration writes platform/intelligence/sync/rules and platform/intelligence/sync/agents, sync resolves them (IS_STATUS=ok), the engine rule lands in .claude/rules/, and its scope expands to paths: ["platform/intelligence/**"] — previously it would have written intelligence/sync/rules, pointing at nothing.
| | Function | Description | | ||
| |----------|-------------| | ||
| | `normalize_file_to_lf(file)` | Convert CRLF to LF | | ||
| | `finalize_output_file(file)` | **Call this on every file you write.** Expands layout tokens (`<umbrella>`, `<module>`) and converts CRLF to LF | | ||
| | `normalize_file_to_lf(file)` | LF conversion only — for intermediate files that are not adapter output | |
There was a problem hiding this comment.
Fixed — the example adapter now calls finalize_output_file after writing each rule, with a comment saying why. A doc that demonstrates the token-leaking call is exactly how the next adapter would ship a literal <umbrella> into someone's IDE. (Both the source docs/ and the vendored intelligence/sync/docs/ copy, which CI asserts are identical.)
| | Function | Description | | ||
| |----------|-------------| | ||
| | `normalize_file_to_lf(file)` | Convert CRLF to LF | | ||
| | `finalize_output_file(file)` | **Call this on every file you write.** Expands layout tokens (`<umbrella>`, `<module>`) and converts CRLF to LF | | ||
| | `normalize_file_to_lf(file)` | LF conversion only — for intermediate files that are not adapter output | |
There was a problem hiding this comment.
Fixed — the example adapter now calls finalize_output_file after writing each rule, with a comment saying why. A doc that demonstrates the token-leaking call is exactly how the next adapter would ship a literal <umbrella> into someone's IDE. (Both the source docs/ and the vendored intelligence/sync/docs/ copy, which CI asserts are identical.)
…isters the module under its real repo-relative path, and fixed the adapter doc example to use finalize_output_file
Summary
The engine stops being only a pipeline and starts shipping its own authoring discipline:
intelligence-authoring(a rule the model respects while it works, path-scoped to the umbrella so it costs nothing otherwise) andintelligence-architect(an agent that owns the layer's shape — what to split, what to fold, what to delete). Both live in the module beside the meta-skills, soupdate.showns them and they evolve with the engine instead of drifting inside each project. Making that possible required one new engine capability — an engine-shipped artifact cannot hardcode the umbrella's folder name, because the project chooses it, so scoped rules now writepaths: ["<umbrella>/**"]and every adapter expands the token on the way out. Finally, INIT's skill guidance is rewritten: it used to hand the bootstrapping agent a catalogue of plausible skill names, which produced registries describing software in general rather than the repository in front of it.Type of change
finalize_output_file;intelligence-authoringrule +intelligence-architectagent;migrate_to_0_7_0)What changed
<module>/rules/intelligence-authoring.md— which artifact type a piece of knowledge belongs to (a checklist in an agent body is a procedure: it belongs in a skill), why always-on rules must earn their place, why an agent is thin and never restates rules it already receives, why a skill without a verification step is not a skill. Includes the invariant that closes the loop on the defect behind 0.6.0: never state behaviour of a tool you have not verified in its documentation or source.<module>/agents/intelligence-architect.md— decides rule vs skill vs agent, always-on vs scoped, split vs fold, what to delete. Carries boundaries and verification only; the rule reaches it on its own.<umbrella>→Intelligence,<module>→Intelligence/sync, expanded in frontmatter and body byfinalize_output_file(replacesnormalize_file_to_lfat every output site). So one source rule lands as Claudepaths:, Cursorglobs:, CopilotapplyTo:carrying the project's real folder name.rules/andagents/like it already ownsdocs/and the meta-skills: staged from the clone, shown in the diff before the confirmation prompt, then applied. Your<umbrella>/rulesand<umbrella>/agentsare never touched.go-api-with-opencodenever registered the module'sskills/at all — fixed. All six now register the module'srules/,agents/,skills/.Breaking change + migration
config.yamlmust list the module'srules/andagents/undersources— otherwise the engine's own artifacts never reach the IDEs.migrate_to_0_7_0adds both entries idempotently; nothing else inconfig.yamlis read or rewritten.sync.shfails closed (IS_STATUS=needs-update) until the update flow runs — it never migrates._mig_add_skill_sourceis generalized to_mig_add_source <config> <section> <entry>, with the old name kept as a shim (a shipped migration is never rewritten).Verification
bash intelligence/sync/scripts/sync.shruns cleanly (IS_STATUS=ok) against all sixexamples/*(run on Linux via WSL, since Git Bash silently degrades some POSIX behaviour)lint_frontmatterproduces no new warningsshellcheck --severity=warningclean over all engine scripts (it caught an SC2115rm -rf "$VAR/$VAR"in my newupdate.shblock — fixed with:?)VERSION/INIT.md/ all six examples stamped0.7.0README.md,docs/CONVENTIONS.md,docs/ADAPTERS.md,intelligence/sync/INIT.md,CHANGELOG.mdwith a### Breakingsection carrying verifiable post-conditions)End-to-end update from a real 0.6.0 project (local git upstream,
update.sh --yes):IS_STATUS=migrated, then every post-condition from the CHANGELOG checked —sources.rules/sources.agentsgained exactly one entry each, both engine artifacts present, stamp0.7.0, the project's ownrules/context.mdandagents/my-dev.mduntouched, and after sync the rule reached.claude/rules/with zero leaked tokens.Token expansion, per channel (umbrella deliberately named
Intelligence/, capital I): Claudepaths: ["Intelligence/**"], Cursorglobs: ["Intelligence/**"], CopilotapplyTo: "intelligence/**", Pi rule copy, Codex TOML, opencode subagent, andAGENTS.mdlinks — all expanded,grep -rl '<umbrella>\|<module>'across every generated channel returns nothing.Migration is idempotent: re-running adds no duplicate source entries and reports
IS_MIGRATED=0.Notes for reviewers
<umbrella>/<module>. That is the enforcement behind the adapter contract — an adapter that writes a file withoutfinalize_output_fileis now caught by the build rather than by a user seeing<umbrella>in their IDE.CONVENTIONS.mdis reference material the model may or may not open; a path-scoped rule is loaded automatically the moment someone touches the layer, and costs nothing the rest of the time. The mechanics stay inCONVENTIONS.md— the rule carries only the judgement.intelligence-is the reserved prefix (the updater prunes what matches it), so the engine's own rule and agent live inside it:intelligence-authoringsays what it governs, andintelligence-architectfollows the existing<domain>-<role>shape.argument-hintparsed as a YAML list when unquoted; over-longdescription). Deliberately not in this branch.