@event4u/agent-config 14.16.0 → 14.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +177 -213
  5. package/README.md +2 -2
  6. package/dist/agent-src/commands/analyze/inbox.md +172 -6
  7. package/dist/agent-src/commands/fix/commit-messages.md +336 -0
  8. package/dist/agent-src/commands/fix.md +5 -3
  9. package/dist/agent-src/commands/pr/merge.md +35 -44
  10. package/dist/agent-src/rules/commit-conventions.md +1 -1
  11. package/dist/agent-src/skills/accessibility-auditor/SKILL.md +2 -0
  12. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +27 -1
  13. package/dist/agent-src/skills/aws-infrastructure/SKILL.md +41 -0
  14. package/dist/agent-src/skills/code-intelligence/SKILL.md +60 -12
  15. package/dist/agent-src/skills/complexity-first-planning/SKILL.md +27 -0
  16. package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +234 -4
  17. package/dist/agent-src/skills/design-review/SKILL.md +2 -0
  18. package/dist/agent-src/skills/feature-planning/SKILL.md +34 -0
  19. package/dist/agent-src/skills/git-workflow/SKILL.md +37 -12
  20. package/dist/agent-src/skills/git-workflow/references/push-closes-its-loop.md +176 -0
  21. package/dist/agent-src/skills/laravel-mail/SKILL.md +44 -0
  22. package/dist/agent-src/skills/terraform/SKILL.md +29 -0
  23. package/dist/agent-src/skills/testing-anti-patterns/SKILL.md +40 -0
  24. package/dist/agent-src/skills/threat-modeling/data/reasoning.csv +1 -0
  25. package/dist/agent-src/skills/threat-modeling/data/surfaces.csv +1 -0
  26. package/dist/agent-src/skills/threat-modeling/data/threats.csv +5 -0
  27. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +12 -0
  28. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +53 -8
  29. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +3 -1
  30. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  31. package/dist/cli-delegate/cmd_conformance.js +335 -659
  32. package/dist/cli-delegate/cmd_explain.js +24 -112
  33. package/dist/discovery/deprecation-report.md +1 -1
  34. package/dist/discovery/discovery-manifest.json +55 -29
  35. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  36. package/dist/discovery/discovery-manifest.summary.md +3 -3
  37. package/dist/discovery/dormancy-report.md +1 -1
  38. package/dist/discovery/orphan-report.md +1 -1
  39. package/dist/discovery/packs.json +6 -5
  40. package/dist/discovery/trust-report.md +2 -2
  41. package/dist/discovery/workspaces.json +5 -4
  42. package/dist/hooks/dispatch.js +959 -1304
  43. package/dist/mcp/registry-manifest.json +3 -3
  44. package/dist/mcp/server.json +2 -2
  45. package/dist/mcp/server.mjs +671 -1002
  46. package/dist/shared/settingsConsent.js +1 -1
  47. package/package.json +1 -1
  48. package/src/config/conformance-claim-baseline.json +9 -0
  49. package/src/config/gate-violation-baselines.json +3 -3
  50. package/src/config/release-gate-locality.yml +129 -0
  51. package/src/config/web-launch-readiness.json +1 -1
  52. package/src/scripts/_cli/explain_last/index.ts +1 -1
  53. package/src/scripts/_cli/explain_last/memory.ts +8 -104
  54. package/src/scripts/_lib/release_highlights.ts +172 -1
  55. package/src/scripts/_lib/release_material.ts +66 -0
  56. package/src/scripts/_lib/repeated_run.ts +77 -0
  57. package/src/scripts/_lib/tamper_vocabulary.ts +242 -0
  58. package/src/scripts/_lib/unified_diff.ts +121 -0
  59. package/src/scripts/check_artefact_count_messaging.ts +9 -0
  60. package/src/scripts/check_finding_dispositions.ts +179 -3
  61. package/src/scripts/check_installed_hooks_fresh.ts +381 -0
  62. package/src/scripts/check_release_highlights.ts +89 -4
  63. package/src/scripts/check_suppression_hygiene.ts +11 -0
  64. package/src/scripts/check_web_launch_readiness.ts +295 -15
  65. package/src/scripts/code_graph/build.ts +230 -33
  66. package/src/scripts/code_graph/extract.ts +168 -33
  67. package/src/scripts/code_graph/types.ts +37 -2
  68. package/src/scripts/code_graph/validate.ts +12 -1
  69. package/src/scripts/conformance_scan.ts +2 -2
  70. package/src/scripts/detect_silent_catch.ts +403 -0
  71. package/src/scripts/detect_verification_tampering.ts +538 -0
  72. package/src/scripts/git_authorization_hook.ts +153 -17
  73. package/src/scripts/hook_manifest.json +1 -1
  74. package/src/scripts/hook_manifest.yaml +33 -19
  75. package/src/scripts/hooks/block_no_verify.ts +3 -3
  76. package/src/scripts/hooks/concern_registry.ts +2 -2
  77. package/src/scripts/hooks/evidence_independence.ts +21 -2
  78. package/src/scripts/hooks/{block_unauthorized_git.ts → git_command_classifier.ts} +25 -369
  79. package/src/scripts/hooks/push_settle_hook.ts +250 -0
  80. package/src/scripts/hooks/ship_diff_volume_hook.ts +1 -1
  81. package/src/scripts/install-hooks.sh +134 -1
  82. package/src/scripts/language_mirror_hook.ts +27 -5
  83. package/src/scripts/measure_release_mix.ts +384 -0
  84. package/src/scripts/release.ts +31 -143
  85. package/src/scripts/release_drill.ts +71 -1
  86. package/src/scripts/release_mix_taxonomy.json +172 -0
  87. package/src/scripts/release_publication.ts +243 -3
  88. package/src/scripts/release_verify.ts +220 -0
  89. package/src/scripts/schemas/review-findings.schema.json +1 -1
  90. package/src/scripts/schemas/skill.schema.json +11 -1
  91. package/src/scripts/self_review_gate.ts +10 -1
  92. package/src/shared/settingsConsent.ts +1 -1
  93. package/src/scripts/attest_artifact.ts +0 -193
@@ -208,6 +208,46 @@ rg -n '\b(it|test|describe)\.skip\b|\.only\b|xit\(|xdescribe\(|@pytest\.mark\.(s
208
208
 
209
209
  This is the test-surface instance of the `autonomous-execution` N=3 / allowlist-growth antipattern (bulk `skip`/`xfail` to force green counts as the tool being wrong, not the content) and the `verify-before-complete` floor (green must be *earned*, not manufactured).
210
210
 
211
+ ### The named smells — canonical vocabulary, and what it does NOT cover
212
+
213
+ The behaviors above are described; two of them also have field names a
214
+ reviewer can cite, and this table is where the name meets the behavior. The
215
+ grep column follows the shape [`ai-code-blindspots`](../ai-code-blindspots/SKILL.md)
216
+ uses: an authoring-time backstop, zero results is the pass, a hit is a prompt
217
+ to read that line — never an auto-fix.
218
+
219
+ | Canonical name | The behavior, as already described above | Backstop grep |
220
+ |---|---|---|
221
+ | **Magic-number test** | Anti-Pattern 6 — "a hardcoded expected value the code will always emit". The expectation is a literal rather than something derived from the input, so the test cannot disagree with the code. | `rg -n '\b(toBe\|toEqual\|assertEquals\|assertSame)\(\s*-?[0-9]{2,}' tests/` |
222
+ | **Assertion roulette** | The multi-case stack Anti-Pattern 6 *requires* (boundary, error, abuse in one test), written without per-assertion messages — so a failure names a line number and not a reason. The stack is right; the silence is the smell. | `rg -c '\b(expect\|assert\w*\|self\.assert\w*\|\$this->assert\w*)\(' tests/ \| awk -F: '$2 >= 8'` |
223
+
224
+ Both greps are scoped to **the test file you just wrote**, not to a tree —
225
+ `tests/` above is a placeholder for that path. Run over a whole repository
226
+ they are useless as verdicts: measured on this repository on 2026-09-04 the
227
+ first returns 585 lines and the second 1189 files, because an exact assertion
228
+ against a two-digit literal and a file with eight assertions are both ordinary.
229
+ They are authoring-time prompts to reread one file, exactly as
230
+ `ai-code-blindspots` states, and neither is a gate.
231
+
232
+ The second grep counts per **file**, not per test — no regex sees a test
233
+ boundary.
234
+
235
+ **Three further names are deliberately NOT in the table**, recorded here so a
236
+ later round meets a record rather than a fresh argument. Measured 2026-09-04
237
+ over both files of this skill: `roulette`, `eager`, `lazy` and `duplicate` each
238
+ return **0** occurrences, and `hardcoded` returns **6**.
239
+
240
+ - **Eager test** (one test exercising several behaviors) would carry the same
241
+ behavior and the same grep as assertion roulette above, and Anti-Pattern 6
242
+ *prescribes* the shape on purpose. A row for it would be one entry under two
243
+ names, which is the drift this table exists to prevent.
244
+ - **Lazy test** (several tests over one fixture, differing only in name) is
245
+ described nowhere above. A row would be new guidance wearing a naming step's
246
+ clothes.
247
+ - **Duplicate assert** (the same condition asserted twice in one test) is
248
+ likewise undescribed, and is not greppable without parsing test boundaries —
249
+ so it could not carry the backstop column even if it were.
250
+
211
251
  ## Output format
212
252
 
213
253
  1. The mocking decision recorded as a one-line comment in the test file (`// mock at <seam>: <reason>`).
@@ -8,3 +8,4 @@ public-endpoint,Rate limit + cache + minimal payload,"{""if_search_endpoint"": "
8
8
  billing,Ledger + idempotency + server-side amounts,"{""if_refunds"": ""one-way-state-machine"", ""if_webhooks_from_psp"": ""verify-signature-and-amount""}",Mutable balance column updates,CRITICAL
9
9
  secrets,Manager + redaction + scan,"{""if_third_party_keys"": ""scope-and-rotate-quarterly"", ""if_ci_pipeline"": ""masked-vars-only""}",Secrets in env committed to VCS,HIGH
10
10
  data-exposure,Allowlist serializers + contract tests,"{""if_admin_fields"": ""separate-serializer"", ""if_logs_contain_payloads"": ""logger-redaction-keys""}",Spreading model attributes into responses,MEDIUM
11
+ infrastructure,Deny-by-default ingress + encryption on + scoped IAM,"{""if_management_or_db_port"": ""no-internet-cidr-use-bastion-or-private-link"", ""if_object_storage"": ""block-public-access-at-account-and-bucket"", ""if_iam_policy"": ""enumerate-actions-and-resource-arns""}",Permissive defaults left in place because the resource works either way,HIGH
@@ -8,3 +8,4 @@ Public unauthenticated endpoint,public endpoint health status unauthenticated an
8
8
  Billing / payment / balance mutation,billing payment charge refund invoice subscription balance credit,billing,money movement,Anything that changes an amount owed/paid
9
9
  Secrets / key handling,secret api-key signing key env vault kms rotation,secrets,credentials,"Storage, rotation, and logging paths"
10
10
  Data export / serializer / log channel,export serializer api-resource log audit csv download report,data-exposure,"PII, internal fields",Response shaping and log sinks
11
+ Infrastructure / IaC resource definition,terraform iac infrastructure provisioning security group ingress egress cidr bucket storage iam role subnet vpc encryption,infrastructure,"network reachability, data at rest, cloud credentials",Any IaC change to networking storage IAM or encryption defaults
@@ -14,3 +14,8 @@ billing,Race condition on balance / double-spend,CWE-362,Parallel requests redee
14
14
  billing,Price/amount tampering,CWE-602,Client-supplied price or currency trusted at checkout,Recompute amounts server-side from catalog; signed cart or server-held cart only,Test: tampered client amount → server total unchanged,CRITICAL
15
15
  secrets,Secret leakage via logs / errors / VCS,"CWE-532, ATT&CK T1552","Key appears in exception payload, debug log, or committed .env",Centralized secret manager; logger redaction list; pre-commit secret scan; scoped short-lived tokens,Test: forced exception on auth path → no credential substring in log sink,HIGH
16
16
  data-exposure,Over-broad serializer / API resource,"CWE-213, OWASP API3","Serializer returns internal fields (cost, flags, foreign tenant refs) the UI ignores but attackers read",Explicit field allowlist per resource; separate admin vs public serializers; contract test on response shape,Test: schema-diff response against documented contract → no undocumented fields,MEDIUM
17
+ infrastructure,Unrestricted ingress to a management or database port,"CWE-1327, ATT&CK T1190",Attacker reaches SSH/RDP or a database engine straight from the internet because a security-group or firewall rule allows 0.0.0.0/0,"Deny-by-default ingress; management and database ports reachable only via bastion, VPN, or private link; CIDR scoped to known ranges; never 0.0.0.0/0 on 22/3389/3306/5432/6379/27017","Test: a rule with cidr_blocks 0.0.0.0/0 on a management or database port is rejected. Decided by: NO CHECK IN THIS REPOSITORY - nothing here parses HCL or cloud config; the deciding check is the consumer's own IaC policy scanner",CRITICAL
18
+ infrastructure,Object storage public by default,"CWE-732, OWASP A05",Bucket or container created without a block-public-access setting so any object URL is world-readable,Block public access at account AND bucket level; explicit policy allowlist instead of a public ACL; serve objects via signed URLs or a CDN origin identity,"Test: storage created with no explicit public-access block is rejected; anonymous GET of a stored object returns 403. Decided by: NO CHECK IN THIS REPOSITORY - the deciding check is the consumer's own IaC policy scanner or a cloud posture tool",HIGH
19
+ infrastructure,Missing encryption at rest or in transit,"CWE-311, CWE-319",Volume snapshot bucket or database instance created with no encryption block; endpoint accepts a plaintext connection,Encryption block mandatory on every storage and database resource; customer-managed key where the data class requires it; TLS-only bucket policy and listener; reject plaintext listeners,"Test: a storage or database resource with no encryption block is rejected; a plaintext connection to the endpoint is refused. Decided by: NO CHECK IN THIS REPOSITORY - the deciding check is the consumer's own IaC policy scanner",HIGH
20
+ infrastructure,Wildcard IAM action or resource,"CWE-269, ATT&CK T1078.004",A role policy grants Action * or Resource * so one compromised workload credential reaches every service and object in the account,Enumerate actions and resource ARNs; one role per workload; permission boundary or service control policy on privileged roles; no wildcard outside a named reviewed exception,"Test: a policy document containing Action ""*"" or Resource ""*"" is rejected or carries a named exception. Decided by: NO CHECK IN THIS REPOSITORY - nothing here parses IAM policy documents; the deciding check is the consumer's own IaC policy scanner",CRITICAL
21
+ infrastructure,Credential in an IaC or vars file instead of a secret manager,"CWE-798, ATT&CK T1552.001",Password token or key written as a literal into a .tf .tfvars or .yaml file and committed,Secret-manager reference or runtime-injected env var; never a literal in IaC or vars files; treat the state file as sensitive and store it encrypted with restricted access,"Test: a literal credential in a tracked IaC or vars file fails the build. Decided by: check_secret_leak (src/scripts/check_secret_leak.ts) inside THIS repository - it has no extension allowlist so .tf and .yaml are in scope; for a CONSUMER the deciding check is the gitleaks workflow the package ships as a template that the consumer must copy",HIGH
@@ -109,6 +109,18 @@ Ask format:
109
109
 
110
110
  **Recommendation: 1 — `.worktrees/`** — project-local keeps the worktree next to the repo (easy cleanup), and the leading dot keeps it out of `ls`. Caveat: pick 3 if multiple repos must share a single worktree root.
111
111
 
112
+ > **A worktree outside the repository root costs the persistent shell cwd.**
113
+ > It sits outside the host's working-directory boundary, so a `cd` into it does
114
+ > not survive the call — Claude Code appends `Shell cwd was reset to <root>` and
115
+ > the next command runs in the main checkout. Every command then repeats its own
116
+ > `cd`, and one that forgets edits the wrong tree silently. Measured 2026-09-05
117
+ > on this repository: 2,128 transcript records carrying that line across 20
118
+ > sessions, alongside 1,694 whose `cd` targeted a worktree placed beside the
119
+ > repo. Choosing option 3 — or any path outside the root — means also declaring
120
+ > the parent directory in the host's working-directory allowlist
121
+ > (`permissions.additionalDirectories` on Claude Code). Options 1 and 2 are
122
+ > inside the root and need nothing.
123
+
112
124
  ### 3. Verify ignore-safety (project-local only)
113
125
 
114
126
  ```bash
@@ -94,9 +94,38 @@ Each iteration is agent turns, never executing control-flow code:
94
94
  * **Plateau** (last `plateau_window` scores within `tolerance`) → STOP; surface
95
95
  suspected flakiness or a stuck point. Do not thrash.
96
96
  * **`attempts == max_attempts`** → STOP, hand back the best envelope.
97
- 4. **Numeric gate** — score `< threshold` and attempts remain → back to step 1
98
- (attempts++). Score `≥ threshold`, no regression → **escalate** (step 4 of the
99
- stage).
97
+ 4. **Tamper check (deterministic, loop-local)** — before the numeric gate is
98
+ allowed to say anything, run the detector over the diff this attempt
99
+ produced and over the recorded verdict:
100
+
101
+ ```bash
102
+ ./scripts-run src/scripts/detect_verification_tampering \
103
+ --diff <this attempt's diff> --message <this attempt's message> \
104
+ --verdict <the runner's recorded verdict>
105
+ ```
106
+
107
+ It is **fail-closed inside the loop**: outcome `violations` or
108
+ `stale_verdict` STOPS the loop and hands back with the finding's
109
+ `file:line`, whatever the score says. `clean` changes nothing — an
110
+ ordinary passing attempt is unaffected, because the detector reports only
111
+ on shapes the diff introduced.
112
+
113
+ The check answers exactly the gap the Iron Law names: `assertion-removed`,
114
+ `assertion-weakened`, `verification-skipped` (warn), `expectation-rewritten`,
115
+ `early-exit-injected`, `test-file-deleted`, `subject-mocked-away`, and
116
+ `stale_verdict` for a runner that finished before the last edit. A change
117
+ that legitimately deletes an obsolete test or relaxes an over-tight
118
+ assertion declares it in the attempt's message —
119
+ `tamper-allow: <detector-id> — <reason>` — scoped to one id, never to all.
120
+
121
+ It is **not** a CI gate and does not become one here. The tree's measured
122
+ lesson is that reach, not content, is the scarce thing; a new always-on
123
+ gate is the opposite of that lesson. Promotion owes a measured
124
+ false-positive rate first.
125
+
126
+ 5. **Numeric gate** — score `< threshold` and attempts remain → back to step 1
127
+ (attempts++). Score `≥ threshold`, no regression, tamper check clean →
128
+ **escalate** (step 4 of the stage).
100
129
 
101
130
  ### 4. Judge escalation (only after the numeric gate passes)
102
131
 
@@ -135,10 +164,13 @@ Before finalizing, confirm:
135
164
 
136
165
  1. The numeric gate **escalated to a judge** — it did not apply on its own.
137
166
  2. No baseline-green check regressed (or the loop stopped and said so).
138
- 3. The loop stopped at `max_attempts`, a plateau, or a judge `apply` — never
167
+ 3. The tamper check ran on the final attempt and returned `clean` — or the loop
168
+ stopped on its finding. A green verdict recorded over a `violations` or
169
+ `stale_verdict` outcome is not a green verdict.
170
+ 4. The loop stopped at `max_attempts`, a plateau, or a judge `apply` — never
139
171
  ran unbounded.
140
- 4. The judge saw only the diff + results, dispatched in fresh context.
141
- 5. No **unsupervised** resident process introduced — and none of the four
172
+ 5. The judge saw only the diff + results, dispatched in fresh context.
173
+ 6. No **unsupervised** resident process introduced — and none of the four
142
174
  governance conditions in `resident-process-governance.md` left unmet if a
143
175
  supervised one is. (Amended 2026-08-27, ADR-249: this read "No daemon /
144
176
  persistent runtime introduced" when a daemon was prohibited outright. The
@@ -182,9 +214,15 @@ iter2 fixes A, breaks B, 92% → "PASS" ✗ regression ignored
182
214
  ## Gotcha
183
215
 
184
216
  * **Metric gaming** — the agent "passes" by deleting a failing test or
185
- weakening an assertion. The numeric gate cannot catch this; the
186
- fresh-context judge is the safeguard. If the diff *removes* checks,
217
+ weakening an assertion. The *numeric* gate still cannot catch this, and that
218
+ is why loop step 3.4 exists: `detect_verification_tampering` decides the
219
+ mechanical shapes deterministically, and the fresh-context judge remains the
220
+ safeguard for everything shape cannot decide. If the diff *removes* checks,
187
221
  that is a `reject`, not a `pass`.
222
+ * **Phantom verification** — the loop records a green verdict it never re-ran,
223
+ so the exit code describes a tree that no longer exists. The verdict carries
224
+ the runner's own timestamp; one that predates the last edit is
225
+ `stale_verdict`, its own outcome, never a pass.
188
226
  * **Flake mistaken for a plateau** — a single non-deterministic test flips
189
227
  the score and the window-comparison reads it as "no improvement". Re-run
190
228
  the suspected check before declaring a plateau; surface flakiness instead
@@ -202,6 +240,9 @@ iter2 fixes A, breaks B, 92% → "PASS" ✗ regression ignored
202
240
  ## Do NOT
203
241
 
204
242
  * NEVER let the numeric score apply a change without judge confirmation.
243
+ * NEVER record a green verdict over a tamper finding or a stale runner
244
+ timestamp — inside the loop the detector is fail-closed.
245
+ * NEVER widen a `tamper-allow` declaration past the one id it names.
205
246
  * NEVER continue past a regression because the overall score improved.
206
247
  * NEVER run the live-app Playwright path here — it is deferred (needs a runtime).
207
248
  * NEVER judge with the generator's own context — dispatch a fresh-context judge.
@@ -215,6 +256,10 @@ iter2 fixes A, breaks B, 92% → "PASS" ✗ regression ignored
215
256
  review; wires this loop as an opt-in step.
216
257
  * [`playwright-testing`](../playwright-testing/SKILL.md),
217
258
  [`quality-tools`](../quality-tools/SKILL.md) — verdict sources.
259
+ * `src/scripts/detect_verification_tampering.ts` — the loop-local tamper and
260
+ phantom-verification check bound at step 3.4, with its fixture corpus in
261
+ `tests/fixtures/tamper-corpus/` and its polarity proven both ways by
262
+ `--self-test`.
218
263
  * [`autonomous-execution`](../../rules/autonomous-execution.md) — the N=3 cap.
219
264
  * [`resident-process-governance`](../../../docs/contracts/resident-process-governance.md) — the
220
265
  runtime-free constraint this loop honors.
@@ -143,7 +143,9 @@ activity for 48 h. `review` keeps its disqualifying reason so the next sweep
143
143
  starts from a shorter list; `live` means another session may hold it. A
144
144
  worktree outside the conventional roots is never `safe` — sitting beside the
145
145
  repo it can be mistaken for a sibling package, so its removal stays a
146
- judgement call.
146
+ judgement call. It is also the placement that loses the persistent shell
147
+ cwd on a host with a working-directory boundary — see
148
+ [`using-git-worktrees`](../using-git-worktrees/SKILL.md) § 2.
147
149
 
148
150
  The mode reports only. `--plan` prints `git worktree remove` plus
149
151
  `git branch -d` (never `-D`) for the safe set; **running it is a bulk deletion
@@ -39,7 +39,7 @@ schema_version: 1
39
39
  # CI guard: a release bump of `package.json` must update this value
40
40
  # in lockstep — see scripts/check_template_pin_drift.ts (road-to-
41
41
  # portable-runtime-and-update-check P3.3).
42
- agent_config_version: "14.16.0"
42
+ agent_config_version: "14.18.0"
43
43
 
44
44
  # --- Project identity ---
45
45
  project: