@olegkoval/agent-skills 1.78.1 → 1.80.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.
@@ -366,6 +366,12 @@ scripts reject `scan` (see Depth gate). If depth resolves to `scan` or `deps`
366
366
  the flag and note `engine forced to <workflow|codex> - revmux needs
367
367
  medium/deep` in the review header.
368
368
 
369
+ **`--deterministic-dedup` flag:** after resolving ENGINE, opt in to the trusted
370
+ native dedup helper for the initial Review -> Dedup stage only. Record it as
371
+ `deterministicDedup` in CONTEXT_FILE. Accept it only with `ENGINE=codex`;
372
+ otherwise report unsupported and stop. Without the flag, preserve the existing
373
+ manual native merge.
374
+
369
375
  **Re-review detection:** run
370
376
  `ls ~/code-reviews/*-<TARGET_SLUG>-<repo-short-name>.md 2>/dev/null | sort | tail -1`
371
377
  (`TARGET_SLUG` = `pr-<PR_NUMBER>` in pr mode, `branch-<LOCAL_BRANCH sanitized to
@@ -682,6 +688,32 @@ git -C <worktreePath> log --format='%s%n%b' <mergeBase>..HEAD
682
688
  - (medium/deep only, optional) Prior-review-memory recall, if you maintain
683
689
  such a system: patterns and false positives specific to this repo.
684
690
 
691
+ ### Collect shared deterministic evidence
692
+
693
+ For a run with `worktree.json`, collect once through the trusted installed
694
+ helper before assembling context. Never run a copy from the reviewed worktree:
695
+
696
+ ```sh
697
+ node "<SKILL_ROOT>/scripts/evidence-bundle.mjs" \
698
+ --worktree "<scratchpad>/worktree.json" > "<scratchpad>/evidence-bundle.json"
699
+ jq 'del(.git.diff.text, .lint.report)' "<scratchpad>/evidence-bundle.json" \
700
+ > "<scratchpad>/static-evidence.json"
701
+ ```
702
+
703
+ Check each exit status and re-read the JSON. Missing tools, nonzero exits or
704
+ malformed output make this collection unavailable: preserve diagnostics and
705
+ set both context paths below to null. Do not silently pass an empty file.
706
+ When Git evidence is available, its provenance base/head must match the
707
+ review's selected commit pair; a mismatch invalidates the collection, never
708
+ changes the review target. Unavailable Git or lint stays explicitly unknown.
709
+
710
+ The compact view removes only duplicate raw diff text and lint report data.
711
+ Keep the full bundle for provenance and detail; semantic review still reads
712
+ DIFF_FILE and existing lint/preflight inputs. Do not replace changedPaths,
713
+ project rules or the mandatory risk check with a different Git diff. Reuse
714
+ available pinned inventory instead of recollecting it in every review agent.
715
+ In scan/no-worktree mode, set both paths to null; do not fabricate a bundle.
716
+
685
717
  ### Assemble CONTEXT_FILE
686
718
 
687
719
  Write `<scratchpad>/context.json` with keys:
@@ -701,8 +733,11 @@ Write `<scratchpad>/context.json` with keys:
701
733
  "prePush": "<true in MODE=branch, false in MODE=pr>",
702
734
  "preflightFile": "<PREFLIGHT_FILE, or null>",
703
735
  "botPatternsFile": "<BOT_PATTERNS_FILE, or null>",
736
+ "evidenceBundleFile": "<full evidence-bundle.json path; null on collection failure or no worktree>",
737
+ "staticEvidenceFile": "<compact static-evidence.json path; null on collection failure or no worktree>",
704
738
  "depsReport": "<deps-report.json contents at depth deps, else null>",
705
739
  "depsInstall": "<worktree.json depsInstall>",
740
+ "deterministicDedup": "<boolean: true only for explicit --deterministic-dedup with ENGINE=codex>",
706
741
  "prBody": "<full PR body at every depth; empty string in branch mode>"
707
742
  }
708
743
  ```
@@ -57,7 +57,10 @@ repository-relative `file:line` (empty array when there is none).
57
57
  Implementation additionally returns `acCoverage`. Test-quality additionally
58
58
  returns `coverageVerdict`, `mutationSlip`, and `mockSmells`.
59
59
 
60
- Use `apply_patch` for every file write from Codex. Re-read each JSON file before
60
+ Use `apply_patch` for every file authored by Codex. The only exception is
61
+ capturing JSON stdout from trusted installed mechanical helpers verbatim to
62
+ their assigned scratchpad file; never rewrite that output through the model.
63
+ Re-read each JSON file before
61
64
  trusting it. Invalid JSON or a missing required field makes that agent result
62
65
  unavailable; do not infer what it meant from prose.
63
66
 
@@ -76,7 +79,11 @@ bounded task:
76
79
  1. Read its exact prompt under
77
80
  `<SKILL_ROOT>/references/agents/<dimension>.md`.
78
81
  2. Read `DIFF_FILE` and `CONTEXT_FILE` by path. Read the worktree only when one
79
- exists. Never paste the whole diff into the task message.
82
+ exists. Never paste the whole diff into the task message. When context supplies
83
+ a non-null `staticEvidenceFile`, reuse its available commit-bound inventory; report
84
+ stale/unavailable facts to the coordinator rather than silently retargeting
85
+ or recollecting them per agent. It does not replace semantic investigation,
86
+ the authoritative diff, or required schema/completion/verification gates.
80
87
  3. Review only the target diff. Do not edit files, run git writes, post to
81
88
  GitHub, or communicate externally.
82
89
  4. Write the shared result contract to
@@ -103,6 +110,43 @@ unavailable; never loop blindly.
103
110
 
104
111
  ## Dedup stage
105
112
 
113
+ When `deterministicDedup` in CONTEXT_FILE is exactly boolean `true`, replace
114
+ only this initial merge with the trusted installed helper. First finish the
115
+ Review barrier and validate each selected dimension against the shared result
116
+ contract. The helper checks record shape, not the complete finding schema or
117
+ required-dimension completion; those checks remain mandatory here.
118
+
119
+ Use `apply_patch` to write `<scratchpad>/codex-dedup-manifest.json`:
120
+
121
+ ```json
122
+ {"dimensions":[{"name":"quality","path":"<assigned quality result JSON>"}]}
123
+ ```
124
+
125
+ Use absolute result paths. Include every valid selected dimension, even one
126
+ with empty findings, in the original selected-dimension order. Use
127
+ coordinator-assigned names and paths, never finding-supplied attribution.
128
+ Keep unavailable dimensions explicitly
129
+ unavailable in completion accounting; omitting them from this manifest cannot
130
+ make the review complete. If none is valid, record Dedup unavailable.
131
+
132
+ Run only the trusted installed script, never code from the reviewed worktree:
133
+
134
+ ```sh
135
+ node "<SKILL_ROOT>/scripts/native-dedup.mjs" \
136
+ --manifest "<scratchpad>/codex-dedup-manifest.json" \
137
+ > "<scratchpad>/codex-deduped-findings.json"
138
+ ```
139
+
140
+ Check exit status and re-read the output. Nonzero exit, unreadable output or
141
+ invalid JSON means Dedup unavailable, never an empty successful finding set;
142
+ do not proceed to Verify with that output. Preserve raw dimension documents.
143
+ Use the helper output without manually repeating its merge. Its canonical
144
+ Workflow policy includes PROJECT quote exceptions and arrival-order evidence
145
+ ownership; this is explicit policy alignment, not exact old-prose parity.
146
+ Critic-stage incremental merging and all later gates remain unchanged.
147
+
148
+ Without that explicit opt-in, retain the existing manual merge below.
149
+
106
150
  The coordinator reads every valid reviewer JSON file and merges duplicate
107
151
  findings before spending verifier agents:
108
152
 
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync, realpathSync } from 'node:fs'
3
+ import { dirname, resolve } from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { loadDedup } from './validate-lines.mjs'
6
+
7
+ const record = value => value && typeof value === 'object' && !Array.isArray(value)
8
+
9
+ export function deduplicateManifest(manifestPath) {
10
+ const path = resolve(manifestPath)
11
+ const manifest = JSON.parse(readFileSync(path, 'utf8'))
12
+ if (!record(manifest) || !Array.isArray(manifest.dimensions) || manifest.dimensions.length === 0) {
13
+ throw new Error('manifest must contain a non-empty dimensions array')
14
+ }
15
+ const dimensions = manifest.dimensions
16
+ if (!dimensions.every(item => record(item) && typeof item.name === 'string' && item.name.trim()
17
+ && item.name === item.name.trim() && typeof item.path === 'string' && item.path.trim()
18
+ && item.path === item.path.trim())) throw new Error('each dimension requires a non-empty name and path')
19
+ if (new Set(dimensions.map(item => item.name)).size !== dimensions.length) throw new Error('dimension names must be unique')
20
+ const findings = dimensions.flatMap(({ name, path: resultPath }) => {
21
+ const document = JSON.parse(readFileSync(resolve(dirname(path), resultPath), 'utf8'))
22
+ if (!record(document) || !Array.isArray(document.findings) || document.findings.some(finding => !record(finding))) {
23
+ throw new Error(`${name} result must contain a findings array of objects`)
24
+ }
25
+ return document.findings.map(finding => ({ ...finding, _dimension: name, agreedBy: [name] }))
26
+ })
27
+ return { findings: loadDedup()(findings) }
28
+ }
29
+
30
+ function main(args) {
31
+ const [flag, manifestPath, ...extra] = args
32
+ if (flag !== '--manifest' || !manifestPath || manifestPath.startsWith('--') || extra.length) {
33
+ console.error('usage: native-dedup.mjs --manifest <manifest.json>')
34
+ process.exitCode = 2
35
+ return
36
+ }
37
+ try { console.log(JSON.stringify(deduplicateManifest(manifestPath))) } catch (error) {
38
+ console.error(`native-dedup: ${error.message}`)
39
+ process.exitCode = 2
40
+ }
41
+ }
42
+
43
+ function isMain() {
44
+ try { return realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url)) } catch { return false }
45
+ }
46
+
47
+ if (isMain()) main(process.argv.slice(2))
@@ -0,0 +1,161 @@
1
+ # Separate prompt experiments: screening results
2
+
3
+ The initial attempt below failed native contracts. The corrected-contract rerun
4
+ is reported separately at the end; do not pool the two attempts.
5
+
6
+ Both experiments used fresh gpt-6.1-sol low-effort sessions. Inputs and hidden expected
7
+ outcomes were frozen before runs. All input hashes remained unchanged. Three introduced
8
+ defects (tenant isolation, cache identity, validation-before-mutation) and three safe
9
+ controls were checked by source review and executable isolated runtime controls. The
10
+ agents saw legitimate ACs but not the oracle or other outputs.
11
+
12
+ | Experiment | Control total tokens | Candidate total tokens | Control uncached input | Candidate uncached input | Defects found | False positives |
13
+ |---|---:|---:|---:|---:|---|---|
14
+ | Narrow quality prompt | 104064 | 102216 | 27623 | 13104 | 3/3 both | 0 both |
15
+ | Combine quality + implementation | 211959 | 141401 | 15218 | 24423 | 3/3 both | 0 both |
16
+
17
+ A removed only trailing instructions already repeated verbatim in the shared caller
18
+ contract: full quality prompt5686bytes, candidate3855bytes; substantive axes unchanged.
19
+ Observed total tokens -1.78%. The tenant defect changed from critical to important, so
20
+ severity calibration is not stable.
21
+
22
+ B retained both original prompts. Control summed two independent reviewer sessions and
23
+ unioned their findings; candidate used one fresh session covering both prompts. Observed
24
+ total tokens -33.29%, but uncached input +60.49%. Maximum severity matched; AC status
25
+ wording differed (missing vs partial), while both correctly identified violations and
26
+ made no claim of full satisfaction. Boundary maps were source-supported in both relevant
27
+ arms.
28
+
29
+ Neither result proves lower dollar cost, whole-review savings, semantic equivalence on
30
+ real PRs, or quality improvement. Agent host overhead, tool strategy, input caching and
31
+ execution order were uncontrolled. Sessions within each experiment ran concurrently;
32
+ there is no valid wall-time comparison. Coordinator usage is excluded. One observation
33
+ per arm on a small, deliberately simple fixture is not a representative or held-out
34
+ real-PR corpus. Only quality and implementation were screened, not all six review
35
+ dimensions or the complete Verify/Critic/Prove workflow. The benchmark caller
36
+ contract omitted native-required `bugClass` and `otherInstances`; all five outputs
37
+ lack both. All five also encode `acCoverage` as an array, while workflow.js schemas
38
+ require a string when present. The three quality-only outputs omit the boundary
39
+ required by that host schema for untagged Critical/Important findings. They satisfy
40
+ the smaller benchmark contract but would fail native/host contracts. The
41
+ production StructuredOutput host schema was
42
+ not enforced. These are raw content/usage probes, not usable native review runs;
43
+ their common contract failure prevents a production non-regression conclusion.
44
+
45
+ Decision: leave production prompts, six dimensions and verification unchanged. Require
46
+ broader independently adjudicated real-PR cases, failure/unknown cases, repeated
47
+ counterbalanced runs and hosted end-to-end verification before adoption. The known
48
+ missed defect in baseline001 remains unresolved by this experiment. No blanket cost or
49
+ quality improvement claim.
50
+
51
+ Raw inputs, original output JSON, protocol, preregistered oracle, isolated runtime
52
+ controls, host usage, session provenance and SHA256 hashes are retained together in the
53
+ experiment archive. Host counters are actual codex-usage.mjs output, not reviewer
54
+ estimates.
55
+
56
+ ## Reproduction and audit limits
57
+
58
+ Artifact run: `20261107-semantic-prompt-experiments`, stored outside Git under
59
+ `~/.local/state/lekker-review-evaluation/runs/`. Raw session logs remain in the
60
+ host session store; explicit session manifests pin their identities. These local
61
+ artifacts are not available to remote PR reviewers. This report alone cannot
62
+ independently establish a quality or cost gate. No production activation is proposed.
63
+
64
+ The source below is TypeScript-compatible JavaScript syntax. The runtime control
65
+ imports its bytes through a JavaScript data URL in an isolated local probe; it
66
+ does not establish production routing or TypeScript-build verification.
67
+
68
+ ```ts
69
+ export function invoiceRoute(rows, id, tenantId) {
70
+ return rows.find(row => row.id === id);
71
+ }
72
+ export function userRoute(cache, rawId, load) {
73
+ const id = rawId.trim().toLowerCase();
74
+ if (!cache.has(rawId)) cache.set(rawId, load(id));
75
+ return cache.get(rawId);
76
+ }
77
+ export function replaceRoute(current, next, validate) {
78
+ current.length = 0;
79
+ validate(next);
80
+ current.push(...next);
81
+ return current;
82
+ }
83
+ // Retain tenant scoping when selecting an invoice.
84
+ export function safeInvoiceRoute(rows, id, tenantId) {
85
+ return rows.find(row => row.id === id && row.tenantId === tenantId);
86
+ }
87
+ // Reuse the normalized identity throughout cache lookup and loading.
88
+ export function safeUserRoute(cache, rawId, load) {
89
+ const id = rawId.trim().toLowerCase();
90
+ if (!cache.has(id)) cache.set(id, load(id));
91
+ return cache.get(id);
92
+ }
93
+ // Validate before mutating caller-owned state.
94
+ export function safeReplaceRoute(current, next, validate) {
95
+ validate(next);
96
+ current.splice(0, current.length, ...next);
97
+ return current;
98
+ }
99
+ ```
100
+
101
+ Expected controls: `invoiceRoute` exposes a foreign-tenant row; equivalent user
102
+ spellings cause two loads; rejected replacements erase the original array. The
103
+ three `safe*` functions respectively reject the row, load once, and retain state.
104
+
105
+ For A, use the original `quality.md` versus its prefix before `CI_STATUS:`. Both
106
+ arms receive the exact original trailing section as their shared caller contract,
107
+ plus the same JSON output and source-only review instructions. For B, use original
108
+ `quality.md` and `implementation.md` independently versus both in one fresh session.
109
+ Run B independently after A; do not feed earlier outputs to later reviewers.
110
+
111
+ Input and raw output SHA-256 values:
112
+
113
+ ```text
114
+ a4d62d0c4ea77c4b4aae928bb4e72a6217813ac3c4573f3e97d038c5f06fd991 inputs/pr.diff
115
+ 3d5c29ef223989dde19c3bfe5822dd1b41d363258ebcd13a9fb098bc8d271e33 inputs/context.json
116
+ 42cb78d30e9a0b0ed8ef95d2861a75e24d34e7cf33f263a90b418938461c9d4a inputs/quality-full.md
117
+ 919d53eb4adcd9d1ce621245e0bbdec37f1f27d136b5b2425bbd386fb106440a inputs/quality-narrow.md
118
+ 921a15a8a531c8e519685e07c415334ca56f1ed85352e1e80b24a15da4214bcb inputs/implementation-full.md
119
+ b24078101998a5241500adae550dac466e9628c47fcd918f1e9e2a7976d896db inputs/shared-contract.md
120
+ 538d463ba31f9957f91a78eb5b92d99b87cfe013080fb0a6ff4a28e188f7f5ee results/narrow-control.json
121
+ bd34418b97f3c5568b94f0f45240761842a82ab0f1cab00b00b838a77befddb3 results/narrow-candidate.json
122
+ 97f4d56037d981c98c1247f31d7e1570a5e9332479ac130f3026ed2b699dc488 results/consolidation-quality.json
123
+ 433e9f3664e3582cd8c28147338516e63bee8481529cee854fbb80dfd6d5413e results/consolidation-implementation.json
124
+ 57c6e4f8aabcadca017ff3d2bf4bc481f5f511c5d60cbd3eaf16142d63a667e4 results/consolidation-candidate.json
125
+ ```
126
+
127
+ ## Corrected-contract rerun
128
+
129
+ Run `20261107-semantic-prompt-experiments-v2` preserves the same fixture and
130
+ original prompts. Its shared caller now supplies the complete required metadata,
131
+ string AC coverage and host boundary requirement to every arm. Inputs and oracle
132
+ were frozen before five fresh reviewers ran; no prior outputs or oracle were
133
+ shared with reviewers. Actual model/effort remained gpt-6.1-sol/low in every arm.
134
+
135
+ | Experiment | Control total | Candidate total | Control uncached input | Candidate uncached input |
136
+ |---|---:|---:|---:|---:|
137
+ | Narrow quality prompt | 79755 | 103824 | 5194 | 8907 |
138
+ | Combine quality + implementation | 185438 | 112000 | 11212 | 7921 |
139
+
140
+ Narrowing increased observed total tokens 30.18%; consolidation reduced them 39.60%.
141
+ Uncached input increased 71.49% for narrowing and decreased 29.35% for consolidation.
142
+ All five outputs pass the shipped quality/implementation schemas, extracted from
143
+ trusted workflow.js and checked with jsonschema 4.23.0. All three seeded defects
144
+ were found by every reviewer, no safe control was flagged, and severities matched.
145
+ Input hashes remained unchanged. This is schema/source proof, not hosted review.
146
+
147
+ Metadata still differed: control quality reviewers listed service.ts:7 as another
148
+ cache instance; candidate reviewers returned an empty list, though their code
149
+ quotes and fixes cover that line. Production grouping also differs from manual
150
+ adjudication: the trusted existing dedup helper retains six separate-control
151
+ findings for three underlying defects because titles/classifications differ.
152
+ The reported three-issue union is manual; full pipeline output was not measured.
153
+
154
+ This corrective rerun used 481017 aggregate agent tokens; the invalid first attempt
155
+ used 559640, for 1040657 across both attempts, excluding coordinator work. Those
156
+ are investigation costs, not production savings. Cache/tool-strategy effects,
157
+ concurrent scheduling, one observation per arm and the simple corpus still
158
+ prevent causal, dollar-cost, representative-quality or whole-review conclusions.
159
+ No further reruns are planned from this screening evidence. Keep production
160
+ prompts, six dimensions and verification unchanged pending broader held-out
161
+ cases and hosted end-to-end evidence.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olegkoval/agent-skills",
3
- "version": "1.78.1",
3
+ "version": "1.80.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-apple-kit",
3
3
  "description": "Build and ship Apple platform apps: macOS menubar apps, App Store submissions.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-creative",
3
3
  "description": "Creative and personal projects: photo galleries, music players, listings, wiki editing.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-garmin-kit",
3
3
  "description": "Build, test and publish Garmin Connect IQ watch faces.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-git-tools",
3
3
  "description": "Everyday git and GitHub CLI operations: conventional commits, branch hygiene.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-github-pr",
3
3
  "description": "Drive GitHub pull requests to merge-ready: review-bot loops, CI fixes, descriptions, dependency triage.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -365,6 +365,12 @@ scripts reject `scan` (see Depth gate). If depth resolves to `scan` or `deps`
365
365
  the flag and note `engine forced to <workflow|codex> - revmux needs
366
366
  medium/deep` in the review header.
367
367
 
368
+ **`--deterministic-dedup` flag:** after resolving ENGINE, opt in to the trusted
369
+ native dedup helper for the initial Review -> Dedup stage only. Record it as
370
+ `deterministicDedup` in CONTEXT_FILE. Accept it only with `ENGINE=codex`;
371
+ otherwise report unsupported and stop. Without the flag, preserve the existing
372
+ manual native merge.
373
+
368
374
  **Re-review detection:** run
369
375
  `ls ~/code-reviews/*-<TARGET_SLUG>-<repo-short-name>.md 2>/dev/null | sort | tail -1`
370
376
  (`TARGET_SLUG` = `pr-<PR_NUMBER>` in pr mode, `branch-<LOCAL_BRANCH sanitized to
@@ -681,6 +687,32 @@ git -C <worktreePath> log --format='%s%n%b' <mergeBase>..HEAD
681
687
  - (medium/deep only, optional) Prior-review-memory recall, if you maintain
682
688
  such a system: patterns and false positives specific to this repo.
683
689
 
690
+ ### Collect shared deterministic evidence
691
+
692
+ For a run with `worktree.json`, collect once through the trusted installed
693
+ helper before assembling context. Never run a copy from the reviewed worktree:
694
+
695
+ ```sh
696
+ node "<SKILL_ROOT>/scripts/evidence-bundle.mjs" \
697
+ --worktree "<scratchpad>/worktree.json" > "<scratchpad>/evidence-bundle.json"
698
+ jq 'del(.git.diff.text, .lint.report)' "<scratchpad>/evidence-bundle.json" \
699
+ > "<scratchpad>/static-evidence.json"
700
+ ```
701
+
702
+ Check each exit status and re-read the JSON. Missing tools, nonzero exits or
703
+ malformed output make this collection unavailable: preserve diagnostics and
704
+ set both context paths below to null. Do not silently pass an empty file.
705
+ When Git evidence is available, its provenance base/head must match the
706
+ review's selected commit pair; a mismatch invalidates the collection, never
707
+ changes the review target. Unavailable Git or lint stays explicitly unknown.
708
+
709
+ The compact view removes only duplicate raw diff text and lint report data.
710
+ Keep the full bundle for provenance and detail; semantic review still reads
711
+ DIFF_FILE and existing lint/preflight inputs. Do not replace changedPaths,
712
+ project rules or the mandatory risk check with a different Git diff. Reuse
713
+ available pinned inventory instead of recollecting it in every review agent.
714
+ In scan/no-worktree mode, set both paths to null; do not fabricate a bundle.
715
+
684
716
  ### Assemble CONTEXT_FILE
685
717
 
686
718
  Write `<scratchpad>/context.json` with keys:
@@ -700,8 +732,11 @@ Write `<scratchpad>/context.json` with keys:
700
732
  "prePush": "<true in MODE=branch, false in MODE=pr>",
701
733
  "preflightFile": "<PREFLIGHT_FILE, or null>",
702
734
  "botPatternsFile": "<BOT_PATTERNS_FILE, or null>",
735
+ "evidenceBundleFile": "<full evidence-bundle.json path; null on collection failure or no worktree>",
736
+ "staticEvidenceFile": "<compact static-evidence.json path; null on collection failure or no worktree>",
703
737
  "depsReport": "<deps-report.json contents at depth deps, else null>",
704
738
  "depsInstall": "<worktree.json depsInstall>",
739
+ "deterministicDedup": "<boolean: true only for explicit --deterministic-dedup with ENGINE=codex>",
705
740
  "prBody": "<full PR body at every depth; empty string in branch mode>"
706
741
  }
707
742
  ```
@@ -57,7 +57,10 @@ repository-relative `file:line` (empty array when there is none).
57
57
  Implementation additionally returns `acCoverage`. Test-quality additionally
58
58
  returns `coverageVerdict`, `mutationSlip`, and `mockSmells`.
59
59
 
60
- Use `apply_patch` for every file write from Codex. Re-read each JSON file before
60
+ Use `apply_patch` for every file authored by Codex. The only exception is
61
+ capturing JSON stdout from trusted installed mechanical helpers verbatim to
62
+ their assigned scratchpad file; never rewrite that output through the model.
63
+ Re-read each JSON file before
61
64
  trusting it. Invalid JSON or a missing required field makes that agent result
62
65
  unavailable; do not infer what it meant from prose.
63
66
 
@@ -76,7 +79,11 @@ bounded task:
76
79
  1. Read its exact prompt under
77
80
  `<SKILL_ROOT>/references/agents/<dimension>.md`.
78
81
  2. Read `DIFF_FILE` and `CONTEXT_FILE` by path. Read the worktree only when one
79
- exists. Never paste the whole diff into the task message.
82
+ exists. Never paste the whole diff into the task message. When context supplies
83
+ a non-null `staticEvidenceFile`, reuse its available commit-bound inventory; report
84
+ stale/unavailable facts to the coordinator rather than silently retargeting
85
+ or recollecting them per agent. It does not replace semantic investigation,
86
+ the authoritative diff, or required schema/completion/verification gates.
80
87
  3. Review only the target diff. Do not edit files, run git writes, post to
81
88
  GitHub, or communicate externally.
82
89
  4. Write the shared result contract to
@@ -103,6 +110,43 @@ unavailable; never loop blindly.
103
110
 
104
111
  ## Dedup stage
105
112
 
113
+ When `deterministicDedup` in CONTEXT_FILE is exactly boolean `true`, replace
114
+ only this initial merge with the trusted installed helper. First finish the
115
+ Review barrier and validate each selected dimension against the shared result
116
+ contract. The helper checks record shape, not the complete finding schema or
117
+ required-dimension completion; those checks remain mandatory here.
118
+
119
+ Use `apply_patch` to write `<scratchpad>/codex-dedup-manifest.json`:
120
+
121
+ ```json
122
+ {"dimensions":[{"name":"quality","path":"<assigned quality result JSON>"}]}
123
+ ```
124
+
125
+ Use absolute result paths. Include every valid selected dimension, even one
126
+ with empty findings, in the original selected-dimension order. Use
127
+ coordinator-assigned names and paths, never finding-supplied attribution.
128
+ Keep unavailable dimensions explicitly
129
+ unavailable in completion accounting; omitting them from this manifest cannot
130
+ make the review complete. If none is valid, record Dedup unavailable.
131
+
132
+ Run only the trusted installed script, never code from the reviewed worktree:
133
+
134
+ ```sh
135
+ node "<SKILL_ROOT>/scripts/native-dedup.mjs" \
136
+ --manifest "<scratchpad>/codex-dedup-manifest.json" \
137
+ > "<scratchpad>/codex-deduped-findings.json"
138
+ ```
139
+
140
+ Check exit status and re-read the output. Nonzero exit, unreadable output or
141
+ invalid JSON means Dedup unavailable, never an empty successful finding set;
142
+ do not proceed to Verify with that output. Preserve raw dimension documents.
143
+ Use the helper output without manually repeating its merge. Its canonical
144
+ Workflow policy includes PROJECT quote exceptions and arrival-order evidence
145
+ ownership; this is explicit policy alignment, not exact old-prose parity.
146
+ Critic-stage incremental merging and all later gates remain unchanged.
147
+
148
+ Without that explicit opt-in, retain the existing manual merge below.
149
+
106
150
  The coordinator reads every valid reviewer JSON file and merges duplicate
107
151
  findings before spending verifier agents:
108
152
 
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync, realpathSync } from 'node:fs'
3
+ import { dirname, resolve } from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { loadDedup } from './validate-lines.mjs'
6
+
7
+ const record = value => value && typeof value === 'object' && !Array.isArray(value)
8
+
9
+ export function deduplicateManifest(manifestPath) {
10
+ const path = resolve(manifestPath)
11
+ const manifest = JSON.parse(readFileSync(path, 'utf8'))
12
+ if (!record(manifest) || !Array.isArray(manifest.dimensions) || manifest.dimensions.length === 0) {
13
+ throw new Error('manifest must contain a non-empty dimensions array')
14
+ }
15
+ const dimensions = manifest.dimensions
16
+ if (!dimensions.every(item => record(item) && typeof item.name === 'string' && item.name.trim()
17
+ && item.name === item.name.trim() && typeof item.path === 'string' && item.path.trim()
18
+ && item.path === item.path.trim())) throw new Error('each dimension requires a non-empty name and path')
19
+ if (new Set(dimensions.map(item => item.name)).size !== dimensions.length) throw new Error('dimension names must be unique')
20
+ const findings = dimensions.flatMap(({ name, path: resultPath }) => {
21
+ const document = JSON.parse(readFileSync(resolve(dirname(path), resultPath), 'utf8'))
22
+ if (!record(document) || !Array.isArray(document.findings) || document.findings.some(finding => !record(finding))) {
23
+ throw new Error(`${name} result must contain a findings array of objects`)
24
+ }
25
+ return document.findings.map(finding => ({ ...finding, _dimension: name, agreedBy: [name] }))
26
+ })
27
+ return { findings: loadDedup()(findings) }
28
+ }
29
+
30
+ function main(args) {
31
+ const [flag, manifestPath, ...extra] = args
32
+ if (flag !== '--manifest' || !manifestPath || manifestPath.startsWith('--') || extra.length) {
33
+ console.error('usage: native-dedup.mjs --manifest <manifest.json>')
34
+ process.exitCode = 2
35
+ return
36
+ }
37
+ try { console.log(JSON.stringify(deduplicateManifest(manifestPath))) } catch (error) {
38
+ console.error(`native-dedup: ${error.message}`)
39
+ process.exitCode = 2
40
+ }
41
+ }
42
+
43
+ function isMain() {
44
+ try { return realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url)) } catch { return false }
45
+ }
46
+
47
+ if (isMain()) main(process.argv.slice(2))
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-obsidian",
3
3
  "description": "Keep an Obsidian vault in sync with work: PR sync, task rollover, morning routine.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-product",
3
3
  "description": "Take a product idea to a shippable build: MVP passes, full-stack scaffolds, UX/UI quality loops, launch plans.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-reflection",
3
3
  "description": "Look back and improve: self-critique, retrospectives, performance review, rapid learning.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-release",
3
3
  "description": "Ship a release: semantic-release setup, changelogs, store listing copy, release-day routine.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-skill-meta",
3
3
  "description": "Author and maintain agent skills and the AI toolchain itself.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-web-ops",
3
3
  "description": "Operate a website: WAF rules, search console audits, analytics bootstrap, docs indexes.",
4
- "version": "1.78.1",
4
+ "version": "1.80.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },