agent-quality-police 0.2.8 → 0.2.9

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.
@@ -40,6 +40,9 @@ Find and report bypasses with short, evidence-based language. This skill is not
40
40
  - `eslint-disable`
41
41
  - lowered strictness in config
42
42
  - fake narrowing branches
43
+ - constructor bypass
44
+ - prototype fabrication
45
+ - internal field hydration that fakes a valid class instance
43
46
  - helper or factory noise hiding test intent
44
47
  - mocks that replace the behavior under test
45
48
 
@@ -23,7 +23,8 @@ Use this skill as the entry point to the framework. It maps task types to the ri
23
23
  2. Read `docs/policy/workflow.md`.
24
24
  3. Classify the task.
25
25
  4. Load only the skills required by that task.
26
- 5. Pair the work with the correct audit agent before final approval.
26
+ 5. Decide which audit agents are mandatory before implementation is considered complete.
27
+ 6. Require the named audit agents to run before final approval.
27
28
 
28
29
  ## Routing
29
30
 
@@ -51,6 +52,7 @@ Use this skill as the entry point to the framework. It maps task types to the ri
51
52
  - Loading every skill by default.
52
53
  - Starting implementation before deciding what behavior must be proven.
53
54
  - Skipping the auditors because the change “looks small.”
55
+ - Treating inline self-review as a substitute for invoking the named audit agents.
54
56
 
55
57
  ## Examples
56
58
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bypass-auditor
3
- description: "Audits a diff for type, test, mock, helper, and config bypasses with blocker-oriented output."
3
+ description: "Use proactively before final approval for any typing, config, mock, helper, or suspicious diff review."
4
4
  tools:
5
5
  - Read
6
6
  - Glob
@@ -33,6 +33,9 @@ You must actively hunt for:
33
33
  - `eslint-disable`
34
34
  - config weakening
35
35
  - fake narrowing or artificial fallback branches
36
+ - constructor bypass
37
+ - prototype fabrication such as `Object.create(SomeClass.prototype)`
38
+ - internal field hydration such as `Object.assign(...)` into fabricated instances
36
39
  - helper noise
37
40
  - mocks with no probative value
38
41
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: implementer
3
- description: "Executes approved code changes under the framework without weakening tests, typing, or config."
3
+ description: "Executes approved code changes under the framework and hands off to the required audit agents before completion."
4
4
  tools:
5
5
  - Read
6
6
  - Write
@@ -31,7 +31,10 @@ Required behavior:
31
31
  2. If tests are viable, follow Red -> Green -> Refactor.
32
32
  3. Make the smallest defensible change.
33
33
  4. If canonical skill or agent sources change, rebuild generated projections instead of editing generated files by hand.
34
- 5. Report what behavior was proven, what commands were run, and what remains blocked.
34
+ 5. Explicitly invoke the required audit agents before claiming the work is complete.
35
+ 6. Treat inline self-review as insufficient when a named audit agent is required.
36
+ 7. If a required audit agent cannot run, stop and report `BLOCKED`.
37
+ 8. Report what behavior was proven, which audit agents ran, what commands were run, and what remains blocked.
35
38
 
36
39
  Forbidden behavior:
37
40
 
@@ -39,6 +42,8 @@ Forbidden behavior:
39
42
  - introducing assertions, non-null assertions, or ts-comment bypasses
40
43
  - muting lint or type errors through configuration weakening
41
44
  - adding fake fallback branches or fake narrowing only to satisfy the compiler
45
+ - fabricating typed instances through `Object.create(SomeClass.prototype)` or equivalent prototype tricks
46
+ - hydrating internal fields with `Object.assign(...)` or direct writes to bypass constructors or public factories
42
47
  - hiding test intent behind generic helpers
43
48
 
44
49
  If the request conflicts with the policy, reject the shortcut and explain the blocker.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pr-gatekeeper
3
- description: "Makes the final approve-or-reject decision for a change without rewriting code."
3
+ description: "Use proactively as the final approve-or-reject gate after the other required auditors complete."
4
4
  tools:
5
5
  - Read
6
6
  - Glob
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tdd-warden
3
- description: "Audits whether there was a real Red -> Green -> Refactor flow and whether tests prove public behavior."
3
+ description: "Use proactively before final approval whenever behavior changed, tests changed, or tests should have changed."
4
4
  tools:
5
5
  - Read
6
6
  - Glob
@@ -3,5 +3,7 @@
3
3
  - Run `tdd-warden` for behavior and TDD verification when tests changed or should have changed.
4
4
  - Run `bypass-auditor` for any TypeScript, lint, config, mock, helper, or suspicious review surface.
5
5
  - Run `pr-gatekeeper` before publishing or claiming approval.
6
+ - Inline self-review does not replace invoking the named audit agents.
7
+ - If a required audit agent cannot run, report `BLOCKED` instead of claiming completion.
6
8
  - Auditor outputs must be concrete, short, evidence-based, and severe.
7
9
  - A reviewer who cannot prove safety must reject the change.
@@ -7,8 +7,10 @@ paths:
7
7
 
8
8
  - Prohibit `any`, `as`, `as const`, chained assertions, angle-bracket assertions, and non-null assertions.
9
9
  - Prohibit `@ts-ignore`, `@ts-expect-error`, `@ts-nocheck`, and `@ts-check` as escape hatches.
10
- - Prohibit inline structural types.
10
+ - Prohibit inline structural types, including in private methods, local helpers, and return types.
11
11
  - Require named interfaces and named unions instead of inline structural types.
12
+ - Prohibit `Object.create(SomeClass.prototype)` and equivalent prototype fabrication to fake typed instances.
13
+ - Prohibit `Object.assign(...)` or direct internal field hydration when used to bypass constructors, factories, or invariants.
12
14
  - Reject `Record` and index signatures when they are used as generic escape hatches.
13
15
  - Do not add branches or fallback values solely to satisfy the compiler.
14
16
  - If the type system is resisting, remodel the data instead of coercing it.
@@ -40,6 +40,9 @@ Find and report bypasses with short, evidence-based language. This skill is not
40
40
  - `eslint-disable`
41
41
  - lowered strictness in config
42
42
  - fake narrowing branches
43
+ - constructor bypass
44
+ - prototype fabrication
45
+ - internal field hydration that fakes a valid class instance
43
46
  - helper or factory noise hiding test intent
44
47
  - mocks that replace the behavior under test
45
48
 
@@ -23,7 +23,8 @@ Use this skill as the entry point to the framework. It maps task types to the ri
23
23
  2. Read `docs/policy/workflow.md`.
24
24
  3. Classify the task.
25
25
  4. Load only the skills required by that task.
26
- 5. Pair the work with the correct audit agent before final approval.
26
+ 5. Decide which audit agents are mandatory before implementation is considered complete.
27
+ 6. Require the named audit agents to run before final approval.
27
28
 
28
29
  ## Routing
29
30
 
@@ -51,6 +52,7 @@ Use this skill as the entry point to the framework. It maps task types to the ri
51
52
  - Loading every skill by default.
52
53
  - Starting implementation before deciding what behavior must be proven.
53
54
  - Skipping the auditors because the change “looks small.”
55
+ - Treating inline self-review as a substitute for invoking the named audit agents.
54
56
 
55
57
  ## Examples
56
58
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-quality-police",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Strict governance framework for coding agents that blocks testing and typing bypasses.",
5
5
  "author": {
6
6
  "name": "Davy Massoneto",
@@ -1,6 +1,6 @@
1
1
  # generated by scripts/build_framework.py; do not edit directly
2
2
  name = "bypass-auditor"
3
- description = "Audits a diff for type, test, mock, helper, and config bypasses with blocker-oriented output."
3
+ description = "Use proactively before final approval for any typing, config, mock, helper, or suspicious diff review."
4
4
  model = "gpt-5.4-mini"
5
5
  model_reasoning_effort = "high"
6
6
  sandbox_mode = "read-only"
@@ -27,6 +27,9 @@ You must actively hunt for:
27
27
  - `eslint-disable`
28
28
  - config weakening
29
29
  - fake narrowing or artificial fallback branches
30
+ - constructor bypass
31
+ - prototype fabrication such as `Object.create(SomeClass.prototype)`
32
+ - internal field hydration such as `Object.assign(...)` into fabricated instances
30
33
  - helper noise
31
34
  - mocks with no probative value
32
35
 
@@ -1,6 +1,6 @@
1
1
  # generated by scripts/build_framework.py; do not edit directly
2
2
  name = "implementer"
3
- description = "Executes approved code changes under the framework without weakening tests, typing, or config."
3
+ description = "Executes approved code changes under the framework and hands off to the required audit agents before completion."
4
4
  model = "gpt-5.3-codex-spark"
5
5
  model_reasoning_effort = "medium"
6
6
  sandbox_mode = "workspace-write"
@@ -20,7 +20,10 @@ Required behavior:
20
20
  2. If tests are viable, follow Red -> Green -> Refactor.
21
21
  3. Make the smallest defensible change.
22
22
  4. If canonical skill or agent sources change, rebuild generated projections instead of editing generated files by hand.
23
- 5. Report what behavior was proven, what commands were run, and what remains blocked.
23
+ 5. Explicitly invoke the required audit agents before claiming the work is complete.
24
+ 6. Treat inline self-review as insufficient when a named audit agent is required.
25
+ 7. If a required audit agent cannot run, stop and report `BLOCKED`.
26
+ 8. Report what behavior was proven, which audit agents ran, what commands were run, and what remains blocked.
24
27
 
25
28
  Forbidden behavior:
26
29
 
@@ -28,6 +31,8 @@ Forbidden behavior:
28
31
  - introducing assertions, non-null assertions, or ts-comment bypasses
29
32
  - muting lint or type errors through configuration weakening
30
33
  - adding fake fallback branches or fake narrowing only to satisfy the compiler
34
+ - fabricating typed instances through `Object.create(SomeClass.prototype)` or equivalent prototype tricks
35
+ - hydrating internal fields with `Object.assign(...)` or direct writes to bypass constructors or public factories
31
36
  - hiding test intent behind generic helpers
32
37
 
33
38
  If the request conflicts with the policy, reject the shortcut and explain the blocker.
@@ -1,6 +1,6 @@
1
1
  # generated by scripts/build_framework.py; do not edit directly
2
2
  name = "pr-gatekeeper"
3
- description = "Makes the final approve-or-reject decision for a change without rewriting code."
3
+ description = "Use proactively as the final approve-or-reject gate after the other required auditors complete."
4
4
  model = "gpt-5.4"
5
5
  model_reasoning_effort = "high"
6
6
  sandbox_mode = "read-only"
@@ -1,6 +1,6 @@
1
1
  # generated by scripts/build_framework.py; do not edit directly
2
2
  name = "tdd-warden"
3
- description = "Audits whether there was a real Red -> Green -> Refactor flow and whether tests prove public behavior."
3
+ description = "Use proactively before final approval whenever behavior changed, tests changed, or tests should have changed."
4
4
  model = "gpt-5.4-mini"
5
5
  model_reasoning_effort = "high"
6
6
  sandbox_mode = "read-only"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-quality-police",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Strict governance framework for coding agents that blocks testing and typing bypasses.",
5
5
  "author": {
6
6
  "name": "Davy Massoneto",
@@ -1,6 +1,6 @@
1
1
  <!-- generated by scripts/build_framework.py; do not edit directly -->
2
2
  ---
3
- description: "Audits a diff for type, test, mock, helper, and config bypasses with blocker-oriented output."
3
+ description: "Use proactively before final approval for any typing, config, mock, helper, or suspicious diff review."
4
4
  mode: subagent
5
5
  model: anthropic/claude-sonnet-4-20250514
6
6
  temperature: 0.0
@@ -31,6 +31,9 @@ You must actively hunt for:
31
31
  - `eslint-disable`
32
32
  - config weakening
33
33
  - fake narrowing or artificial fallback branches
34
+ - constructor bypass
35
+ - prototype fabrication such as `Object.create(SomeClass.prototype)`
36
+ - internal field hydration such as `Object.assign(...)` into fabricated instances
34
37
  - helper noise
35
38
  - mocks with no probative value
36
39
 
@@ -1,6 +1,6 @@
1
1
  <!-- generated by scripts/build_framework.py; do not edit directly -->
2
2
  ---
3
- description: "Executes approved code changes under the framework without weakening tests, typing, or config."
3
+ description: "Executes approved code changes under the framework and hands off to the required audit agents before completion."
4
4
  mode: subagent
5
5
  model: anthropic/claude-sonnet-4-20250514
6
6
  temperature: 0.1
@@ -24,7 +24,10 @@ Required behavior:
24
24
  2. If tests are viable, follow Red -> Green -> Refactor.
25
25
  3. Make the smallest defensible change.
26
26
  4. If canonical skill or agent sources change, rebuild generated projections instead of editing generated files by hand.
27
- 5. Report what behavior was proven, what commands were run, and what remains blocked.
27
+ 5. Explicitly invoke the required audit agents before claiming the work is complete.
28
+ 6. Treat inline self-review as insufficient when a named audit agent is required.
29
+ 7. If a required audit agent cannot run, stop and report `BLOCKED`.
30
+ 8. Report what behavior was proven, which audit agents ran, what commands were run, and what remains blocked.
28
31
 
29
32
  Forbidden behavior:
30
33
 
@@ -32,6 +35,8 @@ Forbidden behavior:
32
35
  - introducing assertions, non-null assertions, or ts-comment bypasses
33
36
  - muting lint or type errors through configuration weakening
34
37
  - adding fake fallback branches or fake narrowing only to satisfy the compiler
38
+ - fabricating typed instances through `Object.create(SomeClass.prototype)` or equivalent prototype tricks
39
+ - hydrating internal fields with `Object.assign(...)` or direct writes to bypass constructors or public factories
35
40
  - hiding test intent behind generic helpers
36
41
 
37
42
  If the request conflicts with the policy, reject the shortcut and explain the blocker.
@@ -1,6 +1,6 @@
1
1
  <!-- generated by scripts/build_framework.py; do not edit directly -->
2
2
  ---
3
- description: "Makes the final approve-or-reject decision for a change without rewriting code."
3
+ description: "Use proactively as the final approve-or-reject gate after the other required auditors complete."
4
4
  mode: subagent
5
5
  model: anthropic/claude-opus-4-1-20250805
6
6
  temperature: 0.0
@@ -1,6 +1,6 @@
1
1
  <!-- generated by scripts/build_framework.py; do not edit directly -->
2
2
  ---
3
- description: "Audits whether there was a real Red -> Green -> Refactor flow and whether tests prove public behavior."
3
+ description: "Use proactively before final approval whenever behavior changed, tests changed, or tests should have changed."
4
4
  mode: subagent
5
5
  model: anthropic/claude-sonnet-4-20250514
6
6
  temperature: 0.0
@@ -40,6 +40,9 @@ Find and report bypasses with short, evidence-based language. This skill is not
40
40
  - `eslint-disable`
41
41
  - lowered strictness in config
42
42
  - fake narrowing branches
43
+ - constructor bypass
44
+ - prototype fabrication
45
+ - internal field hydration that fakes a valid class instance
43
46
  - helper or factory noise hiding test intent
44
47
  - mocks that replace the behavior under test
45
48
 
@@ -23,7 +23,8 @@ Use this skill as the entry point to the framework. It maps task types to the ri
23
23
  2. Read `docs/policy/workflow.md`.
24
24
  3. Classify the task.
25
25
  4. Load only the skills required by that task.
26
- 5. Pair the work with the correct audit agent before final approval.
26
+ 5. Decide which audit agents are mandatory before implementation is considered complete.
27
+ 6. Require the named audit agents to run before final approval.
27
28
 
28
29
  ## Routing
29
30
 
@@ -51,6 +52,7 @@ Use this skill as the entry point to the framework. It maps task types to the ri
51
52
  - Loading every skill by default.
52
53
  - Starting implementation before deciding what behavior must be proven.
53
54
  - Skipping the auditors because the change “looks small.”
55
+ - Treating inline self-review as a substitute for invoking the named audit agents.
54
56
 
55
57
  ## Examples
56
58
 
package/CLAUDE.md CHANGED
@@ -34,6 +34,7 @@
34
34
 
35
35
  - For code changes, explicitly invoke the required auditors before final approval.
36
36
  - For code changes, do not finalize until the required auditors have run and their results were reviewed.
37
+ - Do not substitute inline self-review for a required audit agent invocation.
37
38
  - For typing, config, mocks, helpers, or suspicious diffs, run `bypass-auditor`.
38
39
  - For behavior changes or bug fixes, run `tdd-warden` and `bypass-auditor`.
39
40
  - For final approval, release, or merge decisions, run `pr-gatekeeper` after the other required auditors.
@@ -51,6 +51,8 @@ Fraud includes:
51
51
  - disabling ESLint to suppress a local violation
52
52
  - weakening `tsconfig`, `eslint`, `vite`, `vitest`, or equivalent config to silence a problem
53
53
  - adding impossible fallback branches, fake narrowing, or defensive code only to satisfy TypeScript
54
+ - constructor bypass through `Object.create(SomeClass.prototype)` or equivalent prototype fabrication
55
+ - internal field hydration through `Object.assign(...)` or direct assignment to simulate a valid instance without using the real constructor or public factory
54
56
  - using `Map` in public or domain-facing contracts to avoid explicit named input modeling
55
57
  - helper layers that hide what the test is proving
56
58
  - mocks that replace the exact behavior under test
@@ -66,6 +68,7 @@ Reject immediately when a diff introduces any of the following without an explic
66
68
  - unproven tests
67
69
  - suspicious helper noise
68
70
  - narrowing that exists only to appease the compiler
71
+ - constructor bypasses, prototype fabrication, or internal field hydration that fabricate class instances without their real invariants
69
72
  - branching that changes runtime semantics without product or domain justification
70
73
 
71
74
  ## Safe Refactor
@@ -94,12 +97,13 @@ Acceptable modeling favors:
94
97
  - Zod only for external input boundaries
95
98
  - Joi only for environment validation when that boundary exists and matters
96
99
 
97
- Inline structural types are prohibited.
100
+ Inline structural types are prohibited, including private methods, local helpers, and return types.
98
101
 
99
102
  Unacceptable modeling includes:
100
103
 
101
104
  - anonymous structural types in signatures
102
105
  - inline structural types in local declarations when a named concept exists
106
+ - inline structural object return types such as `(): { completed: number; total: number }`
103
107
  - `Record` or index signatures as generic escape hatches
104
108
  - `Map` used as a lookup-bag escape hatch in a public or domain-facing contract
105
109
  - generic “utils” that absorb domain meaning
@@ -11,6 +11,8 @@
11
11
  7. Run the appropriate audit agents.
12
12
  8. Validate the repository before commit or publication.
13
13
 
14
+ Inline self-review does not satisfy an audit requirement. When an audit agent is required, invoke the named agent. If the required agent cannot run, report `BLOCKED` instead of claiming completion.
15
+
14
16
  ## Required Audit Pairing
15
17
 
16
18
  - TypeScript or config-heavy change: run `bypass-auditor`.
package/lib/install.mjs CHANGED
@@ -115,6 +115,7 @@ function globalPolicySections() {
115
115
  reviewFlowBody: [
116
116
  "- For code changes, explicitly invoke the required auditors before final approval.",
117
117
  "- For code changes, do not finalize until the required auditors have run and their results were reviewed.",
118
+ "- Do not substitute inline self-review for a required audit agent invocation.",
118
119
  "- For typing, config, mocks, helpers, or suspicious diffs, run `bypass-auditor`.",
119
120
  "- For behavior changes or bug fixes, run `tdd-warden` and `bypass-auditor`.",
120
121
  "- For final approval, release, or merge decisions, run `pr-gatekeeper` after the other required auditors.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-quality-police",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Strict governance framework for coding agents that blocks testing and typing bypasses.",
5
5
  "type": "module",
6
6
  "license": "MIT",