Skip to content

feat(skills): skill runtime, instruction resolver, capabilities and support bundle [SC-A0.1 + A0.2a] - #72

Merged
AetherAI3 merged 8 commits into
mainfrom
supercluster/a0-skills-health-integration
Aug 19, 2026
Merged

AetherAI3 merged 8 commits into
mainfrom
supercluster/a0-skills-health-integration

Conversation

@AetherAI3

@AetherAI3 AetherAI3 commented Aug 19, 2026 •

Copy link
Copy Markdown
Owner

Problem

PR #71 ("Skills & Health") is CONFLICTING against main and cannot be rebased mechanically. It carries a large amount of genuinely new and valuable work — the skill runtime, the instruction resolver, the capability matrix, the support bundle — but it also carries a second, competing implementation of aether doctor v2.

Root cause

b98ef26d (2026-08-12) is the last commit main and PR #71 share.

Two independent "doctor v2"s were built in the same 48 hours. That is why only four files conflict textually while the semantic conflict is much larger.

Contract

The contested surface is the doctor report contract. Both sides declare schema version 2 with incompatible payloads:

main — src/core/health.ts PR #71 — src/core/diagnostics/contracts.ts
report HealthReport, camelCase DoctorReportV2, snake_case
configured / reachable / verified Axis objects, state in {yes,no,unknown,na,not-checked} plain boolean
mode fast | live | fix fast | network | live | fix
severity info | warning | error info | warning | critical

Decision: main's 3-axis model is canonical; PR #71's boolean triple is dropped, not merged.

A boolean verified cannot express not-checked. Fast mode performs no network I/O by contract, so every remote axis is unchecked — under PR #71's shape that must serialize as verified: false, which is indistinguishable from checked and failed. main's not-checked state keeps them distinct, and main's version is also the newer one. Shipping both would put two mutually incompatible payloads behind one schema_version: 2.

Two further decisions, recorded in full in the artifact:

Full conflict matrix, per-surface decision record, and findings table: _loopstate/LOOP-01/sc-a0-2026-08-19/AUDIT-ARTIFACT.md

Implementation

This PR is A0.1 — the foundation only. It lands the part of PR #71 that main has no equivalent of. Notably, it applied to main unmodified: the port required zero source edits, which is itself evidence that the conflict was confined to the doctor engine.

src/core/skills/*        20 files — schema, digest, lock, trust, discovery, loader,
                         resolver, policy, bounds, eval, session, settings,
                         context packet, permission vocabulary
src/core/instructions/*   3 files — AGENTS.md discovery + resolution with provenance
src/core/why_log.ts       capability explanation log

Nothing is wired into the CLI yet, so this PR changes no user-visible behaviour. It is additive and inert until A0.3.

Tests

Run against this exact tree at d1b75ab:

command result
npm ci --ignore-scripts exit 0, 0 vulnerabilities
npm run typecheck exit 0
npm test 1006 pass / 0 fail

Baseline re-measured on clean 41a7e261 in the same session: 922 pass / 0 fail. The 84 new tests are PR #71's skill and instruction suites, ported unchanged: trust/modify/re-trust lifecycle, lock drift, duplicate skill IDs across scopes, dependency cycles, lazy-loading token bounds, nested AGENTS.md precedence and provenance, conflicting-instruction detection.

No result here is inherited from PR #71's branch. PR #71 has no CI at all — gh pr view 71 --json statusCheckRollup returns an empty rollup — so nothing on it could have been inherited even if we wanted to.

Security notes

  • No credential, token, or environment value is read, written, logged, or embedded by any file in this PR.
  • Skill trust is digest-bound; a content change invalidates prior trust. Covered by test/skill_trust_lock.test.ts.
  • Skill declarations restrict behaviour; they do not grant tools beyond the host's existing authority. Covered by test/skill_policy_packet.test.ts.
  • Instruction resolution fails conservatively on unsupported syntax rather than guessing.

Known limits

Dependency and merge order

A0.1  this PR            skill + instruction foundation
A0.2  depends on A0.1    capabilities, support bundle, redaction/tar,
                         skills+instructions checks ported onto health.ts
A0.3  depends on A0.2    CLI wiring, packaged skill assets, docs

SC-A1 (tool runtime) and SC-A5 (usage continuity) both start from the accepted A0 head — PR #71 also modifies src/core/stream.ts, which both of those lanes own.

PR #71 should stay open until A0.3 merges, then be closed as superseded rather than merged. Its doctor engine is deliberately not carried forward.


Update — scope now covers A0.1 and the first half of A0.2

This branch has grown past the "foundation only" description above. Recording the
change rather than leaving a stale body.

Commits on this PR

commit what
d1b75ab A0.1 — skill runtime + instruction resolver foundation
1521199 CodeQL high-severity fix + mutation-checked regression test
ba7d041 A0.2 part 1 — capability matrix + redacted support bundle

Why one PR instead of the planned three. A0.1 is inert on its own and A0.2's
support bundle depends on it directly, so splitting them would produce a first PR
no reviewer can exercise and a second that cannot be reviewed without the first.
At ~37 files this is still well under PR #71's 100, and the module boundaries make
it readable. A0.3 (CLI wiring, packaged skill assets, docs) stays a separate PR.

CodeQL finding, fixed

CI flagged js/incomplete-sanitization (high) at instruction_resolver.ts:18 —
the glob metacharacter escape used a non-global regex, so only the first
metacharacter was escaped.

Not exploitable as written: char is glob[index], always a single code unit,
so a second occurrence cannot exist. But the escape's safety rested on an invariant
the function never stated, and a future change to a multi-character token would
silently widen every glob's match set. Fixed rather than dismissed.

The regression test pins the property, not the implementation: a glob containing
. + ( ) | { } [ ] $ ^ must match itself literally and must not match a decoy,
while ** and * keep working. Mutation-checked — replacing the escape with a
bare pattern += char fails the test (unescaped . would match axts); restoring
it passes.

This defect arrived from PR #71 untouched. PR #71 runs no CI, so on its own branch
it would have shipped unseen.

A0.2 part 1 — the one real port

capabilities.ts, redaction.ts, tar.ts and the generated capability snapshot
applied unmodified. support_bundle.ts needed two lines: it called PR #71's
doctorReportV2, which this rescue drops in favour of main's diagnosticReport.

The swap strictly improves the bundle. Under PR #71's boolean model a fast-mode
bundle — which performs no network I/O — had to serialize verified: false for
every remote axis, indistinguishable from checked and failed. main's
HealthReport carries per-axis not-checked, so an unexercised probe stays
visibly unexercised in the artifact a user hands to support.

Gates at ba7d041

command result
npm run typecheck exit 0
npm test 1017 pass / 0 fail
npm run smoke 3 pass / 3 skip / 1 fail

Test progression, each measured on the exact tree: 922 (clean 41a7e261) → 1006
(A0.1) → 1007 (CodeQL regression test) → 1017 (A0.2 part 1).

The smoke failure is operator-owned, not a regression. cloud turn returns
HTTP 401 "Invalid or expired session token". Verified by re-running smoke at
1521199 with this commit's changes stashed — identical failure. It needs
aether auth login. No file in this PR is on the cloud-turn path. Reported as a
fail, not rounded up to a pass.

Bundle safety suites pass: a seeded canary secret is rejected rather than shipped,
and an interrupted generation leaves no misleading "complete" artifact.

Still owed before this PR leaves draft

A0.3 (CLI wiring, built-in skill assets, aether skills, /skills,
aether capabilities, docs) remains a separate follow-up PR. Until it lands, none
of this is reachable from the command line — it is additive and inert.

PR A0.1 of the SC-A0 Skills & Health integration rescue.

Recovers the skill and instruction subsystems from PR #71 (a868f7d) onto
current main (41a7e26) without importing PR #71's parallel doctor engine.

PR #71 branched at b98ef26 (2026-08-12) and never saw PR #66 (27c100d,
2026-08-14), which landed its own doctor v2 on main. Both declare doctor
schema version 2 with incompatible payloads: main's health.ts models
configured/reachable/verified as Axis objects with a "not-checked" state,
PR #71's contracts.ts models them as plain booleans. A boolean cannot
express "not checked", so in fast mode — which performs no network I/O —
every remote axis would have to report false, which is indistinguishable
from checked-and-failed. main's contract is both newer and safer, so it
stays canonical and PR #71's is dropped rather than merged.

This commit lands only the part of PR #71 that main has no equivalent of,
and which turned out to apply to main unmodified:

  src/core/skills/*        schema, digest, lock, trust, discovery, loader,
                           resolver, policy, bounds, eval, session, settings,
                           context packet, permission vocabulary
  src/core/instructions/*  AGENTS.md discovery and resolution with provenance
  src/core/why_log.ts      capability explanation log

Capabilities, support bundle, and the skills/instructions doctor checks
follow in A0.2; CLI wiring and packaged skill assets follow in A0.3.

The full conflict matrix, including the four textual conflicts and the
decision record for each contested surface, is in
_loopstate/LOOP-01/sc-a0-2026-08-19/AUDIT-ARTIFACT.md.

Gates at this commit, run against this exact tree:
  npm run typecheck   exit 0
  npm test            1006 pass / 0 fail  (baseline on 41a7e26 was 922/0)
CodeQL js/incomplete-sanitization (high) on PR #72, at
src/core/instructions/instruction_resolver.ts:18 — the metacharacter escape
in globToRegExp used a non-global regex.

Not exploitable as written: `char` is `glob[index]`, always a single code
unit, so there is never a second occurrence to miss. But the safety of that
escape rests on an invariant nothing in the function states, and a future
change to a multi-character token would silently widen every glob's match
set. Fixed rather than dismissed, since the fix is free.

Adds a regression test that pins the property rather than the implementation:
a glob containing . + ( ) | { } [ ] $ ^ must match itself literally and must
not match a decoy path, while ** and * keep working.

Mutation-checked: replacing the escape with a bare `pattern += char` fails
the new test with "unescaped . would match axts"; restoring it passes.

Gates at this commit:
  npm run typecheck   exit 0
  npm test            1007 pass / 0 fail
PR A0.2 of the SC-A0 Skills & Health integration rescue, part 1 of 2.

Recovers PR #71's capability matrix and support bundle onto main:

  src/core/capabilities.ts            capability matrix
  src/generated/agent_capabilities.ts packaged offline fallback snapshot
  src/core/support_bundle.ts          redacted, self-verifying bundle
  src/core/redaction.ts               shared redaction vocabulary
  src/core/tar.ts                     dependency-free tar writer

capabilities, redaction, and tar applied unmodified. support_bundle needed a
two-line port: it called PR #71's doctorReportV2, which this rescue drops in
favour of main's diagnosticReport (see the conflict matrix in
_loopstate/LOOP-01/sc-a0-2026-08-19/AUDIT-ARTIFACT.md, decision C1).

The swap is a strict improvement for the bundle. PR #71's report modelled
configured/reachable/verified as plain booleans, so a fast-mode bundle — which
performs no network I/O — had to serialize verified:false for every remote
axis, indistinguishable from checked-and-failed. main's HealthReport carries
per-axis "not-checked", so an unexercised probe stays visibly unexercised in
the artifact a user sends to support.

Still owed for A0.2 part 2: porting PR #71's skills and instructions checks
(the only two it has that main lacks) from its CheckSpec onto main's
CheckOutcome, and the safe-repair reconciliation.

Gates at this commit:
  npm run typecheck   exit 0
  npm test            1017 pass / 0 fail  (1007 before this commit)
  npm run smoke       3 pass / 3 skip / 1 fail

The smoke failure is `cloud turn` HTTP 401 "Invalid or expired session token".
Verified pre-existing: the identical failure reproduces at 1521199 with this
commit's changes stashed. It is an expired local credential requiring
`aether auth login`, not a code regression, and no file in this commit is on
the cloud-turn path. Recorded as an operator-owned gate, not a pass.

Bundle safety is covered by the ported suites, both passing here: a seeded
canary secret is rejected rather than shipped, and an interrupted generation
leaves no misleading "complete" artifact behind.
@AetherAI3 AetherAI3 changed the title feat(skills): skill runtime and instruction resolver foundation [SC-A0.1] feat(skills): skill runtime, instruction resolver, capabilities and support bundle [SC-A0.1 + A0.2a] Aug 19, 2026
…ontract

PR A0.2 of the SC-A0 Skills & Health integration rescue, part 2 of 2.

Ports the only two checks PR #71 has that main lacks — skills and instructions
— from PR #71's CheckSpec onto main's DiagnosticCheckSpec/CheckOutcome, and
wires them into fast mode. Six checks land:

  skills.index            store integrity and index errors
  skills.lock             lockfile presence and drift
  skills.trust            project skills untrusted or changed
  skills.evals            declared eval manifests
  instructions.graph      source count and parse warnings
  instructions.conflicts  detected conflicts, by topic

This is a shape translation, not a rewrite. PR #71 modelled a result as a
status plus a detail string with configured/reachable/verified as plain
booleans; each axis here carries its own state and evidence.

The translation is where the contract decision earns its keep. These checks
touch only the filesystem, so `reachable` is n/a — there is no remote to
reach — rather than a pass borrowed from a probe that never ran. Under PR
#71's booleans there was no way to say that: `reachable: false` would have
read as unreachable. `verified` is a genuine yes/no because these checks do
exercise the files they report on during the run.

The axis mapping lives in one helper (`localOutcome`) rather than being
repeated per check, so a future check cannot quietly claim a `verified` it
did not earn.

Extends, rather than relaxes, the frozen check-ID inventory in
test/diagnostics.test.ts. That assertion exists to catch unintended drift;
this drift is intended, so the expected list grows and the deep-equal stays
exact. Adds an assertion that both new categories report `reachable: "na"`,
so a later change cannot silently upgrade them to a pass.

Live proof against the built CLI at this commit — `aether doctor --json`:

  skills.index            cfg=yes reach=na ver=yes  0 skill(s) indexed
  skills.lock             cfg=yes reach=na ver=yes  no project skills, no lock required
  skills.trust            cfg=yes reach=na ver=yes  no project skills awaiting trust review
  skills.evals            cfg=yes reach=na ver=yes  no skills discovered
  instructions.graph      cfg=yes reach=na ver=yes  0 instruction source(s), no parse warnings
  instructions.conflicts  cfg=yes reach=na ver=yes  no instruction conflicts detected

The emitted payload contains no boolean-shaped `verified` field, confirming
PR #71's competing schema-v2 contract is absent rather than merely unused.

"0 skill(s) indexed" is truthful, not a defect: the built-in skill assets are
not packaged until A0.3.

Gates at this commit:
  npm run typecheck   exit 0
  npm test            1017 pass / 0 fail
…ged assets

PR A0.3 of the SC-A0 Skills & Health integration rescue.

Makes the work in A0.1 and A0.2 reachable. Until this commit the skill runtime
existed but no user could invoke it.

  aether skills <subcommand>   list, show, check, trust, lock
  aether capabilities          capability contract, with --available
  aether support-bundle        redacted metadata-only diagnostic archive

Built-in skill assets (SKILL.md, skill.json, evals) ship as data, which tsc
does not emit, so `build` now runs scripts/copy-skill-assets.js after compile.
The existing `files: ["dist/src"]` entry already carries them into the tarball;
verified below rather than assumed.

Deliberately NOT taken from PR #71:

  * Its cli_registry entry rewriting `doctor [--deep]` to `[--network] [--fix]`.
    `--deep` stays read-only per decision C2 in the conflict matrix; aliasing it
    to a network-performing mode would silently change what an existing habit
    does. `--network` is a separate, explicitly named mode when it lands.
  * Its main.ts doctor flags (--network, --schema, --category, --failed), which
    belong to the doctor engine this rescue drops. main's doctor parses its own
    argv, so it needs none of them.
  * Its `aether agent --skill` / `--no-skills` flags and dev-session skill
    context. Those touch code.ts, chat.ts, brain_cloud.ts and stream.ts, which
    SC-A1, SC-A4 and SC-A5 own. Deferred rather than raced.

COMMANDS.md gains real sections, not just index entries. The parity test only
asserts the index, but an index pointing at nothing is a doc that lies by
omission. Every subcommand documented was then invoked to confirm it exists:

  skills list   -> 6 built-ins listed
  skills show   -> aether/[email protected] — Ship
  skills check  -> ok
  skills trust  -> "aether/ship is a builtin skill — already trusted"
  skills lock   -> locked 0 project skills

Live proof at this commit, against the built CLI:

  aether skills list        6 built-in skills, scope and trust shown
  aether capabilities       contract v1, falls back to the packaged snapshot and
                            states that it did so, and why
  aether support-bundle     25600-byte tar written, sha256 reported
  aether doctor --json      skills.index now reports "6 skill(s) indexed"
                            (it read 0 before the assets were packaged)

Gates at this commit:
  npm run typecheck        exit 0
  npm test                 1017 pass / 0 fail
  npm run verify:production exit 0 — ok:true, 518 packed files, 2315934 bytes
  npm pack --dry-run       18 dist/src/skills/builtin/** entries present

The COMMANDS.md parity test failed first on this change, correctly: the CLI
registry had grown and the doc had not. Fixed by documenting the commands, not
by relaxing the assertion.
This file was written into the worktree by running `aether skills lock` while
verifying that the documented subcommand actually exists. It is a byproduct of
that check, not source, and it was swept in by `git add -A` in the previous
commit.

`aether skills lock` is a project-scoped command: the lockfile belongs to
whichever repository a user runs it in, generated on demand. Shipping this
repo's own lockfile would pin an empty project skill set into the package for
no reason.
@AetherAI3
AetherAI3 marked this pull request as ready for review August 19, 2026 12:42
@AetherAI3
AetherAI3 merged commit 51cb94c into main Aug 19, 2026
5 checks passed
@AetherAI3
AetherAI3 deleted the supercluster/a0-skills-health-integration branch August 19, 2026 12:45
AetherAI3 added a commit that referenced this pull request Aug 22, 2026
…notes claim

On 2026-08-20 this repository described five different releases at once.
package.json said 0.2.0. package-lock.json still said 0.1.0 — the #81 bump never
touched it. RELEASE_NOTES.md's top entry described a 0.2.0 whose feature list was
written at 477f0fc, before #72 added `aether skills`, `aether capabilities` and
`aether support-bundle`. The npm registry served 0.1.0 and nothing else. And a
packed aether-agents-0.2.0.tgz sat in the repo root from #83 until #90 deleted
it, containing a build with no skills runtime in it at all.

Nothing was lying on purpose. The four statements drifted apart because nothing
compared them.

0.2.0 -> 0.3.0, not 0.2.1
-------------------------
#72 is a backwards-compatible feature addition — a skills runtime, three new CLI
commands, six built-in skills shipped inside the package — that the v0.2.0 notes
never mentioned. Semver makes that a minor bump.

Reusing 0.2.0 was rejected on identity grounds. 0.2.0 already names a specific
dated artifact: the August 19 notes entry, the README availability paragraph,
install.sh's pin example, and that committed tarball. Publishing different
contents under the same version would make two materially different artifacts
answer to one name, which is the defect this release exists to close. 0.2.0 is
retired unused; it will never be published.

Reconciled
----------
- package.json, package-lock.json (both version fields) and src/version.ts all
  say 0.3.0.
- RELEASE_NOTES.md leads with v0.3.0 covering 477f0fc..ed094dc: one feature,
  nine user-visible fixes, three test-only commits, one unwired module (#86 ship
  rail, which no command invokes), one docs commit. The v0.2.0 entry is marked
  superseded rather than rewritten — it is the record of what was written that
  day, not an install instruction.
- README and the release log name 0.3.0, and both still say plainly that
  `npm i -g aether-agents` gives you 0.1.0, because it does.

New gate: test/release_coherence.test.ts
----------------------------------------
Gate A asserts every place that names the release names the same one — including
both package-lock version fields, which is the drift nothing was watching.

Gate B is the load-bearing one: for every feature the release notes claim, the
code behind it must be present in the file list `npm pack` would actually ship,
and the command exposing it must be in the CLI registry. The source checkout's
dist/ is NOT the package — the allowlist is dist/src plus four docs.

Mutation-checked. Adding "!dist/src/commands/skills.js" to the files allowlist
silently drops `aether skills` from the tarball:

  verify:production  ->  {"ok":true, ... "packedFiles":523}   MISSED IT
  release_coherence  ->  FAIL: dist/src/commands/skills.js
                              (agent skills runtime — `aether skills`)

Restored: 7/7 pass, 524 packed files.

New: npm run release:candidate
------------------------------
release.yml only runs after a founder has already tagged and published, so
everything it checks is checked too late to change the decision. This runs the
same sequence, in the same order, before the tag exists — against a detached
git worktree of a specific commit, never the dirty checkout. A dirty tree is
refused unless --allow-dirty, which marks the report commitBound:false rather
than pretending.

Every CLI proof runs the binary npm installed from the packed tarball into a
clean prefix: --version, --help, `skills list`, `capabilities`, and the handoff
demo (the demo harness is not shipped, so it is placed beside the installed
package and resolves the CLI and its imports from the tarball's own dist/src).

Skipped steps are recorded as "not-run" with a reason and can never read as a
green tick — the full npm test suite is release.yml's gate and says so in the
report. No string is handed to a shell: npm is reached through its own JS
entrypoint under node, so every argument stays an argument.

Also
----
- scripts/verify-production.ts exports createPackReport, so a gate reasoning
  about what a user receives asks npm instead of reading the build directory.
- test/release_canaries.test.ts's coverage map said canaries 5 and 7 were
  unwritable. #86 and #87 wrote them two commits later; the excuse outlived the
  condition. The map is now enforced by a test that reads the delegated files.
- docs/releases/OPERATOR-PACKET-v0.3.0.md: the founder-owned publish sequence,
  with what is proven and what is explicitly not.

Gates at this commit:
  npm run typecheck                      exit 0
  release + production test files        21 pass / 0 fail
  npm run verify:production --tag v0.3.0 ok

Full npm test NOT run locally (a tool_executor test does not return on this
Windows box); CI is the authority.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
AetherAI3 added a commit that referenced this pull request Aug 23, 2026
…their policy (#100)

* feat(skills): put skills and AGENTS.md inside real runs, and enforce their policy

Commit #72 shipped the whole skill runtime — resolver, trust, locks, policy
calculation, bounded loading, six packaged skills — and deferred the part that
makes it exist: `prepareSkillSession` had no production call site. A run never
saw a skill, never saw AGENTS.md, and never enforced a tool policy.

This wires it into every surface that drives a brain, through ONE seam.

## The seam

`src/core/skills/run_session.ts` — `openRunSession()` returns three things:

  headerLines  what was loaded, and what the policy now is
  brief(task)  the string the brain reads: rules + skills + host policy + task
  guard(tool)  the host-side refusal, run immediately before execution

The brief is composed BEFORE a brain is chosen, so the cloud dev-session request
body and the local Ollama chat messages carry the byte-identical string — one
composition, two transports, asserted on both payloads. The typed
`AgentContextPacket` rides the NDJSON task frame for a brain that speaks it
(additive + optional, so PROTOCOL_VERSION does not move).

Wired at: `cmdCode` (one-shot agent — local, cloud dev-session, and the Python
NDJSON brain) and `chat.runTurn` (REPL + one-shot chat, local and cloud).
Enforced at: `hostLoop` and `runLocalTurn` — the only two places this host
executes a tool.

## Never widen

The guard runs BEFORE the operator permission gate, never instead of it. A skill
subtracts from the tool surface; the operator gate then decides about what is
left. Nothing a manifest says is consulted after that point, so there is no path
by which a skill adds a tool, adds a permission, or skips a confirmation.

An AUTOMATICALLY matched skill contributes context but NOT policy. A trigger
phrase is a guess, and `aether agent "make the tests pass"` matches fix-ci,
which forbids write_file — letting a guess narrow would silently leave the agent
unable to edit the code it was asked to fix. Only `--skill <id>` narrows.

## Honesty

- The Policy line says "enforced for every tool this host executes", because on
  the legacy cloud chat stream the server runs the tools and this process can
  refuse nothing. A cloud REPL turn with a narrowing prints NOT ENFORCED.
- Token counts are measured from the composed bytes, never a manifest estimate.
- Truncated, skipped, and over-budget instruction sources are named.
- A skill directory that failed to index no longer reads as "no skill matches".
- Instruction conflicts are rendered to the user AND to the model, with both
  values and which one wins — never silently resolved.
- Instruction/skill content cannot forge the host's own fences.

## Fixes found on the way

`resolveInstructionGraph` used `applicableSources(sources, null)` — the
"no file open" set, which excludes every subtree-scoped source. A nested
`src/AGENTS.md` therefore never reached a run, and a root-vs-nested conflict
could never be detected because only one side was ever compared. Added
`runScopedSources` / `buildRunInstructionContextPacket` for whole-repo runs;
the file-scoped selector is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* test(skills): pin the guard/gate ORDER, not just the outcome

Mutation testing the never-widen invariant: three mutations of the host loop,
run against the whole suite.

  M1  hostLoop never consults the skill guard        killed by 2 tests
  M2  refuseUndeclaredToolCall always returns null   killed by 9 tests
  M3  operator gate runs BEFORE the skill guard      SURVIVED — 26/26 passed

M3 is the ordering the commit that introduced it calls "the whole never-widen
invariant", and nothing asserted it. Every existing test still passed with the
blocks swapped, because the call is refused either way and no assertion could
tell the difference downstream.

What actually changes under M3: the user is asked to approve a call host policy
has already refused. The tool still never runs, so this is not an escalation —
it is worse in a slower way. It trains a person to click through a confirmation
that never meant anything, and it leaves the documented ordering free to drift
in a later refactor with a green suite the whole way.

The new test records what the gate was asked about and asserts it was asked
about nothing. It is the only assertion in the file that fails under M3.

* harden(skills): escape opening fences too, sanitize header rows, surface unparsable rule scopes

Adversarial pass over the seam:

- fenceSafe escaped only CLOSING tags. A rules file containing a forged
  <source path=... digest=...> could open a second element inside a real one and
  show the model a host-attributed block with a digest the host never computed.
  Now both halves are escaped, losslessly (attributes survive as text).
- Header rows carry manifest- and repo-authored strings. Sanitized on the way
  out so no ANSI introducer reaches the terminal.
- runScopedSources drops a source whose glob frontmatter will not parse. Right
  to drop, wrong to drop silently: it now lands in graph.skipped and is named.
- The typed instruction packet now sanitizes content like the skill packet does.
- The REPL header was gated on composed size alone, which swallowed exactly the
  cases it exists to report (an untrusted skill, an unindexable manifest, a
  dropped rules file — all of which compose zero context bytes). Gated on
  hasWarnings || notices too.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(skills): close four holes adversarial review found in the seam

Three independent reviewers took the diff apart along one lens each: authority
(can a skill widen anything), honesty (can something unknown render as fine),
and untrusted content (a cloned repo's AGENTS.md is attacker-influenced text).
Authority held with no constructible widening path. The other two did not.

1. The REPL swallowed exactly the lines it exists to print. chat.ts gated the
   header on `run.contextTokens > 0`, but a notice — an untrusted project skill,
   a manifest that would not index, a candidate dropped at the per-turn ceiling
   — can occur with NOTHING composed. In a project with no AGENTS.md and one
   untrusted skill, the run composes zero bytes, so the single line saying a
   skill was withheld was the one line that never printed. Surfaces now consult
   `run.hasWarnings`, which is about whether something was withheld, not about
   how big the context is.

2. A rules file whose scope would not parse vanished without a trace.
   runScopedSources drops an unsupported-syntax source because its glob
   frontmatter is unreadable, so its scope is unknown and applying it to a whole
   run would be a guess about which files it governs. Dropping it is right.
   Dropping it silently is not: discovery found the file, read it, and the user
   believes it is in force. It is now recorded in the graph's skipped list,
   which the header already renders.

3. The same bytes left on two channels with two different sanitizations. Skill
   bodies and the composed brief went through sanitizeForTransport; the
   instruction packet copied source content raw, so a consumer reading
   context.instructions instead of the brief received a dirtier string than the
   brief carried. One sanitizer now covers both.

4. Fence escaping covered only closing tags. The real </source> was neutralized,
   so nothing terminated early — but a forged `<source path=... digest=...>` in
   a rules file passed through untouched and appeared inside a legitimately
   loaded element, claiming host-authored provenance it did not have. The regex
   now matches both halves, and the replacement escapes the whole matched tag
   instead of re-emitting a capture group, which had been quietly rewriting any
   opening tag it matched into a closing one and dropping its attributes.

Header rows are also sanitized on the way out. A project skill's trigger phrase
is manifest-authored and charset-unvalidated, and it reaches the terminal inside
the "why this matched" line.

Each fix has a test that fails without it. 1163 pass, verify:production ok.

* feat(skills): a session records which rules and skills it ran under, and a resume checks

A session id names a conversation. It does not name the instructions that
conversation was conducted under — and those live in files anyone can edit
between two runs. Until now a resume re-read whatever AGENTS.md and whatever
skill bodies were on disk at that moment and continued under the old session
identity without a word.

The session manifest and the portable handoff now carry a context record: skill
id, version, digest, invocation, trust and lock state, the instruction source
paths, one digest over the whole ordered instruction graph, and the conflicts
the run resolved. Digests and paths only — never instruction or skill CONTENT. A
session directory is not the place for a project's prose, and a handoff carries
this across machines.

On resume the two are compared:

- A changed SKILL digest REFUSES. The user named that skill once; its body is
  executable guidance, and a different body under the same id and version is not
  the thing they approved. Same for a trust state that dropped.
- A changed instruction graph is ANNOUNCED and proceeds, naming what came into
  force and what left. Editing AGENTS.md between runs is ordinary work and
  refusing it would make resume unusable — but it is never silent.
- A skill present then and absent now is reported, not refused: the run is
  narrower, never wider.

parseHandoff validates the record as untrusted input, because it is. A skill row
with no digest is DROPPED rather than half-read — it cannot be compared against
anything, so keeping it would put a meaningless value into the comparison. An
entirely empty record is dropped too: absent means "the prior run recorded
nothing", empty would claim "the prior run ran under no rules and no skills",
and those lead to different resume decisions.

contextDrift is exported and directly tested — the comparison is the point, so
it has to be assertable without cutting a worktree and driving a brain.

1170 pass, verify:production ok.

---------

Co-authored-by: DBarr3 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
AetherAI3 added a commit that referenced this pull request Aug 23, 2026
…notes claim (#96)

* release: cut v0.3.0, and make the package prove it contains what the notes claim

On 2026-08-20 this repository described five different releases at once.
package.json said 0.2.0. package-lock.json still said 0.1.0 — the #81 bump never
touched it. RELEASE_NOTES.md's top entry described a 0.2.0 whose feature list was
written at 477f0fc, before #72 added `aether skills`, `aether capabilities` and
`aether support-bundle`. The npm registry served 0.1.0 and nothing else. And a
packed aether-agents-0.2.0.tgz sat in the repo root from #83 until #90 deleted
it, containing a build with no skills runtime in it at all.

Nothing was lying on purpose. The four statements drifted apart because nothing
compared them.

0.2.0 -> 0.3.0, not 0.2.1
-------------------------
#72 is a backwards-compatible feature addition — a skills runtime, three new CLI
commands, six built-in skills shipped inside the package — that the v0.2.0 notes
never mentioned. Semver makes that a minor bump.

Reusing 0.2.0 was rejected on identity grounds. 0.2.0 already names a specific
dated artifact: the August 19 notes entry, the README availability paragraph,
install.sh's pin example, and that committed tarball. Publishing different
contents under the same version would make two materially different artifacts
answer to one name, which is the defect this release exists to close. 0.2.0 is
retired unused; it will never be published.

Reconciled
----------
- package.json, package-lock.json (both version fields) and src/version.ts all
  say 0.3.0.
- RELEASE_NOTES.md leads with v0.3.0 covering 477f0fc..ed094dc: one feature,
  nine user-visible fixes, three test-only commits, one unwired module (#86 ship
  rail, which no command invokes), one docs commit. The v0.2.0 entry is marked
  superseded rather than rewritten — it is the record of what was written that
  day, not an install instruction.
- README and the release log name 0.3.0, and both still say plainly that
  `npm i -g aether-agents` gives you 0.1.0, because it does.

New gate: test/release_coherence.test.ts
----------------------------------------
Gate A asserts every place that names the release names the same one — including
both package-lock version fields, which is the drift nothing was watching.

Gate B is the load-bearing one: for every feature the release notes claim, the
code behind it must be present in the file list `npm pack` would actually ship,
and the command exposing it must be in the CLI registry. The source checkout's
dist/ is NOT the package — the allowlist is dist/src plus four docs.

Mutation-checked. Adding "!dist/src/commands/skills.js" to the files allowlist
silently drops `aether skills` from the tarball:

  verify:production  ->  {"ok":true, ... "packedFiles":523}   MISSED IT
  release_coherence  ->  FAIL: dist/src/commands/skills.js
                              (agent skills runtime — `aether skills`)

Restored: 7/7 pass, 524 packed files.

New: npm run release:candidate
------------------------------
release.yml only runs after a founder has already tagged and published, so
everything it checks is checked too late to change the decision. This runs the
same sequence, in the same order, before the tag exists — against a detached
git worktree of a specific commit, never the dirty checkout. A dirty tree is
refused unless --allow-dirty, which marks the report commitBound:false rather
than pretending.

Every CLI proof runs the binary npm installed from the packed tarball into a
clean prefix: --version, --help, `skills list`, `capabilities`, and the handoff
demo (the demo harness is not shipped, so it is placed beside the installed
package and resolves the CLI and its imports from the tarball's own dist/src).

Skipped steps are recorded as "not-run" with a reason and can never read as a
green tick — the full npm test suite is release.yml's gate and says so in the
report. No string is handed to a shell: npm is reached through its own JS
entrypoint under node, so every argument stays an argument.

Also
----
- scripts/verify-production.ts exports createPackReport, so a gate reasoning
  about what a user receives asks npm instead of reading the build directory.
- test/release_canaries.test.ts's coverage map said canaries 5 and 7 were
  unwritable. #86 and #87 wrote them two commits later; the excuse outlived the
  condition. The map is now enforced by a test that reads the delegated files.
- docs/releases/OPERATOR-PACKET-v0.3.0.md: the founder-owned publish sequence,
  with what is proven and what is explicitly not.

Gates at this commit:
  npm run typecheck                      exit 0
  release + production test files        21 pass / 0 fail
  npm run verify:production --tag v0.3.0 ok

Full npm test NOT run locally (a tool_executor test does not return on this
Windows box); CI is the authority.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs(release): fill the operator packet with the commit-bound candidate evidence

Run against a63e1c6 in a detached worktree: commitBound true, ok true, exit 0.
Tarball aether-agents-0.3.0.tgz, 524 entries, 589,829 bytes packed / 2,435,029
unpacked, sha256 25f33524bd866275674eccbf8cfe5706f14e925cb0ba35861dc6bc21a9245a2d.

The digest came out identical from an uncommitted tree and from the detached
worktree, which is recorded as content stability across a docs-only commit and
explicitly NOT as a cross-machine reproducibility claim.

Also records the mutation check: dropping dist/src/commands/skills.js from the
files allowlist leaves verify:production reporting ok:true at 523 files, and
fails release_coherence by name.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* release: cover #98 in the notes, and make the coherence gate bidirectional

The ground moved while PR #96 was open. #98 squash-merged to main, main became
426b124, and the v0.3.0 notes said nothing about it — which is this lane's own
defect arriving from the direction the lane did not gate.

WORK A: the notes now cover #98
-------------------------------
Its user-visible half is three fixes, and the first is the exact failure class
this codebase forbids:

- `aether doctor --live` never received --live. main.ts parses non-strictly, so
  a flag the command had not declared was captured globally and stripped from
  what the command was handed. --live ran the fast configured-only report and
  EXITED 0, presenting a live end-to-end verification that was never performed.
  Unknown rendered as verified. --deep, --dry-run, --no-ui and --only were lost
  the same way, and the whole --fix repair path was unreachable.
- `aether doctor --fix --yes` answered "re-run with --yes" to someone who had
  just passed it, because the global --yes never arrived either.
- Command lookup lowercased the token while dispatch was case-sensitive, so
  `aether Vault` fell past the typo guard into a chat turn and billed a paid
  model call.

The seam itself is announced too: a command now carries its own help metadata,
flag table and loader in one entry, flag collisions are load-time errors, and
reachability is structural rather than a regex over main.ts's source.

Range moves 477f0fc..ed094dc -> 477f0fc..426b124, 16 commits -> 17, across
RELEASE_NOTES.md, docs/releases/2026-08-22.md and the operator packet. Fixed a
miscount while re-deriving: the packet said "9 user-visible fixes" over a list of
ten.

WORK B: the gate now runs both directions
-----------------------------------------
Gate B ran notes -> package: a claim with no code behind it fails. It could not
see the inverse — a user-visible command that ships with NO claim anywhere — and
the inverse is what actually keeps happening, once per lane that lands between
the note being written and the tag being cut.

Gate C: every non-hidden command in the CLI registry must be announced by some
release note, or named in SHIPPED_WITHOUT_A_NOTE with a reason. An explicit list
is fine; silence is not. It is enforced in both directions — a stale entry fails,
and an entry that IS announced fails — so it cannot rot into a permanent bypass
that quietly absorbs the next unannounced command. Every entry must also appear
in the operator packet, because the founder cutting the tag is the person who
needs to know what goes out unannounced. 15 commands are on it today; all predate
the release log or were announced by capability in the June 2026 entry, and none
is new in this release.

Mutation-checked, per the controller's instruction. Added to the registry:

  { name: "teleport", args: "<dest>",
    summary: "beam the working tree somewhere", section: "System" }

  verify:production  -> {"ok":true, ... "packedFiles":527}        MISSED IT
  release_coherence  -> FAIL: no user-visible command ships without either a
                        release note or a named exemption
                        + [ 'teleport — beam the working tree somewhere' ]
                        - []

Registry restored byte-identical (md5 37b3f944…, `git status src/` empty),
10/10 pass. cli_registry.ts is read-only for this lane: it was mutated only in
the working tree, never committed, and the restore is verified by digest.

Also: Gate B now reads the registry by IMPORTING it instead of by regex over its
source. #98 replaced "reachability asserted by a regex over main.ts" for exactly
this reason, and it immediately split the commands across CLI_COMMANDS and
DISPATCH_COMMANDS — a source regex keyed on one array would have silently
stopped covering the other. doctor is in the second one.

Gates at this commit:
  npm run typecheck            exit 0
  release_coherence            10 pass / 0 fail

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs(release): re-cut the candidate on the new base, and record the digest change

The base moved to 426b124 (#98), so every number in the packet was taken against
a tree that no longer exists. Re-run, commit-bound, at 22aa021:

  commitBound true, ok true, exit 0
  aether-agents-0.3.0.tgz
  sha256 8c5c119d93cabf49af0c49c97addb055308d508af93f8675a26b6f5c8ecba307
  527 entries, 597,400 packed / 2,459,474 unpacked

The digest CHANGED from the a63e1c6 run (25f33524…, 524 entries), and the packet
now says why that is the correct outcome rather than a discrepancy: #98 added
dist/src/core/command_dispatch.* and rewrote main.js, so the packed content is
genuinely different. A digest that had survived that change would have meant the
pack was not reading the tree.

Both mutation checks were re-measured against this base rather than carried
forward:

  skills drop   verify:production {"ok":true, ... "packedFiles":526}  MISSED IT
                release_coherence FAIL: dist/src/commands/skills.js
                restored -> 527 files, 10/10 pass

  teleport      verify:production {"ok":true, ... "packedFiles":527}  MISSED IT
                release_coherence FAIL: 'teleport — beam the working tree
                somewhere'
                restored -> registry byte-identical, 10/10 pass

I had initially edited the skills figure from 523 to 526 by inference. That is a
number nobody measured, so it was re-run before being written down.

Release-owned suite at this commit: 24 pass / 0 fail.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* release: regenerate the v0.3.0 truth against the merged main

* release: cover #105 in the v0.3.0 notes

* release: bind the v0.3.0 operator packet to the head that carries #105

Regenerates the packet against a845479 (origin/main after #105): base SHA,
evidence commit, tarball digest, packed entry count, the recorded
release-candidate run, and the coverage breakdown.

Two corrections rather than refreshes:

- Section 5 no longer lists the full test suite as unproven. It was run at
  the evidence commit (1464 tests, 1460 pass, 0 fail, 4 skipped); what is
  genuinely unproven is the suite INSIDE the candidate run, which reports
  npm-test as not-run by design.
- Two new unproven entries name the deployed API. The notes' Authentication
  claims are about a server this repository cannot test, and #105 exists
  precisely because `aether agent` does not work end to end against
  production today. Both are marked rather than implied.

* release: record the measured tarball size, not a rounded one

The packed size in the packet header was written from npm's rounded
"740.0 kB" notice rather than measured. The tarball is 739,977 bytes.
A digest and a byte count that disagree are the same class of defect
this packet exists to close.

---------

Co-authored-by: DBarr3 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

2 participants