20 Commits

Author SHA1 Message Date
Bo 5d61bf8a3f fix: kill the shared-config gremlin class (hook-safe repo-root, git-env scrubbing, config-hygiene gate) (#922)
Fixes the three gremlins observed 2026-07-18 (bead
age-gate-scripts-worktree-gitdir-p62wo):

1. **Gate scripts broke under hook env from linked worktrees** (#919
regression): new scripts/lib/repo-root.sh (GIT_*-scrubbed resolution,
BASH_SOURCE anchor, worktree-correct) swept across 32 scripts. Proof:
this PR's own push ran the pre-push gates from a linked worktree and
passed.
2. **core.bare=true recurrence**: mechanism proven (leaked GIT_DIR +
no-arg git init --bare rewrites the SHARED config); writer traced with
high confidence to a live Gas City city process (concrete suspect:
gascity cmd_rig_test.go runGitInTest, unscrubbed env + no-arg init
--bare — fork-side fix filed separately). Defense: new
always.git-config-hygiene gate fails fast on core.bare/test identities
with the repair command inline (--self-test proves fail-closed).
3. **Test/test@test.com identity leak**: writer convicted — our own
pre-push chain leaked GIT_DIR into go test, whose helpers wrote the
shared config via git -C (mechanism proven). Cut at both ends:
validate-go-fast scrubs env for children; every test git-helper set-site
scrubs; check-test-isolation gains a WARN-ratchet rule (baseline 3 →
FAIL at 0).

Gates: shellcheck rc=0 across 36 scripts; go build/vet clean;
655+379+149 tests; hygiene self-test; both originally-failing validators
pass under the repro env.
2026-07-18 18:20:16 -04:00
boshu cb2a7ac398 refactor: complete the cathedral cut 2026-07-15 00:21:02 -04:00
boshu 9c6a662203 feat(loop): refactor the four-umbrella operating loop
Bead: age-four-umbrella-loop-refactor-xz4ps.1
2026-07-13 06:48:50 -04:00
boshu c6e23d2036 feat(skills): mesh native genies and factory orchestration (age-o43w) 2026-07-10 10:52:06 -04:00
Boden Fuller d451d6a549 fix(codex-gate): static reference-counterpart assertion — catch parity twins dropping source refs (age-odv) 2026-06-19 22:50:34 -04:00
Boden Fuller ff9356d921 feat(codex-twins): pointer-exemption mechanism — twin_is_pointer + parity_policy:pointer marker (age-k2ag) 2026-06-19 22:26:56 -04:00
Boden Fuller 9fda90c824 feat(codex): scope 5 content validators to bespoke twins only (age-codex-lean)
parity_only twins are GENERATED by codex-sync and verified by its byte-exact
drift gate; re-checking content rules on generated artifacts is the whack-a-mole.
lint-codex-native, runtime-sections, api-conformance, audit-parity, and
generated-artifacts now skip parity twins (treatment != bespoke) and check
hand-authored bespoke twins + the override layer only. A generated artifact is
verified by regenerate-and-diff, not by re-checking content rules.

Verified: bespoke Claude-isms still caught; parity twins with accurate cross-runtime
content (cass/cc-hooks) no longer trip the gates.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 20:15:29 -04:00
Boden Fuller 2e7444b407 fix(gates): extend codex-twin content-divergence gate to SKILL.md body (age-j1g)
age-yxl gated source references/** divergence but left SKILL.md-body divergence
ungated (the residual it filed). Same silent-staleness: a source SKILL.md body
edit with a stale twin is masked by a regen hash bump.

validate-codex-generated-artifacts.sh now requires a real non-marker twin
content change when a source SKILL.md *body* changed — scoped to the BODY on
purpose: frontmatter-only edits (hex-wiring fields the twin never carries:
consumes/produces/hexagonal_role/context_rel) need no twin change and stay green,
so legit hex-wiring pushes don't red main. Body-vs-frontmatter is detected by
comparing the frontmatter-stripped body across the scope's base ref
(head: HEAD~1..HEAD; worktree: HEAD..working; staged/upstream handled);
conservative — any ambiguity (new file, unresolved base) requires the twin.

TEST: 3 new cases — body divergence FAILs under both worktree and head scopes,
frontmatter-only change PASSes. Verified both FAIL tests fail against the
unfixed gate (guard the regression). Real-skill smoke: frontmatter-strip yields
the correct body on discovery/rpi/skill-builder.

Closes-scenario: age-j1g#skillmd-body-gate
Bounded-context: BC2-Skills
Evidence: tests/scripts/test-codex-generated-artifacts.sh

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 15:03:36 -04:00
Boden Fuller 9e165bb65d fix(gates): block codex-twin content divergence on un-mirrored references edits (age-yxl)
PROBE (evidence, not inspection): built the post-mortem divergent state in a
worktree — edited skills/discovery/references/dag.md, ran regen-codex-hashes
(twin left stale), committed, ran both gates. check-codex-parity-drift.sh and
validate-codex-generated-artifacts.sh BOTH passed (exit 0). The audit is a
Claude-ism scanner that never reads source; the structural source->codex check
was satisfied by the regen marker bump alone (a counterfactual source-only
commit with zero codex files DID fail, proving the mechanism). Verdict: the
gate does NOT catch content divergence.

FIX (routed to the gate, per the verdict): validate-codex-generated-artifacts.sh
now requires a REAL twin content change to mirror a source references/** edit —
the generated .agentops-generated.json / .agentops-manifest.json bookkeeping no
longer satisfies the mirror requirement. Scoped to references/** (mirrored
near-verbatim) to avoid false-positiving the legit frontmatter-only/hex-wiring
flow that has no twin equivalent.

TEST: two new cases in test-codex-generated-artifacts.sh — divergence (regen
hash bump only) FAILs, mirrored edit PASSes. Verified the divergence test FAILs
against the unfixed gate (guards the regression) and PASSes against the fix.

DOCS: skill-builder/SKILL.md, AGENTS-CODEX.md, CLAUDE.md registry section now
state that editing an EXISTING skill needs a manual twin mirror (regen refreshes
hashes, not prose) — prior docs only warned about NEW skills. Dogfooded: this
commit's skill-builder edit is mirrored into its codex twin.

Closes-scenario: age-yxl#probe-and-gate-fix
Bounded-context: BC2-Skills
Evidence: .agents/learnings/2026-06-16-codex-twin-content-not-auto-mirrored.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 14:32:56 -04:00
Bo 092b99dad9 feat(skills): add skill-eval.sh ms-backed quality gate (ag-yzoz #skill-eval) (#726)
## What

Adds `scripts/skill-eval.sh` — a thin gate that runs one skill's
`SKILL.md` through Jeff Emanuel's `ms` (meta_skill) `lint` + `validate`.
The wrapper decides the gate purely on whether a **blocking** `rule_id`
appears (ms's own severity/exit is not trusted):

- Blocking: `no-secrets`, `no-injection`, `safe-paths`,
`required-metadata`, `no-cycle`, `valid-version` → non-zero exit.
- Everything else → annotated only (`::warning::`), never fails.
- `ms` not on PATH (or `MS_BIN` missing) → **loud `::error::` hard-fail
(exit 3)**, never skip-and-pass — a silent skip would recreate the
no-evaluation gap this gate closes.

Planted `skills/_fixtures/{bad,good}-skill/SKILL.md` fixtures +
`tests/scripts/skill-eval.bats` (10 tests) exercise the
bad/good/ms-absent contracts.

## Fixture scoping

`skills/_fixtures/` is non-skill scaffolding (planted fixtures). The
skill-enumerating gates/generators are taught to skip `skills/_*` so the
fixtures never inflate the skill count (stays 82) or fail registry /
schema / wiring / runtime / count gates. Touched enumerators:
`generate-registry`, `validate-skill-schema`, `sync-skill-counts`,
`validate-skill-count`, `generate-skill-catalog`,
`generate-context-map`, `validate-manifests`, `check-wiring-closure`,
`validate-headless-runtime-skills`, `lib/sku_catalog.py`,
`check-alias-collisions`, `run-all`, `test-runtime-opencode-smoke`,
`release-smoke-test`, `smoke-test`, `validate-skill`.

Does **not** touch `validate.yml` — wiring skill-eval.sh into CI is a
separate bead.

Epic: ag-czzf

## Verification

- `bats tests/scripts/skill-eval.bats` → 10/10 pass (ms 0.1.2 on PATH)
- `shellcheck scripts/skill-eval.sh` → clean
- `check-registry-drift`, `validate-skill-schema`, `sync-skill-counts`,
`run-all`, opencode-smoke → all PASS with fixtures present, skill count
= 82 (fixtures excluded)

Closes-scenario: ag-yzoz#skill-eval
Bounded-context: BC2-Validation
Evidence: scripts/skill-eval.sh

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-04 16:38:57 -04:00
Boden Fuller 98e581989c codex: retire stale artifact provenance metadata 2026-04-01 13:10:42 -04:00
Boden Fuller ea5d1148bb feat: harden codex hookless follow-up flows 2026-03-24 10:09:27 -04:00
Boden Fuller b5316baef7 fix: align codex skill bundle with runtime contract 2026-03-21 10:08:27 -04:00
Boshu2 7d5162591b fix: harden codex runtime skill parity 2026-03-18 16:19:51 -04:00
Boshu2 8e59cf1389 fix(skills-codex): audit + fix 60+ findings, strengthen CI gates
Skills content fixes:
- Add metadata.tier to all 54 skills-codex/ frontmatter
- Fix wrong-directory cross-refs in 11 skills (skills/ → ../)
- Remove Claude primitive leakage from 13 skills (TaskCreate,
  AskUserQuestion, read_file, Agent tool, claude-code-latest-features)
- Fix dead refs, link missing references, remove orphaned Claude files
- Fix malformed ..$X link syntax in brainstorm, codex-team, rpi, validation
- Minor skills/ fixes: release refs, using-agentops count, push sections

CI gate hardening (false-pass elimination):
- heal.sh: scan skills-codex/, add MISSING_TIER/MALFORMED_LINK/DUPLICATE_REF
- audit-codex-parity.py: +7 Claude primitive patterns, +WRONG_XREF_DIR
- validate-links.sh: add skills-codex/ to scan scope (726 → 1117 links)
- validate-codex-generated-artifacts.sh: frontmatter check, invoke audit
2026-03-15 13:51:49 -04:00
Boshu2 1420de852c fix(ci): deprecate sync-codex-native-skills.sh and remove parity drift checks
The sync script overwrites manual edits to skills-codex/. Since codex
skills are now manually maintained, this script is a footgun.

Changes:
- sync-codex-native-skills.sh: exits with error + deprecation message
- validate-codex-generated-artifacts.sh: removed parity drift enforcement
  (lines 138-186 that required source+codex to change together)
- install-codex.sh: skip sync call (skills-codex/ pre-built in bundle)
- install-codex-native-skills.sh: skip sync by default

Audit for drift manually: bash scripts/audit-codex-parity.sh
2026-03-14 18:51:16 -04:00
Boshu2 cc5fe93a6c fix(ci): replace rg with grep in codex artifact validator (rg not on CI runner) 2026-03-14 14:13:45 -04:00
Boshu2 62ce8b0d1c feat(skills): ag-wug epic + codex converter parity regen
- Add output_contract, effort tables, sparse checkout guidance to skills
- Update claude-code-latest-features.md across all skills
- Regenerate all 54 codex skills with improved converter rules
- Codex parity: 107 → 8 findings (92% reduction)
2026-03-14 02:27:59 -04:00
Boden Fuller 18c0db867c Hotfix Codex install docs and Athena metadata 2026-03-07 15:30:07 -05:00
Boden Fuller 9205270833 Harden local codex skill validation 2026-03-07 13:26:49 -05:00