Skip to content

chore(standards): guard-test fixtures must use the real persisted shape (ag-jwtx #test-standard-names-real-shape-requirement)#776

Merged
boshu2 merged 5 commits into
mainfrom
chore/ag-jwtx-real-shape-fixture-standard
Jun 6, 2026
Merged

chore(standards): guard-test fixtures must use the real persisted shape (ag-jwtx #test-standard-names-real-shape-requirement)#776
boshu2 merged 5 commits into
mainfrom
chore/ag-jwtx-real-shape-fixture-standard

Conversation

@boshu2
Copy link
Copy Markdown
Owner

@boshu2 boshu2 commented Jun 6, 2026

What

Encodes a test standard from ag-jwtx: skip/dedup/consumed/idempotency/regression guard tests must build fixtures from the real persisted data shape — round-trip a real sample (production writer → reader) or assert against a checked-in real example — never a hand-built in-memory constructor that sets a marker at a granularity the on-disk format never emits.

Why

ag-mjlg (PR #652) shipped a next-work materialize over-creation bug (44 vs 16) green because TestNextWorkMaterialize_SkipsConsumed set consumed at the per-item level while real next-work.jsonl marks it at the batch level. The guard exercised a shape production never produces → false green. This converts that one-off into a durable standard + a pre-mortem flag (catch→encode→never-repeat).

Changes (docs/standards only)

  • skills/standards/references/test-pyramid.md — new Fixture Fidelity section (the standard + how-to-comply + the pre-mortem flag).
  • skills/standards/references/go.md + .claude/rules/go.md — Test-Conventions bullet (kept in parity).
  • skills/pre-mortem/references/mandatory-checks.md — two flags added to the Test Pyramid Coverage Check (Mandatory) table.

Verification

  • markdownlint --config .markdownlint.json on all four files: clean.
  • scripts/generate-registry.sh --check: registry up to date (no new reference files; existing files edited).
  • Docs-only; no code paths touched.

Scenario

Given the AI-native test-shape standard doc, when an agent writes a skip/dedup/consumed guard test, then the standard requires the fixture to come from a round-tripped real persisted sample, and a pre-mortem/checklist item flags item-level-only fixtures for batch-level state.

Closes-scenario: ag-jwtx#test-standard-names-real-shape-requirement
Bounded-context: BC1-Corpus
Evidence: skills/standards/references/test-pyramid.md

…ed shape (ag-jwtx #test-standard-names-real-shape-requirement)

Skip/dedup/consumed/idempotency/regression guard tests must build fixtures
by round-tripping a real persisted sample (production writer -> reader) or
asserting against a checked-in real example -- never a hand-built in-memory
constructor that sets a marker at a granularity the on-disk format never
emits. Encodes the ag-mjlg / PR #652 false-green: a guard test set `consumed`
at item-level while next-work.jsonl marks it at batch-level, so CI passed on
a shape production can't produce.

- skills/standards/references/test-pyramid.md: new "Fixture Fidelity" section
- skills/standards/references/go.md + .claude/rules/go.md: Test-Conventions bullet
- skills/pre-mortem/references/mandatory-checks.md: two flags in the
  Test Pyramid Coverage Check (Mandatory)

Closes-scenario: ag-jwtx#test-standard-names-real-shape-requirement
Bounded-context: BC1-Corpus
Evidence: skills/standards/references/test-pyramid.md
@github-actions github-actions Bot added the skills label Jun 6, 2026
…(ag-jwtx)

The references edits in this PR (pre-mortem/references/mandatory-checks.md,
standards/references/{go,test-pyramid}.md) drifted the codex twin hashes
for both skills. Regenerated via scripts/regen-codex-hashes.sh --only
pre-mortem,standards. Fixes the skill-gates 'codex hashes (no drift)' check.

Bounded-context: BC2-Skills
boshu2 added a commit that referenced this pull request Jun 6, 2026
…nk ../ (ag-eatf #safe-paths-doclink-filter) (#796)

## What

`scripts/skill-eval.sh` treated ms's `safe-paths` rule as blocking on
**every** `../`. That rule is a blunt regex, and `../` relative markdown
doc-links are the repo-wide SKILL.md convention (47+ skills, e.g.
`[x](../other/SKILL.md)`, `../../docs/...md`). SKILL.md is
documentation, not executed code, so those are false positives — they
redded `skill-eval` → `summary` on **every skills-touching PR** (blocked
#776; gated #759/#764/#767 in this session's drain).

## Fix

Added a file-level filter: `safe-paths` stays **blocking only when a
`../` survives stripping (1) markdown inline-link targets `](...)` and
(2) relative doc-path tokens (`*.md/.markdown/.mdx/.txt/.rst`)** — i.e.
a real, non-doc `../`. Otherwise the findings downgrade to advisory
annotations (announced, not silenced).

Net effect: **purely removes false positives; real protection is
preserved.** A genuine traversal (e.g. `../../../../etc/passwd` in a
description) still blocks — verified. No regression to the other
blocking rules.

## Evidence

- `bats tests/scripts/skill-eval.bats` → 12/12 pass (10 prior + 2 new
ag-eatf cases: doc-links downgrade→PASS; real non-doc `../`→BLOCK).
- Manual: `agent-native` and `domain` skills (previously red on
safe-paths) now PASS; a mixed real-threat fixture BLOCKs.

Closes-scenario: ag-eatf#safe-paths-doclink-filter
Bounded-context: BC2-Validation
Evidence: scripts/skill-eval.sh
@boshu2 boshu2 merged commit 0dfac4a into main Jun 6, 2026
15 of 16 checks passed
@boshu2 boshu2 deleted the chore/ag-jwtx-real-shape-fixture-standard branch June 6, 2026 14:17
boshu2 added a commit that referenced this pull request Jun 6, 2026
…d hole)

The embedded-sync step ran only on hooks/go/ci changes, but the embedded
files mirror skills/standards/references/*, skills/using-agentops/SKILL.md and
skills/compile/scripts/compile.sh. A skills-only PR could drift the embeds
undetected — exactly how #776 reached main with empty embedded standards files
(main-red 2026-06-06). Add skills + contracts to the gate condition so this
class can't slip through PR CI again.
boshu2 added a commit that referenced this pull request Jun 6, 2026
…k follow-up) (#799)

## Main is red — hotfix

`cli/embedded/skills/standards/references/{go,test-pyramid}.md` were
**empty (0 bytes)** on main HEAD; #776's merge truncated them.
`contracts-sync` / `correctness` run the full embedded-sync check on
main-push (changed-files-scoped on PRs, so it slipped through during the
batch drain) → main Validate failed (run on 3df599d, def8fc9).

## Fix
- Re-synced both embedded files from their sources via the
`cli/Makefile` recipe (`cp ../skills/standards/references/*`).
`scripts/validate-embedded-sync.sh` now reports **All embedded files are
in sync**.
- Corrected that script's stale fix hint: `make sync-embedded` (no such
target) → `make sync-hooks` (the real recipe).

## Evidence
`bash scripts/validate-embedded-sync.sh` → "All embedded files are in
sync."

Bounded-context: BC5-Runtime
Evidence: cli/embedded/skills/standards/references/go.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant