@massa-ai/codex-plugin 1.30.0 → 1.32.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 (40) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/agent-profiles/balanced/massa-ai-audit-specialist.toml +2 -1
  3. package/agent-profiles/balanced/massa-ai-test-engineer.toml +2 -1
  4. package/agent-profiles/cheap/massa-ai-audit-specialist.toml +2 -1
  5. package/agent-profiles/cheap/massa-ai-test-engineer.toml +2 -1
  6. package/agent-profiles/heavy/massa-ai-audit-specialist.toml +2 -1
  7. package/agent-profiles/heavy/massa-ai-test-engineer.toml +2 -1
  8. package/agent-profiles/home/massa-ai-audit-specialist.toml +2 -1
  9. package/agent-profiles/home/massa-ai-test-engineer.toml +2 -1
  10. package/agent-profiles/work/massa-ai-audit-specialist.toml +2 -1
  11. package/agent-profiles/work/massa-ai-test-engineer.toml +2 -1
  12. package/agents/massa-ai-audit-specialist.toml +2 -1
  13. package/agents/massa-ai-test-engineer.toml +2 -1
  14. package/package.json +1 -1
  15. package/skills/agents/audit-specialist/SKILL.md +2 -1
  16. package/skills/agents/test-engineer/SKILL.md +2 -1
  17. package/skills/massa-ai/SKILL.md +2 -1
  18. package/skills/massa-ai/references/coding-guidelines.md +9 -0
  19. package/skills/massa-ai/references/implementation-delivery.md +1 -0
  20. package/skills/massa-ai/references/lessons.md +52 -0
  21. package/skills/massa-ai/references/spec-driven/validate.md +10 -0
  22. package/skills/massa-ai/scripts/lessons.ts +238 -2
  23. package/skills/massa-ai/workflows/architecture/architecture-fix.md +13 -0
  24. package/skills/massa-ai/workflows/bugs/bugs-fix.md +13 -0
  25. package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +4 -3
  26. package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +16 -3
  27. package/skills/massa-ai/workflows/debug.md +13 -0
  28. package/skills/massa-ai/workflows/discovery.md +236 -0
  29. package/skills/massa-ai/workflows/feature.md +18 -4
  30. package/skills/massa-ai/workflows/general.md +13 -0
  31. package/skills/massa-ai/workflows/implementation/implementation-fix.md +13 -0
  32. package/skills/massa-ai/workflows/maestro/maestro-fix.md +13 -0
  33. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +13 -0
  34. package/skills/massa-ai/workflows/pr-review.md +1 -1
  35. package/skills/massa-ai/workflows/refactor.md +14 -0
  36. package/skills/massa-ai/workflows/requirements/requirements-fix.md +13 -0
  37. package/skills/massa-ai/workflows/security/security-fix.md +13 -0
  38. package/skills/massa-ai/workflows/spec-driven.md +12 -0
  39. package/skills/massa-ai/workflows/tests/tests-audit.md +15 -1
  40. package/skills/massa-ai/workflows/tests/tests-fix.md +14 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "massa-ai",
3
- "version": "1.30.0",
3
+ "version": "1.32.0",
4
4
  "description": "massa-ai — semantic code search, memory, and context compression for Codex",
5
5
  "author": {
6
6
  "name": "Luiz Massa",
@@ -33,12 +33,13 @@ The `lens` field in the capability packet selects the audit behavior:
33
33
  | `requirements` | Requirements, spec, acceptance, scope alignment | `workflows/requirements/requirements-audit.md` |
34
34
  | `code-quality` | SOLID, Clean Code, KISS, YAGNI, DRY, maintainability | `workflows/code-quality/code-quality-audit.md` |
35
35
  | `performance` | Performance hotspots, allocation, latency, throughput | Domain-specific; no fixed reference |
36
+ | `tests` | Coverage, regression protection, assertion quality, variation | `workflows/tests/tests-audit.md` |
36
37
 
37
38
  All lenses share `references/audit-scope.md` (scope rules) and `references/audit-report-io.md` (report format).
38
39
 
39
40
  ## Inputs
40
41
  - `scope`: the target area, diff, or module to audit.
41
- - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance` (required).
42
+ - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance | tests` (required).
42
43
  - `inputs`: recalled facts, existing audit reports, source pointers.
43
44
  - `sensors`: static checks available for the lens (lint, typecheck, security scanners).
44
45
 
@@ -7,12 +7,13 @@ sandbox_mode = "workspace-write"
7
7
  developer_instructions = """# Test Engineer Agent Skill
8
8
 
9
9
  ## Mission
10
- Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria.
10
+ Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria, and that catches the five distinct error classes a test suite must cover: business-logic errors, code no test touched, hardcoded-example brittleness, built-the-wrong-thing, and drift over time.
11
11
 
12
12
  ## Responsibilities
13
13
  - Define unit test cases for core logic.
14
14
  - Define integration test cases for boundaries.
15
15
  - Identify edge cases and negative scenarios.
16
+ - Design variation/property-style test cases — vary inputs beyond the fixture example (bounds, parameter changes) — technique-level, library-neutral.
16
17
  - Produce a test plan aligned with acceptance criteria.
17
18
  - Ensure acceptance coverage maps to spec criteria.
18
19
 
@@ -33,12 +33,13 @@ The `lens` field in the capability packet selects the audit behavior:
33
33
  | `requirements` | Requirements, spec, acceptance, scope alignment | `workflows/requirements/requirements-audit.md` |
34
34
  | `code-quality` | SOLID, Clean Code, KISS, YAGNI, DRY, maintainability | `workflows/code-quality/code-quality-audit.md` |
35
35
  | `performance` | Performance hotspots, allocation, latency, throughput | Domain-specific; no fixed reference |
36
+ | `tests` | Coverage, regression protection, assertion quality, variation | `workflows/tests/tests-audit.md` |
36
37
 
37
38
  All lenses share `references/audit-scope.md` (scope rules) and `references/audit-report-io.md` (report format).
38
39
 
39
40
  ## Inputs
40
41
  - `scope`: the target area, diff, or module to audit.
41
- - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance` (required).
42
+ - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance | tests` (required).
42
43
  - `inputs`: recalled facts, existing audit reports, source pointers.
43
44
  - `sensors`: static checks available for the lens (lint, typecheck, security scanners).
44
45
 
@@ -7,12 +7,13 @@ sandbox_mode = "workspace-write"
7
7
  developer_instructions = """# Test Engineer Agent Skill
8
8
 
9
9
  ## Mission
10
- Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria.
10
+ Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria, and that catches the five distinct error classes a test suite must cover: business-logic errors, code no test touched, hardcoded-example brittleness, built-the-wrong-thing, and drift over time.
11
11
 
12
12
  ## Responsibilities
13
13
  - Define unit test cases for core logic.
14
14
  - Define integration test cases for boundaries.
15
15
  - Identify edge cases and negative scenarios.
16
+ - Design variation/property-style test cases — vary inputs beyond the fixture example (bounds, parameter changes) — technique-level, library-neutral.
16
17
  - Produce a test plan aligned with acceptance criteria.
17
18
  - Ensure acceptance coverage maps to spec criteria.
18
19
 
@@ -33,12 +33,13 @@ The `lens` field in the capability packet selects the audit behavior:
33
33
  | `requirements` | Requirements, spec, acceptance, scope alignment | `workflows/requirements/requirements-audit.md` |
34
34
  | `code-quality` | SOLID, Clean Code, KISS, YAGNI, DRY, maintainability | `workflows/code-quality/code-quality-audit.md` |
35
35
  | `performance` | Performance hotspots, allocation, latency, throughput | Domain-specific; no fixed reference |
36
+ | `tests` | Coverage, regression protection, assertion quality, variation | `workflows/tests/tests-audit.md` |
36
37
 
37
38
  All lenses share `references/audit-scope.md` (scope rules) and `references/audit-report-io.md` (report format).
38
39
 
39
40
  ## Inputs
40
41
  - `scope`: the target area, diff, or module to audit.
41
- - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance` (required).
42
+ - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance | tests` (required).
42
43
  - `inputs`: recalled facts, existing audit reports, source pointers.
43
44
  - `sensors`: static checks available for the lens (lint, typecheck, security scanners).
44
45
 
@@ -7,12 +7,13 @@ sandbox_mode = "workspace-write"
7
7
  developer_instructions = """# Test Engineer Agent Skill
8
8
 
9
9
  ## Mission
10
- Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria.
10
+ Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria, and that catches the five distinct error classes a test suite must cover: business-logic errors, code no test touched, hardcoded-example brittleness, built-the-wrong-thing, and drift over time.
11
11
 
12
12
  ## Responsibilities
13
13
  - Define unit test cases for core logic.
14
14
  - Define integration test cases for boundaries.
15
15
  - Identify edge cases and negative scenarios.
16
+ - Design variation/property-style test cases — vary inputs beyond the fixture example (bounds, parameter changes) — technique-level, library-neutral.
16
17
  - Produce a test plan aligned with acceptance criteria.
17
18
  - Ensure acceptance coverage maps to spec criteria.
18
19
 
@@ -33,12 +33,13 @@ The `lens` field in the capability packet selects the audit behavior:
33
33
  | `requirements` | Requirements, spec, acceptance, scope alignment | `workflows/requirements/requirements-audit.md` |
34
34
  | `code-quality` | SOLID, Clean Code, KISS, YAGNI, DRY, maintainability | `workflows/code-quality/code-quality-audit.md` |
35
35
  | `performance` | Performance hotspots, allocation, latency, throughput | Domain-specific; no fixed reference |
36
+ | `tests` | Coverage, regression protection, assertion quality, variation | `workflows/tests/tests-audit.md` |
36
37
 
37
38
  All lenses share `references/audit-scope.md` (scope rules) and `references/audit-report-io.md` (report format).
38
39
 
39
40
  ## Inputs
40
41
  - `scope`: the target area, diff, or module to audit.
41
- - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance` (required).
42
+ - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance | tests` (required).
42
43
  - `inputs`: recalled facts, existing audit reports, source pointers.
43
44
  - `sensors`: static checks available for the lens (lint, typecheck, security scanners).
44
45
 
@@ -7,12 +7,13 @@ sandbox_mode = "workspace-write"
7
7
  developer_instructions = """# Test Engineer Agent Skill
8
8
 
9
9
  ## Mission
10
- Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria.
10
+ Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria, and that catches the five distinct error classes a test suite must cover: business-logic errors, code no test touched, hardcoded-example brittleness, built-the-wrong-thing, and drift over time.
11
11
 
12
12
  ## Responsibilities
13
13
  - Define unit test cases for core logic.
14
14
  - Define integration test cases for boundaries.
15
15
  - Identify edge cases and negative scenarios.
16
+ - Design variation/property-style test cases — vary inputs beyond the fixture example (bounds, parameter changes) — technique-level, library-neutral.
16
17
  - Produce a test plan aligned with acceptance criteria.
17
18
  - Ensure acceptance coverage maps to spec criteria.
18
19
 
@@ -33,12 +33,13 @@ The `lens` field in the capability packet selects the audit behavior:
33
33
  | `requirements` | Requirements, spec, acceptance, scope alignment | `workflows/requirements/requirements-audit.md` |
34
34
  | `code-quality` | SOLID, Clean Code, KISS, YAGNI, DRY, maintainability | `workflows/code-quality/code-quality-audit.md` |
35
35
  | `performance` | Performance hotspots, allocation, latency, throughput | Domain-specific; no fixed reference |
36
+ | `tests` | Coverage, regression protection, assertion quality, variation | `workflows/tests/tests-audit.md` |
36
37
 
37
38
  All lenses share `references/audit-scope.md` (scope rules) and `references/audit-report-io.md` (report format).
38
39
 
39
40
  ## Inputs
40
41
  - `scope`: the target area, diff, or module to audit.
41
- - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance` (required).
42
+ - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance | tests` (required).
42
43
  - `inputs`: recalled facts, existing audit reports, source pointers.
43
44
  - `sensors`: static checks available for the lens (lint, typecheck, security scanners).
44
45
 
@@ -7,12 +7,13 @@ sandbox_mode = "workspace-write"
7
7
  developer_instructions = """# Test Engineer Agent Skill
8
8
 
9
9
  ## Mission
10
- Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria.
10
+ Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria, and that catches the five distinct error classes a test suite must cover: business-logic errors, code no test touched, hardcoded-example brittleness, built-the-wrong-thing, and drift over time.
11
11
 
12
12
  ## Responsibilities
13
13
  - Define unit test cases for core logic.
14
14
  - Define integration test cases for boundaries.
15
15
  - Identify edge cases and negative scenarios.
16
+ - Design variation/property-style test cases — vary inputs beyond the fixture example (bounds, parameter changes) — technique-level, library-neutral.
16
17
  - Produce a test plan aligned with acceptance criteria.
17
18
  - Ensure acceptance coverage maps to spec criteria.
18
19
 
@@ -33,12 +33,13 @@ The `lens` field in the capability packet selects the audit behavior:
33
33
  | `requirements` | Requirements, spec, acceptance, scope alignment | `workflows/requirements/requirements-audit.md` |
34
34
  | `code-quality` | SOLID, Clean Code, KISS, YAGNI, DRY, maintainability | `workflows/code-quality/code-quality-audit.md` |
35
35
  | `performance` | Performance hotspots, allocation, latency, throughput | Domain-specific; no fixed reference |
36
+ | `tests` | Coverage, regression protection, assertion quality, variation | `workflows/tests/tests-audit.md` |
36
37
 
37
38
  All lenses share `references/audit-scope.md` (scope rules) and `references/audit-report-io.md` (report format).
38
39
 
39
40
  ## Inputs
40
41
  - `scope`: the target area, diff, or module to audit.
41
- - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance` (required).
42
+ - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance | tests` (required).
42
43
  - `inputs`: recalled facts, existing audit reports, source pointers.
43
44
  - `sensors`: static checks available for the lens (lint, typecheck, security scanners).
44
45
 
@@ -7,12 +7,13 @@ sandbox_mode = "workspace-write"
7
7
  developer_instructions = """# Test Engineer Agent Skill
8
8
 
9
9
  ## Mission
10
- Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria.
10
+ Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria, and that catches the five distinct error classes a test suite must cover: business-logic errors, code no test touched, hardcoded-example brittleness, built-the-wrong-thing, and drift over time.
11
11
 
12
12
  ## Responsibilities
13
13
  - Define unit test cases for core logic.
14
14
  - Define integration test cases for boundaries.
15
15
  - Identify edge cases and negative scenarios.
16
+ - Design variation/property-style test cases — vary inputs beyond the fixture example (bounds, parameter changes) — technique-level, library-neutral.
16
17
  - Produce a test plan aligned with acceptance criteria.
17
18
  - Ensure acceptance coverage maps to spec criteria.
18
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/codex-plugin",
3
- "version": "1.30.0",
3
+ "version": "1.32.0",
4
4
  "description": "massa-ai plugin for Codex — semantic code search, memory, and context compression",
5
5
  "files": [
6
6
  "agents",
@@ -38,12 +38,13 @@ The `lens` field in the capability packet selects the audit behavior:
38
38
  | `requirements` | Requirements, spec, acceptance, scope alignment | `workflows/requirements/requirements-audit.md` |
39
39
  | `code-quality` | SOLID, Clean Code, KISS, YAGNI, DRY, maintainability | `workflows/code-quality/code-quality-audit.md` |
40
40
  | `performance` | Performance hotspots, allocation, latency, throughput | Domain-specific; no fixed reference |
41
+ | `tests` | Coverage, regression protection, assertion quality, variation | `workflows/tests/tests-audit.md` |
41
42
 
42
43
  All lenses share `references/audit-scope.md` (scope rules) and `references/audit-report-io.md` (report format).
43
44
 
44
45
  ## Inputs
45
46
  - `scope`: the target area, diff, or module to audit.
46
- - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance` (required).
47
+ - `lens`: one of `bugs | architecture | security | requirements | code-quality | performance | tests` (required).
47
48
  - `inputs`: recalled facts, existing audit reports, source pointers.
48
49
  - `sensors`: static checks available for the lens (lint, typecheck, security scanners).
49
50
 
@@ -12,12 +12,13 @@ metadata:
12
12
  # Test Engineer Agent Skill
13
13
 
14
14
  ## Mission
15
- Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria.
15
+ Generate a testing strategy that covers unit, integration, edge cases, negative scenarios, and acceptance criteria, and that catches the five distinct error classes a test suite must cover: business-logic errors, code no test touched, hardcoded-example brittleness, built-the-wrong-thing, and drift over time.
16
16
 
17
17
  ## Responsibilities
18
18
  - Define unit test cases for core logic.
19
19
  - Define integration test cases for boundaries.
20
20
  - Identify edge cases and negative scenarios.
21
+ - Design variation/property-style test cases — vary inputs beyond the fixture example (bounds, parameter changes) — technique-level, library-neutral.
21
22
  - Produce a test plan aligned with acceptance criteria.
22
23
  - Ensure acceptance coverage maps to spec criteria.
23
24
 
@@ -167,6 +167,7 @@ current context already contains it.
167
167
  | `the-fool` | direct challenge, red-team, pre-mortem, evidence audit | `workflows/the-fool.md` |
168
168
  | `judge-with-debate` | standalone multi-judge debate evaluation of user-supplied artifacts | `workflows/judge-with-debate.md` |
169
169
  | `pr-review` | review a hosted GitHub PR / GitLab MR and post findings via `gh`/`glab` | `workflows/pr-review.md` |
170
+ | `discovery` | product brainstorming / problem-space thinking partner | `workflows/discovery.md` |
170
171
  | `to-prd` | turn the current conversation into a PRD without a new interview | `workflows/to-prd.md` |
171
172
  | `skill-architect` | design and build a new skill through structured conversation | `workflows/skill-architect.md` |
172
173
  | `furps-refinement` | FURPS+ refinement of a PRD and/or ADR before implementation, with The Fool pre-validation and DoR coverage | `workflows/refinement/furps-refinement.md` |
@@ -183,7 +184,7 @@ Deterministic routing precedence, first match wins:
183
184
  1. **Explicit route:** user names a massa-ai workflow, report family, saved finding type, or asks for a direct challenge.
184
185
  2. **Requested artifact:** ADR, RFC, TDD, Jira ticket, commit, session guide, audit report, implementation audit report, mobile Figma report, FURPS refinement report, PRD synthesized from the current conversation -> `to-prd` (explicit request only; refining an existing PRD stays `furps-refinement`), or new SKILL.md / skill design -> `skill-architect`.
185
186
  3. **Target type:** broken behavior/error -> `debug`; hosted PR/MR reference (number or URL) to review with posted findings -> `pr-review` (local working diff stays with audit routes); saved audit finding -> matching `*-fix`; implementation scope review -> `implementation-audit`; Maestro E2E/device automation target -> `maestro`, `maestro-audit`, or child-only `maestro-fix` before generic tests workflows; security/privacy/auth finding -> security workflow; tests/flakes/coverage finding -> tests workflow; supplied Figma/screenshot mobile UI design -> `design`; mobile Figma compare/audit -> `mobile-figma-audit`; saved `MFM-*` findings -> `mobile-figma-fix`.
186
- 4. **Primary verb:** create/add/implement -> `feature` unless the concrete target is new Maestro flow work, which routes to `maestro`; restructure without behavior change -> `refactor`; inspect/understand only -> `exploration`; record selected decision -> `adr`; compare open options -> `rfc`; design settled implementation -> `tdd`; refine/quality-check an existing PRD or ADR document (not implementation auditing) -> `furps-refinement`.
187
+ 4. **Primary verb:** create/add/implement -> `feature` unless the concrete target is new Maestro flow work, which routes to `maestro`; restructure without behavior change -> `refactor`; inspect/understand only -> `exploration`; brainstorm/explore a product problem, idea, or direction with no concrete code target -> `discovery`; record selected decision -> `adr`; compare open options -> `rfc`; design settled implementation -> `tdd`; refine/quality-check an existing PRD or ADR document (not implementation auditing) -> `furps-refinement`.
187
188
  5. **Risk domain escalation:** migrations, irreversible operations, auth/privacy, cross-service contracts, public compatibility, or work over 10 files routes to `spec-driven` unless the user explicitly requests a narrower workflow and accepts the containment.
188
189
  6. **General fallback:** use `general` only after a one-line General fallback preflight names the specialized workflow considered, rejected reason, and why fallback does not change verification or mutation behavior.
189
190
 
@@ -65,3 +65,12 @@ For multi-step tasks, state a brief plan:
65
65
  ```
66
66
 
67
67
  Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
68
+
69
+ ## 5. File Shape for Agent Readers
70
+
71
+ **Read mechanics, not module depth.**
72
+
73
+ - A one-subject file up to ~500 lines is fine — a single agent read stays coherent, cheap in tokens, and a coding agent can hold the whole file in context with headroom for the rest of the task.
74
+ - A file over ~600 lines must be flagged for splitting — even one-subject, it crowds out the rest of the working context and pushes reads toward pagination.
75
+ - Splitting one subject across many files does not reduce read cost — it multiplies it: one subject spread over N files costs N reads, and each file boundary loses context (per-hop navigation cost).
76
+ - This guidance derives from agent read mechanics, not from module depth. Depth is a separate concept, and this section makes no depth claim: depth is NOT a lines-of-code ratio (`references/architecture-deepening-lens.md` Rejected Framings) — a deep module can be tiny and a shallow wrapper can be long. Do not phrase file-size guidance as a depth metric; it is scoped to single-agent read cost only.
@@ -111,6 +111,7 @@ report:
111
111
  - the PR URL,
112
112
  - the check names that passed,
113
113
  - what is still unverified (skipped jobs, absent checks),
114
+ - the change's category trust status (`bun skills/massa-ai/scripts/lessons.ts --root . trust status --category <kebab>`) as advisory reading-depth context — it never substitutes for the approval decision below,
114
115
 
115
116
  then stop and ask. If the user approves, merge with the repository's configured
116
117
  strategy and delete the branch. If the repository auto-releases on merge, say so
@@ -66,6 +66,58 @@ bun skills/massa-ai/scripts/lessons.ts --root . list --status confirmed [--scope
66
66
  | `quarantined` | A confirmed lesson penalized ≥`quarantine_threshold` times (failed when applied) |
67
67
  | **pruned** | A `candidate` that never recurred within `window_days` (default 45) |
68
68
 
69
+ ## Trust Ramp and Quality-Metric Trend (Advisory)
70
+
71
+ Two additional append-only record kinds accumulate in `.specs/lessons.json` beside
72
+ lessons: reviewer-feedback records (`data.reviews`) and quality-metric snapshots
73
+ (`data.metrics`). Both are derived state — `lessons.ts` computes streaks, trusted
74
+ flags, and trend verdicts at read time from the event log; there is no cached
75
+ `streak`/`trusted` flag anywhere in the store, so there is no invalidation step,
76
+ and demotion is emergent: a `major` record simply caps the trailing streak window
77
+ the next time the log is read.
78
+
79
+ ### Categories
80
+
81
+ A review category is a free-form kebab-case label supplied at record time (e.g.
82
+ `installer`, `admin-ui`) — the same convention as the existing `--scope` flag.
83
+ There is no fixed taxonomy; the label is whatever the recording agent or user
84
+ chooses.
85
+
86
+ ### Feedback levels
87
+
88
+ - `none` — no reviewer feedback; extends the category's streak.
89
+ - `minor` — a small correction; also extends the streak.
90
+ - `major` — resets the category's streak to 0 and demotes a trusted category
91
+ back to untrusted.
92
+
93
+ ### Trust threshold
94
+
95
+ `trust_threshold` (default 30) is the number of consecutive `none`/`minor`
96
+ records a category needs before `trust status` marks it `trusted`. The
97
+ comparison is `>=`: a streak sitting exactly at the threshold is trusted.
98
+
99
+ ### Advisory-only scope
100
+
101
+ Trust status governs reading depth only — how closely a human scrutinizes a
102
+ diff before approving it. It never governs, gates, or substitutes for per-PR
103
+ merge approval: `references/implementation-delivery.md`'s "Approval for one PR
104
+ does not carry to the next" clause is unaffected by any trust state.
105
+
106
+ ### Commands
107
+
108
+ ```bash
109
+ bun skills/massa-ai/scripts/lessons.ts --root . review add --category <kebab> --feedback none|minor|major --source <ref>
110
+ bun skills/massa-ai/scripts/lessons.ts --root . trust status [--category <kebab>]
111
+ bun skills/massa-ai/scripts/lessons.ts --root . metrics add --feature <slug> --result PASS|FAIL --fix-iterations <n> --surviving-mutants <n> --acs-total <n> --acs-covered <n>
112
+ bun skills/massa-ai/scripts/lessons.ts --root . metrics trend
113
+ ```
114
+
115
+ `trust status` with no `--category` lists every category with its streak,
116
+ total review count, and trusted state; an empty store reports
117
+ `(no review records)`, exit 0. `metrics trend` prints every snapshot
118
+ oldest-first followed by `trend: improving|stable|degrading`, or
119
+ `trend: insufficient data` when fewer than two snapshots exist — both exit 0.
120
+
69
121
  ## No-Script Fallback
70
122
 
71
123
  If `lessons.ts` is unavailable or cannot run, record `Lessons: skipped - script unavailable` in the validation report or evidence gate, keep the raw signal in the report, and do not hand-edit `lessons.json`. A future run with the script can import the validated signal.
@@ -218,6 +218,16 @@ The script enforces grounding (mandatory `--source`) and owns all bookkeeping. A
218
218
 
219
219
  Persist durable memory for verified outcomes worth reusing via `remember` with tags `workflow:spec-driven`, `entity:<slug>`, and `memory:episodic|procedural` as appropriate.
220
220
 
221
+ ### 11. Record Metric Snapshot (MANDATORY)
222
+
223
+ Immediately after validation completes, record this run's quality-metric snapshot so "is the harness improving or degrading" is answerable from data, not memory:
224
+
225
+ ```bash
226
+ bun skills/massa-ai/scripts/lessons.ts --root . metrics add --feature <slug> --result PASS|FAIL --fix-iterations <n> --surviving-mutants <n> --acs-total <n> --acs-covered <n>
227
+ ```
228
+
229
+ Derive the flags from this validation's own evidence: `--result` from the Verdict, `--acs-total`/`--acs-covered` from the Spec-Anchored Acceptance Criteria check, `--surviving-mutants` from the Discrimination Sensor's survived count, and `--fix-iterations` from the fix-loop iteration count used this run.
230
+
221
231
  ---
222
232
 
223
233
  ## Verdicts