auditor-lambda 0.6.12 → 0.8.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 (56) hide show
  1. package/README.md +0 -21
  2. package/audit-code-wrapper-lib.mjs +44 -1
  3. package/dist/cli/args.d.ts +1 -0
  4. package/dist/cli/args.js +8 -0
  5. package/dist/cli/auditStep.js +7 -1
  6. package/dist/cli/dispatch.js +14 -3
  7. package/dist/cli/nextStepCommand.js +37 -0
  8. package/dist/cli/prompts.js +2 -0
  9. package/dist/cli.d.ts +0 -1
  10. package/dist/cli.js +22 -15
  11. package/dist/extractors/fileInventory.js +15 -2
  12. package/dist/extractors/graph.js +12 -2
  13. package/dist/io/artifacts.d.ts +3 -1
  14. package/dist/io/artifacts.js +18 -2
  15. package/dist/orchestrator/advance.js +2 -1
  16. package/dist/orchestrator/artifactFreshness.js +12 -2
  17. package/dist/orchestrator/artifactMetadata.d.ts +1 -0
  18. package/dist/orchestrator/artifactMetadata.js +15 -0
  19. package/dist/orchestrator/autoFixExecutor.d.ts +1 -1
  20. package/dist/orchestrator/autoFixExecutor.js +10 -0
  21. package/dist/orchestrator/executorResult.d.ts +12 -0
  22. package/dist/orchestrator/executorResult.js +1 -0
  23. package/dist/orchestrator/fileIntegrity.d.ts +1 -0
  24. package/dist/orchestrator/fileIntegrity.js +12 -3
  25. package/dist/orchestrator/flowRequeue.js +1 -14
  26. package/dist/orchestrator/graphEnrichmentExecutor.d.ts +1 -1
  27. package/dist/orchestrator/graphEnrichmentExecutor.js +3 -1
  28. package/dist/orchestrator/internalExecutors.d.ts +1 -18
  29. package/dist/orchestrator/internalExecutors.js +1 -158
  30. package/dist/orchestrator/reviewPacketGraph.d.ts +31 -0
  31. package/dist/orchestrator/reviewPacketGraph.js +691 -0
  32. package/dist/orchestrator/reviewPacketSizing.d.ts +25 -0
  33. package/dist/orchestrator/reviewPacketSizing.js +60 -0
  34. package/dist/orchestrator/reviewPackets.d.ts +3 -28
  35. package/dist/orchestrator/reviewPackets.js +6 -740
  36. package/dist/orchestrator/runtimeCommand.d.ts +11 -0
  37. package/dist/orchestrator/runtimeCommand.js +79 -0
  38. package/dist/orchestrator/scope.js +1 -1
  39. package/dist/orchestrator/syntaxResolutionExecutor.d.ts +1 -1
  40. package/dist/orchestrator/synthesisExecutors.d.ts +12 -0
  41. package/dist/orchestrator/synthesisExecutors.js +90 -0
  42. package/dist/orchestrator.js +1 -4
  43. package/dist/quota/index.d.ts +1 -1
  44. package/dist/quota/index.js +1 -1
  45. package/dist/types/workerSession.d.ts +1 -3
  46. package/dist/types.d.ts +6 -0
  47. package/dist/types.js +20 -1
  48. package/docs/development.md +35 -139
  49. package/docs/history.md +26 -0
  50. package/docs/product.md +41 -108
  51. package/package.json +1 -1
  52. package/schemas/audit_findings.schema.json +3 -2
  53. package/schemas/dispatch_quota.schema.json +2 -0
  54. package/schemas/external_analyzer_results.schema.json +2 -2
  55. package/schemas/repo_manifest.schema.json +1 -1
  56. package/docs/handoff.md +0 -204
package/docs/product.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Product
2
2
 
3
+ > Normative definition: [`spec/audit-goals.md`](../spec/audit-goals.md) — product
4
+ > identity, invariants, deterministic/LLM boundaries, and completion. This page is
5
+ > the product overview.
6
+
3
7
  ## Canonical surface
4
8
 
5
9
  The primary product is `/audit-code` in conversation.
@@ -12,8 +16,8 @@ Normal product usage should:
12
16
  - keep semantic review with the active conversation agent by default
13
17
  - advance the audit automatically until it completes or no further automatic progress is possible
14
18
 
15
- The CLI is backend infrastructure, a local development harness, and a
16
- repo-local fallback. It is not the preferred end-user mental model.
19
+ The CLI is backend infrastructure, a local development harness, and a repo-local
20
+ fallback. It is not the preferred end-user mental model.
17
21
 
18
22
  ## Supported surfaces
19
23
 
@@ -48,17 +52,14 @@ provider adapters such as `claude-code`, `opencode`, `subprocess-template`, and
48
52
 
49
53
  ## Language strategy
50
54
 
51
- Packet quality should not depend on one language ecosystem. JavaScript,
52
- TypeScript, and Python can receive the richest early support because they are
53
- common in current usage, but every language analyzer must write into the same
54
- language-neutral graph and artifact contracts.
55
+ Packet quality should not depend on one language ecosystem. Every language
56
+ analyzer must write into the same language-neutral graph and artifact contracts;
57
+ JS/TS and Python get the richest early support only because they are common.
55
58
 
56
59
  Do not keep expanding support by adding one bespoke parser per ecosystem unless
57
- there is concrete repository demand or a high-value deterministic signal. The
58
- current breadth of package and workspace manifest hints is enough to validate
59
- the packetization approach. The next product goal is to make graph planning
60
- observable, maintainable, and extensible through generic ownership hints rather
61
- than through an open-ended list of file-format handlers.
60
+ there is concrete repository demand or a high-value deterministic signal. Prefer
61
+ making graph planning observable and extensible through generic ownership hints
62
+ over an open-ended list of file-format handlers.
62
63
 
63
64
  The shared graph should model:
64
65
 
@@ -71,111 +72,43 @@ The shared graph should model:
71
72
  subprocesses
72
73
  - edge confidence, direction, and reason
73
74
 
74
- Graph evidence should be treated in tiers:
75
+ Graph evidence is tiered, strongest first:
75
76
 
76
- - deterministic directed edges, such as imports, entrypoints, route handlers,
77
- test/source links, and resolved analyzer references
78
- - deterministic ownership edges, such as package, module, project, or subsystem
79
- roots
77
+ - deterministic directed edges (imports, entrypoints, route handlers,
78
+ test/source links, resolved analyzer references)
79
+ - deterministic ownership edges (package, module, project, or subsystem roots)
80
80
  - analyzer-supplied ownership roots, normalized into graph reference edges
81
- - language-agnostic semantic affinity, such as shared unusual domain terms,
82
- nearby paths, identifier overlap, or embeddings
83
-
84
- Semantic affinity can help rank `boundary_files`, explain possible context, and
85
- highlight missing deterministic extraction. It should not merge packets on
86
- frequency alone because common tokens like `user`, `request`, `client`,
87
- `config`, and `error` often connect unrelated code.
88
-
89
- Language-specific adapters should enrich the graph without changing packet or
90
- result contracts:
81
+ - language-agnostic semantic affinity (shared unusual domain terms, nearby
82
+ paths, identifier overlap, embeddings)
91
83
 
92
- - JS/TS: TypeScript compiler API, package manifests, import/export edges, route
93
- conventions, test adjacency
94
- - Python: local import statement parsing, package/module resolution,
95
- pytest/unittest adjacency, and future framework route conventions
96
- - Other ecosystems: prefer analyzer-supplied ownership roots, ctags/tree-sitter,
97
- LSP output, or existing external analyzer data before adding new bespoke
98
- manifest parsers
84
+ Semantic affinity can rank `boundary_files`, explain possible context, and
85
+ highlight missing extraction — but it must not merge packets on frequency alone,
86
+ because common tokens (`user`, `request`, `client`, `config`, `error`) connect
87
+ unrelated code.
99
88
 
100
- The fallback should remain useful even when a language has no deep analyzer:
101
- manifest files, path structure, tests, config, and external analyzer output can
102
- still seed a graph with lower-confidence edges.
103
-
104
- Deterministic tool runners should be project-config aware. For example, ESLint
105
- syntax-resolution should run only when the repository has repo-local ESLint
106
- configuration, not merely because an ESLint binary is installed.
89
+ The fallback must stay useful even when a language has no deep analyzer:
90
+ manifests, path structure, tests, config, and external analyzer output can seed a
91
+ graph with lower-confidence edges. Deterministic tool runners should be
92
+ project-config aware — e.g. ESLint syntax-resolution runs only when the repo has
93
+ local ESLint configuration, not merely because the binary is installed.
107
94
 
108
95
  ## Packet planning
109
96
 
110
- `AuditTask` remains the deterministic coverage identity. `ReviewPacket` is the
111
- worker-facing unit of understanding.
112
-
113
- The next packetization phase should:
114
-
115
- - use planner observability to tune which edge kinds change grouping, which
116
- files stay boundary-only, and which extractor gaps leave weakly explained
117
- packets
118
- - extend and exercise the generic ownership-root input so external analyzers
119
- can say "these files belong to module root X" without a new parser for every
120
- ecosystem
121
- - keep graph and manifest parser code modular before broadening it further
122
- - exercise deterministic Python import, package, and test/source graph support
123
- on fixture and real repositories to find the next highest-value gaps
124
- - use language-agnostic semantic affinity only as low-authority context unless
125
- corroborated by deterministic graph evidence
97
+ `AuditTask` is the deterministic coverage identity; `ReviewPacket` is the
98
+ worker-facing unit of understanding. Packetization aims for packets that read as
99
+ coherent code-ownership or execution-flow units, not merely budget-sized bundles:
100
+
126
101
  - build packets around coherent subsystems and execution flows
127
- - keep shared fan-in files visible as context instead of letting them merge too
128
- much of the repository into one packet
129
- - distinguish strong edges from weak or heuristic edges
130
- - group tests with the code they verify when that helps review quality
131
- - include packet rationale, key edges, entrypoints, and boundary files
132
- - track packet-quality metrics such as cohesion, fan-in/fan-out, boundary
133
- crossings, orphan tasks, weak-packet gap and extension counts, risk
134
- concentration, and largest unexplained packet
135
-
136
- The practical success bar is that packets feel like reviewable code ownership
137
- or execution-flow units, not merely budget-sized bundles.
138
-
139
- ## Production readiness
140
-
141
- The package publication path is operational. The release gate, packaged install
142
- smoke tests, and GitHub Actions Trusted Publishing path are routine
143
- maintenance. The remaining production work is product confidence rather than a
144
- new contract shape.
145
-
146
- Readiness should be judged through three checks:
147
-
148
- - field-trial quality: run real repositories through planning, validate
149
- artifacts, and use `audit_plan_metrics.json` to track packet count, weak
150
- packet count, average cohesion, merge edge kinds, and weak-packet samples
151
- - full-loop behavior: prove `next-step` capability routing, packet dispatch,
152
- worker review, `submit-packet`, `merge-and-ingest`, selective deepening,
153
- runtime validation, and final `audit-report.md` promotion in at least one
154
- real host flow
155
- - release hygiene: keep `npm run verify:release`, linked smoke, packaged
156
- smoke, tarball preview, and Trusted Publishing green from a clean checkout
157
-
158
- Extractor work should follow field-trial evidence. Fix deterministic graph gaps
159
- when metrics show them, prefer analyzer-supplied ownership roots before new
160
- manifest parsers, and keep semantic affinity as context unless deterministic
161
- evidence corroborates it.
162
-
163
- The current production-readiness focus is:
164
-
165
- - use the remediator packet-dispatch loop and Polar runtime-confirmed loop as
166
- regression evidence for Windows runtime execution, runtime follow-up, final
167
- synthesis, and report-promotion behavior
168
- - use the remediator contract-link field trial as regression evidence that
169
- small schema, workflow, package script, and type contract suites can become
170
- graph evidence without broad directory merges
171
- - rerun `remediator-lambda` after its Windows `EBUSY` test cleanup issue is
172
- fixed
173
- - keep exercising analyzer ownership roots on real repositories before adding
174
- ecosystem-specific manifest parsers
175
- - keep host setup claims aligned with verified Codex, Claude Desktop, OpenCode,
176
- VS Code, and Antigravity behavior
177
- - split high-concentration implementation files only after the packetization
178
- and schema contracts stay easy to review
102
+ - keep shared fan-in files visible as context rather than merging large parts of
103
+ the repo into one packet
104
+ - distinguish strong (deterministic) edges from weak or heuristic ones
105
+ - group tests with the code they verify when it aids review
106
+ - carry packet rationale, key edges, entrypoints, and boundary files
107
+ - prefer the generic ownership-root contract (analyzers naming module roots) over
108
+ a new parser per ecosystem, and keep graph/manifest parsing modular
109
+
110
+ Planner observability (`audit_plan_metrics.json`: cohesion, fan-in/out, boundary
111
+ crossings, weak-packet gaps) is how extraction gaps are found and prioritized.
179
112
 
180
113
  ## Non-goals
181
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auditor-lambda",
3
- "version": "0.6.12",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "description": "Portable hybrid code-auditing framework for arbitrary repositories.",
6
6
  "type": "module",
@@ -45,7 +45,8 @@
45
45
  "confidence",
46
46
  "lens",
47
47
  "summary",
48
- "affected_files"
48
+ "affected_files",
49
+ "evidence"
49
50
  ],
50
51
  "properties": {
51
52
  "id": { "type": "string" },
@@ -76,7 +77,7 @@
76
77
  },
77
78
  "impact": { "type": "string" },
78
79
  "likelihood": { "type": "string" },
79
- "evidence": { "type": "array", "items": { "type": "string" } },
80
+ "evidence": { "type": "array", "minItems": 1, "items": { "type": "string" } },
80
81
  "reproduction": { "type": "array", "items": { "type": "string" } },
81
82
  "systemic": { "type": "boolean" },
82
83
  "related_findings": { "type": "array", "items": { "type": "string" } },
@@ -101,6 +101,7 @@
101
101
  "quota_source_snapshot": {
102
102
  "type": ["object", "null"],
103
103
  "description": "Real-time usage snapshot from a QuotaSource, if available.",
104
+ "additionalProperties": false,
104
105
  "properties": {
105
106
  "remaining_pct": { "type": ["number", "null"] },
106
107
  "reset_at": { "type": ["string", "null"], "format": "date-time" },
@@ -113,6 +114,7 @@
113
114
  "backoff_state": {
114
115
  "type": ["object", "null"],
115
116
  "description": "Exponential backoff state for repeated rate-limit errors.",
117
+ "additionalProperties": false,
116
118
  "properties": {
117
119
  "consecutive_429_count": { "type": "integer", "minimum": 0 },
118
120
  "current_cooldown_ms": { "type": "integer", "minimum": 0 },
@@ -58,8 +58,8 @@
58
58
  "enum": ["critical", "high", "medium", "low", "info"]
59
59
  },
60
60
  "path": { "type": "string" },
61
- "line_start": { "type": "integer" },
62
- "line_end": { "type": "integer" },
61
+ "line_start": { "type": "integer", "minimum": 1 },
62
+ "line_end": { "type": "integer", "minimum": 1 },
63
63
  "summary": { "type": "string" },
64
64
  "rule": { "type": "string" },
65
65
  "raw": {}
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "additionalProperties": false
17
17
  },
18
- "generated_at": { "type": "string" },
18
+ "generated_at": { "type": "string", "format": "date-time" },
19
19
  "files": {
20
20
  "type": "array",
21
21
  "items": {
package/docs/handoff.md DELETED
@@ -1,204 +0,0 @@
1
- # Handoff
2
-
3
- Current pickup note for the next implementation agent. Keep durable product
4
- direction in `docs/product.md`, engineering workflow in `docs/development.md`,
5
- contracts in `docs/contracts.md`, and operator steps in
6
- `docs/operator-guide.md`.
7
-
8
- ## Current State
9
-
10
- The docs refresh remains consolidated under `docs/`; do not restore old
11
- phase-specific docs unless asked. Checked-in `dist/` is expected to be rebuilt
12
- after TypeScript changes.
13
-
14
- Graph-informed packetization is in place and observable through
15
- `review_packets.json` and `audit_plan_metrics.json`: packet entrypoints,
16
- key edges, boundary files, quality, merge/boundary edge kinds, weak packet
17
- counts, gap counts, extension counts, and bounded samples are all emitted.
18
-
19
- Latest completed slice:
20
-
21
- - completed the remediator-lambda audit end-to-end after refreshing stale
22
- artifacts:
23
- - `run-to-completion` refreshed file disposition, auto-fix, structure,
24
- planning, runtime validation, and synthesis
25
- - resolved all additional runtime/selective-deepening handoffs; final
26
- `audit_tasks.json` had 81 tasks, all complete, 0 pending
27
- - fixed target-side Windows/runtime validation noise in remediator-lambda:
28
- `src/phases/plan.ts` no longer invokes `npx vitest`/`npx jest` in temp
29
- roots without `package.json`; `tests/phase-plan.test.ts` has a longer
30
- cleanup retry/hook timeout; `vitest.config.ts` excludes generated
31
- audit/provider directories from test discovery
32
- - `npm test` in `C:\Code\remediator-lambda` now passes: 5 test files,
33
- 51 tests
34
- - final synthesis promoted `C:\Code\remediator-lambda\audit-report.md`
35
- (47 findings, 16 work blocks), and `.audit-artifacts` was cleaned by
36
- completion
37
- - `node C:\Code\auditor-lambda\dist\index.js validate --root
38
- C:\Code\remediator-lambda --artifacts-dir
39
- C:\Code\remediator-lambda\.audit-artifacts` reports `issue_count: 0`
40
-
41
- Prior completed remediator slice:
42
-
43
- - completed the remediator-lambda final selective-deepening round:
44
- - created dispatch run `20260509T180000000Z_audit_tasks_completed_002`
45
- for the two remaining pending tasks
46
- - submitted packet
47
- `lens-steward-security:security-reliability:packet-1-cfa943527d`;
48
- accepted 2 result entries, `finding_count: 0`
49
- - `merge-and-ingest` accepted 2 result entries, rejected 0,
50
- `spurious_file_count: 0`, `finding_count: 0`
51
- - `audit_tasks.json` now has 73 tasks, all `complete`, 0 pending
52
- - `audit-code validate` on the remediator artifact bundle reports
53
- `issue_count: 0`
54
-
55
- Prior completed implementation slice:
56
-
57
- - fixed `merge-and-ingest` to treat unexpected files in `task-results/` as
58
- warnings rather than hard failures; subagents sometimes write a spurious
59
- packet-level result file alongside per-task `submit-packet` submissions —
60
- the unexpected file check now emits a stderr warning and increments
61
- `spurious_file_count` in the output JSON, but does not block ingestion when
62
- all backend-assigned result files are present and valid
63
- - added regression test: `merge-and-ingest proceeds despite unexpected files
64
- in task-results/`; test count: 199 passing
65
- - fixed Windows `EBUSY` test cleanup in `remediator-lambda/tests/phase-plan.test.ts`:
66
- `enumerateTestFiles` calls `spawnSync("npx vitest ...")` in the temp dir;
67
- on Windows the child process handle lingers briefly after return, causing
68
- `rm()` in `afterEach` to EBUSY; added `rmWithRetry` (5 attempts, 100ms×n
69
- backoff) used in both `beforeEach` and `afterEach`; remediator-lambda now
70
- passes all 153 tests cleanly
71
-
72
- Prior completed slice:
73
-
74
- - added `python-test-util-suite-link` edges: `.py` files co-located in a
75
- `utils/`, `helpers/`, or `support/` subdirectory within an `isTestPath`
76
- directory are chained as a suite (same bounded-suite pattern as existing
77
- TypeScript type / JSON schema / package-script suites); `conftest.py` is
78
- excluded from the predicate
79
- - confidence: `0.72`; direction: `undirected`
80
- - added 3 focused unit tests; rebuilt checked-in `dist/`
81
-
82
- Field evidence (Polar-CV-KAN):
83
-
84
- - canonical run: `.audit-artifacts/polar-python-util-suite-20260509`
85
- (7 packets, 1.000 cohesion, 2 weak packets)
86
- - `python-test-util-suite-link` produces 2 intra-unit edges within the
87
- `tests-utils` packet (`assertions.py → mocks.py`, `mocks.py → test_data.py`)
88
- - `tests-utils` packet: `internal_edge_count` 0 → 2; `cohesion_score` 0 → 1;
89
- `unexplained_file_count` 3 → 0; no longer a weak packet
90
- - Polar metrics: 7 packets, **1.000 cohesion** (up from 0.857), **2 weak
91
- packets** (down from 3)
92
- - 2 remaining weak packets are `unexplained_files` type; genuinely isolated
93
- files (`.auditorignore`, `experiments/domains/__init__.py`,
94
- `experiments/summarize_results.py`) cannot be linked without false positives
95
-
96
- Field evidence (remediator-lambda):
97
-
98
- - baseline: `.audit-artifacts/remediator-yaml-refs-20260508`
99
- - remediator metrics stable: 62 tasks, 3 packets, 1.000 cohesion, 0 weak
100
- packets; `python-test-util-suite-link` adds 0 edges (TypeScript repo, no
101
- `.py` files)
102
- - remediator full audit loop completed: `.audit-artifacts/` (in-progress run
103
- `20260509T153435008Z_audit_tasks_completed_006` + deepening run
104
- `20260509T155225210Z_audit_tasks_completed_001`); first round produced 42
105
- findings across 65 tasks; deepening round added 4 findings across 6 tasks
106
- - remediator deepening `merge-and-ingest` retry succeeded after the spurious
107
- file fix:
108
- - command used:
109
- `node C:\Code\auditor-lambda\dist\index.js merge-and-ingest --run-id 20260509T155225210Z_audit_tasks_completed_001 --root C:\Code\remediator-lambda --artifacts-dir C:\Code\remediator-lambda\.audit-artifacts`
110
- - accepted 6 result entries, rejected 0, `spurious_file_count: 1`,
111
- `finding_count: 4`
112
- - result ingestion progressed and added 2 selective deepening tasks
113
- - current remediator artifact state after retry: `audit_results_ingested`
114
- present, `audit_tasks_completed` satisfied, `requeue_tasks.json` empty,
115
- `audit_tasks.json` has 73 tasks with 0 pending after final selective
116
- deepening run `20260509T180000000Z_audit_tasks_completed_002`
117
- - final selective deepening verified the existing `src/types/workerSession.ts`
118
- security findings and upheld the reliability no-finding result for
119
- `src/types/sessionConfig.ts`, `src/types/workerResult.ts`, and
120
- `src/types/workerSession.ts`; it added 0 findings
121
- - current remediator packet metrics: 73 tasks, 3 packets, 1.000 cohesion,
122
- 1 weak packet with 1 unexplained file
123
- - final refreshed remediator audit completed with 81 tasks, all complete, and
124
- final `audit-report.md` at repo root. Runtime validation was confirmed after
125
- excluding generated audit/provider directories from Vitest discovery; the
126
- earlier `EBUSY` output was environmental noise from generated worktrees.
127
-
128
- ## Verification
129
-
130
- Completed:
131
-
132
- ```bash
133
- npm run build
134
- npm test # 199 passing
135
- node C:\Code\auditor-lambda\dist\index.js merge-and-ingest --run-id 20260509T180000000Z_audit_tasks_completed_002 --root C:\Code\remediator-lambda --artifacts-dir C:\Code\remediator-lambda\.audit-artifacts
136
- node C:\Code\auditor-lambda\dist\index.js validate --root C:\Code\remediator-lambda --artifacts-dir C:\Code\remediator-lambda\.audit-artifacts
137
- npm test # in C:\Code\remediator-lambda, 51 passing
138
- node C:\Code\auditor-lambda\dist\index.js run-to-completion --root C:\Code\remediator-lambda --artifacts-dir C:\Code\remediator-lambda\.audit-artifacts --max-runs 10
139
- node C:\Code\auditor-lambda\dist\index.js validate --root C:\Code\remediator-lambda --artifacts-dir C:\Code\remediator-lambda\.audit-artifacts
140
- ```
141
-
142
- ## Files Touched Recently
143
-
144
- - `src/cli.ts` — `cmdMergeAndIngest`: unexpected files → warning, not failure
145
- - `tests/audit-code-wrapper.test.mjs` — new regression test
146
- - `dist/` — rebuilt
147
- - `C:\Code\remediator-lambda\src\phases\plan.ts` — avoid test-runner
148
- enumeration in roots without `package.json`
149
- - `C:\Code\remediator-lambda\tests\phase-plan.test.ts` — sturdier
150
- `rmWithRetry` helper and longer hook timeout
151
- - `C:\Code\remediator-lambda\vitest.config.ts` — exclude generated
152
- audit/provider directories from test discovery
153
- - `C:\Code\remediator-lambda\audit-report.md` — final promoted report
154
- - `docs/handoff.md`
155
-
156
- ## Next Steps
157
-
158
- 1. The 2 remaining weak packets in Polar (`experiments-domains` with 5
159
- unexplained files, `tests-tiny-files` with 3 unexplained files) share the
160
- same genuinely isolated files (`.auditorignore`,
161
- `experiments/domains/__init__.py`, `experiments/summarize_results.py`).
162
- No extractor can address these without false positives; treat as floor.
163
- Only revisit if a future field trial on a different repo surfaces the same
164
- pattern in fixable form.
165
- 2. Remediator-lambda field trial is closed. Review the final
166
- `C:\Code\remediator-lambda\audit-report.md` only if you need product
167
- remediation planning; no audit-code backend work remains for that run.
168
- 3. Run the release/publish flow only when intentionally cutting a version.
169
-
170
- ## Cautions
171
-
172
- - `AuditTask` remains the deterministic coverage identity; `ReviewPacket`
173
- should not replace result ingestion contracts.
174
- - Weak graph edges, semantic affinity, and shared token frequency should remain
175
- context unless deterministic graph evidence corroborates them.
176
- - Boundary files are evidence hints. Worker prompts should continue to
177
- discourage broad reads outside the packet.
178
- - Keep suite links bounded and evidence-led; do not turn same-directory
179
- proximity into a broad packet merge rule.
180
- - `conftest-link` fires only when conftest.py is inside a `isTestPath`
181
- directory; root-level conftest.py is deliberately excluded to avoid O(n)
182
- fan-out to all Python files.
183
- - `yaml-path-reference-link` only matches string values ending in config
184
- extensions (`.yaml`, `.yml`, `.json`, `.toml`) that resolve to an existing
185
- file in the repo; absolute URLs and values without `/` are excluded.
186
- - `python-test-util-suite-link` predicate requires all four conditions: `.py`
187
- extension, NOT a conftest, parent dir name in `{utils, helpers, support}`,
188
- and the parent dir's normalized path passes `isTestPath`. Do not broaden the
189
- dir-name set without field evidence from a real repository.
190
- - `python-test-util-suite-link` edges appear as intra-unit edges (not counted
191
- in `merge_edge_kind_counts`) when all suite files belong to the same unit.
192
- This is correct — the edges still increment `internal_edge_count` and clear
193
- the weak-packet flag. Absence from merge counts does not mean the edges are
194
- inactive.
195
- - `merge-and-ingest` unexpected files now warn to stderr and increment
196
- `spurious_file_count` in the output JSON. They do not cause ingestion to
197
- fail. The check is still present to make spurious writes visible.
198
- - In this sandbox, running the wrapper from `C:\Code\auditor-lambda` with an
199
- absolute remediator root hit an `EPERM` while overwriting the existing
200
- remediator run `audit-results.json`; invoking the built CLI directly from
201
- `C:\Code\remediator-lambda` succeeded. Treat this as an execution-environment
202
- wrinkle unless it reproduces outside the sandbox.
203
- - Final remediator completion cleaned `.audit-artifacts`; use the promoted
204
- repo-root `audit-report.md` and `validate` output as the source of truth.