68 Commits
Author SHA1 Message Date
John Smith c180ad9697 fix(guards): allow orchestration tools and add coordinator source-lock policy (fixes #5) 2026-10-21 18:07:26 -04:00
BillyOutlast 8044cfa47c ci(ocr): point review job at org reusable workflow (pinned)
Fix 'failed to fetch workflow' parse error: ocr.yml referenced a local reusable workflow path (./.github/workflows/ocr-review.yml) that does not exist in this repo. Point at Heretek-AI/.github org reusable workflow pinned to main HEAD (a440b485).
2026-10-19 16:34:28 -04:00
BillyOutlast 5a3154f07a ci: add reusable OpenCodeReview PR workflow 2026-10-19 15:49:42 -04:00
John Smith fa65c1e310 Add drift-guard verification: VERDICT PASS + QA red-proofs (code-scanning 13 alerts) 2026-10-19 12:43:27 -04:00
John Smith 7eda883589 fix(code-scanning): remediate 13 CodeQL alerts (sanitization, TOCTOU, temp file, 9 ReDoS)
- permission-guard: add g flag to glob escape (alert 2)
- edit-transaction: remove existsSync TOCTOU gates, try/catch ENOENT (alert 8)
- harness-host.upstream: mkdtempSync dir + 0600 probe file (alert 21)
- muse-calibration: indexOf recent-context scan, 20k inner cap (alert 6)
- diagnostics-runner: per-line bounded frame patterns (alert 4)
- import-verifier: bounded quantifiers + manual brace scan (alerts 10-13)
- repomap: manual quoted-span mask + bounded outline patterns (alerts 14-15)
- architecture-advisor: catch prefilter + bounded patterns (alerts 9,20)
- guards.test: glob regression (*.ts must not match ats)
- check-loc budget revised 12100/10100 -> 12176/10104 (documented)

Gates: bun run check 0, bun test 0 (398 pass), make check 0, make accept 0
2026-10-19 12:37:38 -04:00
John Smith b20e753038 Release 1.0.12: version-identity bump (pkg==src==README==tests) v1.0.12 2026-10-18 12:14:35 -04:00
John Smith 83de494a7d Add drift-guard verification: VERDICT PASS + QA ACCEPT evidence (audit remediation F) 2026-10-18 11:33:44 -04:00
John Smith f210bc1dad Audit remediation F: tilde target containment (P1) + metapath comment (P3)
F1 (OH-6.5-tilde-user-target-escape): widen shellTargetEscapesWorkspace
from trimmed === "~" || startsWith("~/") to startsWith("~") so
~user/, ~+ and ~- write targets deny rule-0 for every role. Net-zero in
src/ (one predicate shortened). 4 non-vacuous regression tests pin all
deny shapes plus legit allows; self-proven RED on the pre-fix predicate.

F2 (OH-2.6-stale-metapath-comment): insert plugin/ in the meta.txt path.
Comment-only, zero behavior change.

F3-F7: prepare-only / document-only / no-op-verify per the stage brief.
No release operations. LOC raw 12089 / stripped 10024 unchanged.
Full suite 397 pass / 0 fail; waves 1-8 green.
2026-10-18 11:09:31 -04:00
John Smith 6d6a76b49a Add drift-guard verification: VERDICT PASS + QA ACCEPT evidence (audit remediation E) 2026-10-18 07:01:27 -04:00
John Smith 88bdfe0e8b Audit remediation E: OH-4.8 full-set receipt + degraded, fork after-mirror E2E, squat provenance hardening (programmer) 2026-10-18 06:56:10 -04:00
John Smith 97158740d3 Add drift-guard verification: VERDICT PASS (audit remediation D) 2026-10-18 06:33:27 -04:00
John Smith 76ca694845 Audit remediation D: OH-6.6 evaluate-time taint-fork linkage + headerless model.request fix (programmer) 2026-10-18 06:28:13 -04:00
John Smith f56376abb7 Audit remediation C: OH-6.5 env-var P1 + command-display P3 + README LOC P3 + taint-fork P2 (programmer fix, QA ACCEPT, VERDICT PASS) 2026-10-18 06:04:43 -04:00
John Smith 8f70285574 Audit remediation C: QA ACCEPT + VERDICT PASS evidence 2026-10-18 06:04:37 -04:00
John Smith 3f8ea505f6 Audit remediation C: OH-6.5 env-var containment P1 + command display P3 + README LOC P3 + taint-fork P2 plumbing
- Port preserved dirty-tree delta: README LOC note, taint-fork comment
  narrowing, contract-adapter execute.before+after fork mirroring,
  session-interceptors headers key + model.request fork linking, 4 fork tests.
- OH-6.5-env-var-target-escape (P1): fail-closed $ / backtick escape in
  shellTargetEscapesWorkspace after -//dev/null carve-outs (rule-0 deny for
  $HOME/${HOME}/$TMPDIR/$(...)/backtick write-planting; rm -rf $HOME
  still rule-1-destructive; quoted-literal over-block documented+tested).
- OH-6.5-command-display-doc-drift (P3): exempt command -v/-V display
  queries from unwrapped-candidate write-ness in classifyShellCommand
  (read-only; destructive payloads through command still destructive).
- OH-scope-readme-loc-stale (P3) + formal LOC-cap revision to raw 12100 /
  stripped 10100 (net-zero impossible; rationale in check-loc.sh history;
  CI gate, README, gate-test updated; over-cap probe still fails).
- OH-6.6-taint-fork-gap (P2, narrowed): keep delta plumbing, no daemon;
  residual silent-fork gap documented (hosts call recordSessionForkLink).
- 12 new regression tests; tsc clean; wave-1 accept ALL GREEN; full suite
  377 pass / 2 fail (both pre-existing TMPDIR-override env artifacts).
2026-10-18 06:00:31 -04:00
John Smith 1d17b16618 Audit remediation 20261018: OH-6.5 root-normalization P0 + embedded-placeholder P1 (programmer fix, QA ACCEPT, VERDICT PASS) 2026-10-18 05:15:00 -04:00
John Smith 551e5feba2 Audit remediation 20261018: P0 find-exec-{} + fork/taint/lesson/guard-root/formatter, 1.0.11 bump (QA ACCEPT + VERDICT PASS) 2026-10-18 04:45:22 -04:00
John Smith ccd3dc9824 Add drift-guard verification: VERDICT PASS (audit remediation 20261018) 2026-10-18 04:45:19 -04:00
John Smith 14a2764d95 Rework 1 (QA conditional ACCEPT): extend OH-6.7 pipeline test with post-trip re-reads
The shipped pipeline test re-read only BEFORE the trip, so neutering the
=== 'other' carve-out in trackCircuitBreakerAndAutoProposeLesson stayed
suite-green. The test now drives the audit 4-cycle shape (read-ok, edit-fail,
read-ok, edit-fail, read-ok, read-ok, good-edit-ok), asserting zero pending
proposals across the post-trip re-reads and exactly one edit-attached lesson
(no 'via read'). Sabotage verified RED (0/1), restore GREEN (1/0). Test-only
change; no production logic touched.
2026-10-18 04:42:30 -04:00
John Smith 6da3c32412 Audit remediation 20261018 follow-up: find-exec placeholder P0, fork taint, lesson-once, guard root, Formatter built-in leg, 1.0.11 bump 2026-10-18 04:30:25 -04:00
John Smith a8aa58a669 Add drift-guard verification: VERDICT PASS (audit 20261018) 2026-10-18 03:46:02 -04:00
John Smith a4ce2e7470 Audit remediation 20261018: P0 shell/guard/taint + P1/P2 fixes, 1.0.10 bump (QA ACCEPT + VERDICT pending) 2026-10-18 03:38:07 -04:00
John Smith 24ba327c81 Audit remediation verification: QA ACCEPT + drift-guard VERDICT PASS 2026-10-18 02:46:08 -04:00
John Smith e8acb05d56 Audit remediation: P0 shell/guard bypasses + P1/P2 fixes (rework 1 re-applied permission-guard) 2026-10-18 02:36:56 -04:00
John Smith 2a9f758f91 P0-1: empty-string directory pick() guard, 1.0.9 (VERDICT: PASS)
setupOpenCodeV2Harness now treats empty/whitespace-only directory/worktree
(location.directory/worktree) as absent via pick(), falling back to
process.cwd(). resolveHarnessOptions({rootDir:''}) still throws fail-closed.
Fixes Heretek-AI/opencode-harness#4, unblocks Crew docker-publish gate.

Triad: programmer + QA red-proof (S1-S3) + drift-guard VERDICT: PASS.
Gates: bun run check 0, bun test 276 pass, accept/run.sh 0, wave-8.sh 0.
v1.0.9
2026-10-17 23:17:10 -04:00
John Smith 91a9fe9b46 audit_loop 2026-10-17 22:59:53 -04:00
John Smith 035a5e9a97 Release 1.0.8: version bump to ship Wave 8 audit remediation (VERDICT: PASS)
- package.json 1.0.7 -> 1.0.8
- src/version.ts HARNESS_RELEASE_VERSION 1.0.7 -> 1.0.8
- Triad: programmer green (267 pass), QA PASS (S1/S2 red-proofs), drift-guard VERDICT: PASS
- Ships: wave-8 audit remediation (P0 guards/taint/symlink, P1 roles/SSRF/rollback/retry, P2/P3 deps/CI/receipts)
v1.0.8
2026-10-17 22:50:06 -04:00
John Smith b7b6dea09e Merge wave-8-audit-remediation: remediate all AUDIT_REPORT_FINDINGS (VERDICT: PASS) 2026-10-17 10:27:56 -04:00
John Smith 2bb4a900ee Wave 8: add verification report + red-proof evidence (VERDICT: PASS) 2026-10-17 10:27:53 -04:00
John Smith 8ee3efd9bc Wave 8: remediate all AUDIT_REPORT_FINDINGS (P0 guards/taint/symlink, P1 roles/SSRF/rollback/retry, P2/P3 deps/CI/receipts)
- OH-6.2: explicit evaluatePermission in every harness execute (index + host adapter)
- OH-6.5: canonicalized shell classifier (sudo/env/-u/-g, basenames, git globals, refspec force, .. fail-closed, write over unwrapped)
- OH-6.6: MCP server_tool taint ids, fork inheritance, broadened denylist
- OH-6.3: realpath containment on all writers (hashline, ast, rename, tx, checkpoints)
- OH-6.1: NFKC role normalization + unknown-role least privilege
- OH-7.4: SSRF default-deny + allowlist + redirect guard; OH-7.3 scoped-test containment
- OH-2.1: zod v4 native toJSONSchema, bridge removed; TS 7.0.2; @types/bun 1.4.3
- OH-3.4/4.6: sabotage-catching rollback + retry tests; OH-4.8 created-file receipts
- OH-1.4/1.5/4.3/8.1: run.sh, SHA-pinned CI + upstream verify, hunk error, optional browser peers
- 62 new tests (267 green), scripts/accept/wave-8.sh + docs/reports/wave-8.md
2026-10-17 02:32:00 -04:00
John Smith db4a2c055f Audit Prompt 2026-10-17 01:53:12 -04:00
BillyOutlast 650ec5e1af Merge pull request #3 from Heretek-AI/claude/project-thread-ej1snd
Get the harness ready for a public npm release
v1.0.7
2026-10-16 18:30:24 -04:00
Claude df31b1bbd8 Await the rejected-option assertion in the calibration test
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Qe5Gj5WofxvQkfnptRJ7ym
2026-10-16 22:15:44 +00:00
Claude 7e37432d4c Get the harness ready for a public npm release
- Drop the unused pi-hashline-readmap dependency, which pulled a whole
  separate coding agent and several LLM SDKs into every install
  (444 MB -> 38 MB of node_modules).
- Put the Muse 1.3 system prompt calibration behind a new
  `museCalibration` option, off by default, so the plugin no longer
  rewrites the system prompt for every model.
- Publish workflow: pin setup-bun and Bun, install with --ignore-scripts,
  refuse a tag that doesn't match package.json, and run make check,
  make accept and the real OpenCode host test before publishing.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Qe5Gj5WofxvQkfnptRJ7ym
2026-10-16 22:14:27 +00:00
BillyOutlast 6ea66b77d1 Merge pull request #2 from Heretek-AI/claude/project-thread-0qux1u
Clear the SonarCloud security findings left from #1
2026-10-16 17:43:08 -04:00
Claude 4c0b219dcb Keep disposing registrations when one dispose() throws synchronously
Review: a sync throw inside settled.map() aborted the map, so later
registrations were never disposed. The async callback turns it into a
rejection that allSettled absorbs. Adds a test that fails without it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012AuVk4nEvBXaTjs4G6wdW4
2026-10-16 19:37:48 +00:00
Claude f4250f408f Install with --ignore-scripts and clear Sonar findings
Sonar rated new code C for running dependency lifecycle scripts during
install. CI and the host-test runner now pass --ignore-scripts (nothing in
the tree needs them; check, tests, accept, build and host-test pass from a
clean install). Also: [[ ]] in run.sh, includes() in the bullet scan, and
dispose registrations concurrently instead of awaiting in a loop.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012AuVk4nEvBXaTjs4G6wdW4
2026-10-16 19:25:56 +00:00
BillyOutlast 0bf5238d5a Merge pull request #1 from Heretek-AI/claude/project-thread-0qux1u
Make the plugin work in the real OpenCode V2 host (v1.0.7)
2026-10-16 12:21:13 -04:00
Claude 99ced52a75 Scan for the reworded subagent bullet without a regex; pin setup-bun
CodeQL flagged the fallback line regex as polynomial on crafted prompt
text. A plain line scan does the same match in linear time. setup-bun is
pinned to the v2.2.0 commit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012AuVk4nEvBXaTjs4G6wdW4
2026-10-16 15:06:03 +00:00
Claude de9ab5c5db fix: make the plugin work in the real OpenCode V2 host
- Pass tool inputs to the host as plain JSON Schema (toHostInputSchema via
  zod-to-json-schema). The host rejects zod v3 schemas, so every tool was
  silently dropped at registration.
- setup() now awaits every hook/transform registration and resolves to a
  cleanup function that disposes them; returning the doctor report made the
  host crash on unload. setupOpenCodeV2Harness() exposes the report.
- Read plugin options from ctx.options (where the host delivers them).
- MCP server seeding is opt-in (seedRecommendedMcp) and uses the
  Mcp.LocalConfig shape; it no longer runs bunx/npx --yes by default.
- Meta.txt calibration falls back to a one-line matcher if upstream rewords
  the subagent bullet; documented the event.system amendment in README/SPEC.
- Single version source (src/version.ts), bumped to 1.0.7.
- Tests: host contract, partial hashline anchor mismatch, calibration.
- make host-test / scripts/host-test: loads the plugin into anomalyco/opencode
  at a pinned commit via the upstream plugin fixture.
- CI workflow: check, accept, build, and the real-host test on every PR.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012AuVk4nEvBXaTjs4G6wdW4
2026-10-16 14:58:42 +00:00
John Smith 3d8e44c801 merge(wave-7): v1.0.6 systems VERDICT PASS 2026-10-16 10:17:11 -04:00
John Smith 55f3baaf9b feat(wave-7): v1.0.6 QA red-proofs + drift VERDICT PASS 2026-10-16 10:17:08 -04:00
John Smith 76ccb31364 feat(wave-7): v1.0.6 rename_symbol + post-edit anchor receipts + retry + dead-export + lesson synthesis
- renameSymbolAcrossWorkspace (repomap) + rename_symbol tool (index): lexer-safe atomic multi-file rename with diagnostics verification and rollback
- buildPostMutationAnchorReceipt (tool-interceptors) + contract-adapter wiring: post-formatter FNV-1a <post-edit-anchors> resync receipt
- handleSessionRetryInPlace (session-interceptors) + retry hook: adaptive stream/overload recovery, halt on fatal auth/overflow
- detectUnusedExportsAndOrphanModules (architecture-advisor): dead-code audit in runArchitectureAudit
- trackCircuitBreakerAndAutoProposeLesson (episodic-memory, normalized style): auto scope-tagged recovery lesson synthesis
- test/wave7-systems.test.ts (5 tests), scripts/accept/wave-7.sh, docs/reports/wave-7.md
- package 1.0.5->1.0.6, HARNESS_RELEASE_VERSION 1.0.6, Makefile wave-7 gate
- 194 pass / 0 fail, wave-1..7 accepts green, zero-stub clean
2026-10-16 09:56:51 -04:00
John Smith 666da71e07 merge(wave-6): v1.0.5 engineering VERDICT PASS 2026-10-16 08:52:00 -04:00
John Smith 1d5c441988 feat(wave-6): v1.0.5 engineering + QA red-proofs + drift VERDICT PASS 2026-10-16 08:51:56 -04:00
John Smith efabedfd21 feat(wave-6): import/export verifier, symbol_references, patch repair, head-tail compactor, dual Code Mode bridge (v1.0.5) 2026-10-16 08:39:19 -04:00
John Smith d1246e3a12 merge(wave-5): interceptors advisor VERDICT PASS v1.0.4 2026-10-16 03:03:00 -04:00
John Smith c9a77fa277 feat(wave-5): interceptors advisor + QA red-proofs + drift VERDICT PASS 2026-10-16 03:02:56 -04:00
John Smith 7f5fec9f34 feat(wave-5): zero-patch interceptors + architecture advisor (v1.0.4)
- Add src/interceptors/tool-interceptors.ts (631) and
  src/interceptors/session-interceptors.ts (166) verbatim: in-place
  EditTool repair, near-miss hashline anchors, read fuzzy-resolve,
  shell env hardening, non-zero-exit detection, Tool.Result
  normalization, meta.txt calibration, compaction decontamination,
  multi-hop root session affinity.
- Add src/verify/architecture-advisor.ts (375) verbatim: Tarjan SCC
  cycles, exported-contract impact, engineering smells, audit report.
- Merge src/host/contract-adapter.ts: full interceptor wiring
  (tool/agent/mcp/command transforms, shell + permission + tool +
  session hooks, /doctor + /audit) with Wave-4 fixes re-applied
  (fail-closed non-string context check, .js imports, 1.0.4).
- Merge src/index.ts: keep Wave-4 wiring, add architecture_audit
  tool, HARNESS_RELEASE_VERSION, broader root inference,
  toTrippedDirective dual-shape mapping, computeLineHash
  disambiguation.
- Canonical EpisodicLesson in context-budget; episodic-memory
  imports it (local redef removed).
- Adopt test/plugin-interceptors.test.ts (mkdirSync strict-TS fix).
- scripts/accept/wave-5.sh (11 gates), Makefile chain, docs/reports/wave-5.md.
- 183 pass / 0 fail; make accept waves 1-5 green; build clean.
2026-10-16 02:52:55 -04:00
John Smith 7a49471109 release: v1.0.3 v1.0.3 2026-10-16 02:12:51 -04:00