Skip to content

Commit acf9054

Browse files
committed
feat: enforce behavior-focused testing guidance
- steer audits, reconciliation, and implementers toward real production boundaries - preserve legitimate text-contract tests and avoid duplicated production logic - update project prompts and replace proxy tests with observable behavior checks
1 parent 2a60ebc commit acf9054

15 files changed

Lines changed: 281 additions & 57 deletions

File tree

‎AGENTS.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,24 @@
9797
changed observable contracts, reported regressions, meaningful boundaries,
9898
and plausible costly failures, especially security, trust-boundary, or
9999
data-loss risks.
100+
- Test observable production behavior instead of inspecting implementation
101+
text. Prefer the narrowest real executable boundary: use the public interface
102+
when practical; otherwise call the actual production function or module and
103+
assert inputs, outputs, state transitions, side effects, failures, or
104+
persisted results. Use focused integration tests when behavior spans
105+
components.
106+
- Do not use source-file reads, regex or literal presence, snapshots, symbol
107+
counts, private-helper calls, or internal statement ordering as proxies for
108+
functionality. Source-text assertions are appropriate only when the text is
109+
itself the observable contract, including generated artifacts, CLI or prompt
110+
output, externally consumed configuration, migration SQL, and installed
111+
template, skill, or agent assets. Assert only the smallest meaningful textual
112+
contract.
113+
- Do not recreate production decision logic inside tests. If no real executable
114+
boundary exists, introduce the smallest localized test seam only when
115+
justified. Otherwise preserve the existing regression coverage and report why
116+
safe behavioral replacement would require disproportionate, risky, or
117+
ambiguous restructuring.
100118
- Use one representative case per necessary observable contract or reported
101119
regression. Skip speculative edge cases, redundant permutations,
102120
implementation-detail assertions, and contrived or unreachable states.

‎RELEASE_NOTES.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
- Add conservative context optimization to project audits and template reconciliation, with semantic ownership, selective routing, byte measurements, and idempotence reporting.
2-
- Make the canonical template and generated prompts maintain concise `AGENTS.md` routers and evidence-backed `PLANS.md` indexes without changing existing CLI or state contracts.
3-
- Add semantic preservation and routing fixtures for safeguards, feature dependencies, nested instructions, overrides, configured fallbacks, missing references, and no-op projects.
1+
- Add behavior-focused testing guidance for audits, reconciliation, and implementation agents, prioritizing real production boundaries while preserving genuine text-contract tests.
2+
- Update project sync and audit prompts to activate focused test-quality review without broad legacy cleanup.
3+
- Replace duplicated production logic and source-inspection proxies with observable output and behavior checks.

‎TEMPLATE_AGENTS.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,24 @@ triggered skills and selectively read references.
205205
repository has an established test setup, cover changed observable contracts,
206206
reported regressions, meaningful boundaries, and plausible costly failures,
207207
especially security, trust-boundary, or data-loss risks.
208+
- Test observable production behavior instead of inspecting implementation
209+
text. Prefer the narrowest real executable boundary: use the public interface
210+
when practical; otherwise call the actual production function or module and
211+
assert inputs, outputs, state transitions, side effects, failures, or
212+
persisted results. Use a focused integration test when the contract spans
213+
components.
214+
- Do not use source-file reads, regex or literal presence, snapshots, symbol
215+
counts, private-helper calls, or internal statement ordering as proxies for
216+
functionality. Source-text assertions are appropriate only when the text is
217+
itself the observable contract, such as generated artifacts, CLI, help, or
218+
prompt output, serialization or protocol formats, externally consumed
219+
configuration, migration SQL, or required templates and instructions. Assert
220+
only the smallest meaningful textual contract.
221+
- Do not recreate production decision logic inside tests. If no real executable
222+
boundary exists, introduce the smallest localized test seam only when
223+
justified. Otherwise preserve the existing regression coverage and report why
224+
safe behavioral replacement would require disproportionate, risky, or
225+
ambiguous restructuring.
208226
- Use one representative case per necessary observable contract or reported
209227
regression. Skip speculative edge cases, redundant permutations,
210228
implementation-detail assertions, and contrived or unreachable states.

‎assets/TEMPLATE_AGENTS.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,24 @@ triggered skills and selectively read references.
205205
repository has an established test setup, cover changed observable contracts,
206206
reported regressions, meaningful boundaries, and plausible costly failures,
207207
especially security, trust-boundary, or data-loss risks.
208+
- Test observable production behavior instead of inspecting implementation
209+
text. Prefer the narrowest real executable boundary: use the public interface
210+
when practical; otherwise call the actual production function or module and
211+
assert inputs, outputs, state transitions, side effects, failures, or
212+
persisted results. Use a focused integration test when the contract spans
213+
components.
214+
- Do not use source-file reads, regex or literal presence, snapshots, symbol
215+
counts, private-helper calls, or internal statement ordering as proxies for
216+
functionality. Source-text assertions are appropriate only when the text is
217+
itself the observable contract, such as generated artifacts, CLI, help, or
218+
prompt output, serialization or protocol formats, externally consumed
219+
configuration, migration SQL, or required templates and instructions. Assert
220+
only the smallest meaningful textual contract.
221+
- Do not recreate production decision logic inside tests. If no real executable
222+
boundary exists, introduce the smallest localized test seam only when
223+
justified. Otherwise preserve the existing regression coverage and report why
224+
safe behavioral replacement would require disproportionate, risky, or
225+
ambiguous restructuring.
208226
- Use one representative case per necessary observable contract or reported
209227
regression. Skip speculative edge cases, redundant permutations,
210228
implementation-detail assertions, and contrived or unreachable states.

‎assets/agents/implementer.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You write the actual code and run the smallest relevant validation that proves t
1313
1. Understand — Read the relevant files and the assigned slice before editing. Don't guess at contracts.
1414
2. UI/style preflight — When UI appearance or interaction changes, inspect the closest same-purpose shipped features (especially tables, filters, search, forms, dialogs, and page layouts), then record the applicable components, tokens, layout, responsive behavior, interactions, states, and accessibility conventions. Data, content, event, or backend-only changes do not trigger this step unless they change that UI contract. Reuse applicable patterns. If no written standard exists but trustworthy repeated precedent does, derive concise always-on guidance in `AGENTS.md` and feature-specific decisions or exceptions in `PLANS.md`. Pause and ask the user whether to keep, update, or override before divergence, changing a guideline, resolving conflicts, or proceeding without a trustworthy analogue. Use browser or screenshot tooling for rendered comparison when available; otherwise report unavailable.
1515
3. Implement — Make the smallest change that satisfies the slice; follow the discovered UI and code patterns, naming, and idioms. Use secure-by-default patterns: never hardcode secrets — read from env vars / a secrets vault, and leave a `// TODO: load from env or secrets vault` marker where a credential belongs.
16-
4. Unit test — Add or update one representative test for each necessary observable contract or reported regression. Keep boundary coverage only for an explicit requirement, past defect, or plausible security, trust-boundary, or data-loss failure; skip speculative edge cases and redundant permutations.
16+
4. Unit test — Add or update one representative test for each necessary observable contract or reported regression. Exercise the narrowest real production boundary when practical; otherwise call the actual production function or module, or use a focused integration test when behavior spans components. Never read production source, match implementation text, count symbols, snapshot code, or assert private helper calls as a proxy for functionality, and never recreate a production decision algorithm in test-local code. Source-text assertions are appropriate only when text is itself the observable contract, such as generated artifacts, CLI or prompt output, protocols, externally consumed configuration, migration SQL, or required templates and instructions. Introduce only the smallest localized test seam when justified. If safe behavioral coverage would require disproportionate, risky, or ambiguous restructuring, preserve the regression coverage and report the limitation. Keep boundary coverage only for an explicit requirement, past defect, or plausible security, trust-boundary, or data-loss failure; skip speculative edge cases and redundant permutations.
1717
5. Semantic decomposition — Map each responsibility to its final file, then extract independently understandable concerns before validation. Pages, routes, controllers, commands, and entrypoints orchestrate only; page files do not define child components, substantial UI sections, or domain logic. Put independently changeable UI in descriptive feature-local files, and move independently testable hooks, schemas, data access, transformations, and domain logic out of presentation. Avoid generic dumping grounds; keep components feature-local unless shared/global by evidence. Tiny inseparable helpers or markup may remain inline. An unrelated small fix need not trigger broad refactoring. Name any concrete framework/tooling exception in the handoff.
1818
6. Validate — Run the smallest existing check that proves the changed observable behavior. Run broader tests, lint, formatting, or builds only when affected shared behavior, a failure, the changed files, or an explicit release requirement justifies them. Paste the actual result. If validation fails, fix and re-run — never report success on red.
1919
7. Hand off — Send every completed feature to `code-reviewer` for structural and UI consistency review. Report the responsibility map, extracted files, applicable precedent/standard, tests, rendered comparison or its unavailability, and output. State plainly if anything is unverified.

‎assets/agents/quick-implementer.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Proceed only when the requested change is well specified, localized to one or tw
1717
1. Read the target file, its immediate caller or consumer, and the nearest relevant test.
1818
2. UI/style preflight — When UI appearance or interaction changes, inspect the closest same-purpose shipped UI and reuse its components, tokens, layout, responsive behavior, interactions, states, and accessibility conventions. Data, content, event, or backend-only changes do not trigger this step unless they change that UI contract. If no written standard exists but trustworthy repeated precedent does, record always-on guidance in `AGENTS.md` and feature-specific decisions or exceptions in `PLANS.md`. Pause and ask the user whether to keep, update, or override before divergence, changing a guideline, resolving conflicts, or proceeding without a trustworthy analogue. Use browser or screenshot comparison when available; otherwise report unavailable. Escalate visual-direction work beyond this role's scope to `implementer`.
1919
3. Make the smallest in-scope edit. Preserve unrelated user changes.
20-
4. Add or update one focused test only for a necessary observable contract or reported regression when a test harness exists. Keep boundary coverage only for an explicit requirement, past defect, or plausible security, trust-boundary, or data-loss failure.
20+
4. Add or update one focused test only for a necessary observable contract or reported regression when a test harness exists. Exercise the narrowest real production boundary when practical; otherwise call the actual production function or module, or use a focused integration test when behavior spans components. Never inspect implementation text as a proxy for functionality or recreate a production decision algorithm in test-local code. Source-text assertions are appropriate only when text is itself the observable contract, such as generated artifacts, CLI or prompt output, protocols, externally consumed configuration, migration SQL, or required templates and instructions. Introduce only the smallest localized test seam when justified; preserve the regression coverage and report when safe behavioral replacement would require disproportionate, risky, or ambiguous restructuring. Keep boundary coverage only for an explicit requirement, past defect, or plausible security, trust-boundary, or data-loss failure.
2121
5. Semantic decomposition — Map responsibilities to final files and extract independently understandable concerns before validation. Pages, routes, controllers, commands, and entrypoints orchestrate only; child UI, substantial sections, and domain logic belong in descriptive feature-local files. Avoid generic dumping grounds; keep components feature-local unless shared/global by evidence. Tiny inseparable helpers or markup may remain inline. Name any concrete framework/tooling exception.
2222
6. Validate the decomposed implementation with the smallest existing check that proves the changed observable behavior. Run formatting, lint, build, or broader tests only when the changed files or an explicit release requirement make them relevant.
2323
7. Hand off — Route every completed feature to `code-reviewer` for structural and UI consistency review. Report changed files, responsibility map, extracted files, applicable precedent/standard, rendered comparison or its unavailability, validation result, and any unverified point in at most eight bullets.

‎assets/skills/codex-kit-audit-agents/SKILL.md‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,28 @@ as static rather than claiming observed context selection.
7474

7575
Review relevant tests, package scripts, workflows, skill triggers, and
7676
validation commands. Require the smallest existing check that proves changed
77-
observable behavior. Remove tests only when they are demonstrably duplicate,
78-
obsolete, or speculative; preserve explicit regression and plausible security,
79-
trust-boundary, or data-loss coverage. Repair stale commands or paths only from
80-
repository evidence, narrow overly broad skill triggers, and validate every
81-
created or modified project skill with an available skill validator.
77+
observable behavior. In relevant test audits, identify source-inspection tests
78+
used as proxies for runtime behavior and production decision logic recreated in
79+
test-local code. Determine the legitimate regression or observable contract
80+
each test protects, then prefer the narrowest existing production boundary: the
81+
public interface when practical, otherwise the actual production function or
82+
module, or a focused integration test when behavior spans components. Introduce
83+
only the smallest localized test seam when justified. Remove an old
84+
source-inspection or duplicated-logic test only after its legitimate contract is
85+
covered.
86+
87+
Preserve focused source-text assertions when text is itself the observable
88+
contract, including generated artifacts, CLI, help, or prompt output,
89+
serialization or protocol formats, externally consumed configuration, migration
90+
SQL, and required templates or instructions. Do not delete tests merely because
91+
they assert strings. When behavioral replacement would require disproportionate,
92+
risky, or ambiguous restructuring, preserve the regression coverage and report
93+
the limitation instead of substituting fake behavioral coverage. Otherwise
94+
remove tests only when demonstrably duplicate, obsolete, or speculative;
95+
preserve explicit regression and plausible security, trust-boundary, or
96+
data-loss coverage. Repair stale commands or paths only from repository
97+
evidence, narrow overly broad skill triggers, and validate every created or
98+
modified project skill with an available skill validator.
8299

83100
If validation fails, restore only audit-attributable edits where safely
84101
possible, preserve pre-existing work, and report any partial state. The final
@@ -89,6 +106,8 @@ report must include:
89106
- routing scenarios and checks performed;
90107
- justified large always-loaded sections;
91108
- unresolved conflicts, ambiguities, missing references, and unavailable checks;
109+
- source-inspection or duplicated-logic tests replaced, preserved as genuine
110+
text contracts, or reported as unsafe to restructure;
92111
- preservation, reference-integrity, and idempotence results.
93112

94113
This audit is independent of template synchronization. Never run `project sync`,

‎assets/skills/codex-kit-reconcile-agents/SKILL.md‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,22 @@ description: Reconcile a refreshed TEMPLATE_AGENTS.md with project guidance, opt
6565
Information already read in the current conversation need not be removed
6666
from its history.
6767
10. Review relevant tests, scripts, workflows, skill triggers, and validation
68-
commands. Require the smallest existing check that proves changed observable
69-
behavior. Remove tests only when demonstrably duplicate, obsolete, or
70-
speculative while preserving regression and plausible security,
71-
trust-boundary, or data-loss coverage.
68+
commands. Classify incoming and existing testing guidance by whether it
69+
exercises observable production behavior through the narrowest real
70+
executable boundary. Never promote source inspection, implementation-text
71+
matching, or test-local copies of production decision logic as functional
72+
verification. Preserve focused source-text assertions when text is itself
73+
the observable contract, including generated artifacts, CLI or prompt
74+
output, protocols, externally consumed configuration, migration SQL, and
75+
required templates or instructions. Introduce only the smallest justified
76+
test seam, preserve regression and plausible security, trust-boundary, or
77+
data-loss coverage, and report cases that cannot be improved without
78+
disproportionate, risky, or ambiguous restructuring. Repair tests only when
79+
they are directly relevant to changed guidance or required validation;
80+
otherwise report low-value source-inspection or duplicated-logic tests as
81+
audit candidates rather than broadening reconciliation into unrelated test
82+
rewrites. Remove tests only when demonstrably duplicate, obsolete, or
83+
speculative.
7284
11. Validate reference integrity, preserved semantic ownership, always-on
7385
safeguards, representative routing, project skills, and expected second-run
7486
idempotence. Validate every created or modified project skill with an

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@iamdevlinph/codex-kit",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"description": "Portable Codex subagents and project AGENTS.md defaults.",
55
"type": "module",
66
"bin": {

0 commit comments

Comments
 (0)