Skip to content

Milestone 7 — Governed retrieval and MCP context

Status: COMPLETE. PR #22 delivered the original retrieval/MCP implementation, and PR #25 delivered the verified-run evidence contract, review repairs, and report follow-up. The reviewed final head 20d09bd9eb8266cec21d00cee65f7e8a8baa3716 passed the required checks and was merged through the active Protect main ruleset as d992bc1266ed08add12f54d0921546b5dc73528b. Run.status == SUCCEEDED remains insufficient and never creates verification evidence. The producer and retrieval evidence are offline fixtures; a live M9 verifier producer does not yet exist and remains a follow-on integration, not an M7 prerequisite.

Prerequisites and repository-entry gate

  • M1–M5 reports record implementation and acceptance evidence. M3's live provider compatibility call is explicitly optional and remains pending; the report's offline routing, budgets, and integration coverage passed. M4 is complete with NO-GO for LangGraph. M5's prompt explicitly permits deferring live-provider execution and reports complete on its conditional offline acceptance. No M6 completion is inferred from an old report: docs/milestones/06.md now records the final PR #21 review, live Architect READY evidence, pinned OpenCode 1.19.4 compatibility smokes, protected checks, and merge.
  • At kickoff, refreshed origin and GitHub. The prompt's handoff SHAs were checked: PR #15 merged at d9e514a6ce867b5862b578c2ede0f0f5a1052fd9; PR #17 merged at 7a9503e164135297b570dd329b665220c518fa7e. M6 PR #16 had already merged at 6f9afaa074f0d66b6ab53662193898ba024e2a03; final M6 remediation PR #21 merged after independent review at a55924350aebf2112ff7906978548727de081e4a.
  • After fetching/pruning, GitHub reported zero open PRs and only repository branch main. The implementation checkout /home/menes/.codex/worktrees/milestone-7-clean-main was clean main, exactly equal to freshly fetched origin/main at a55924350aebf2112ff7906978548727de081e4a; git worktree list --porcelain reported this one registered worktree. A separate M6 Architect edit remains preserved in stash@{0} (ae6d3bc8ba3b6bdb15a7b33d09e23f5c35f42d67); it was not applied, deleted, or included in M7.
  • The active Protect main ruleset requires strict passing Local CI and CodeQL checks and review-thread resolution; bypass permission is never. PR #21 final code head ef11d3362186d687eea8f76d4e5d1a0f0251e201 received independent no-findings review; Local CI, CodeQL (Python and JavaScript/TypeScript), and documentation build passed, with zero unresolved review threads. Its protected merge is the current base SHA above.

Pull-request and branch reconciliation

The complete refreshed PR list contained PRs 1–21, all closed, and no open review threads relevant to pending work. PR heads and merge SHAs below were read from GitHub; merge SHAs are shown only for PRs with a non-null merged_at. The prior M6 audit inspected the open candidates' exact diffs, linked work, check/review state, and protections. Rejected/duplicate branches are absent from the refreshed remote branch inventory. No unmerged unique branch was deleted in this M7 kickoff.

PR Final status and disposition Exact head SHA Merge SHA
#1 Merged; independent web foundation fbb4ff65689420e5fb883131ebd3b77837f40b5f cb7105e58bde64c0537e41258fd563995d7a9da8
#2 Closed without merge; LiteLLM image candidate superseded by the patched digest-pinned image in main; old CodeQL Node setup failed ec610a1488ae652d9bd523c5cc5de1bb26b2b629 —
#3 Closed without merge; Dependabot confirmed Redis was already current fa410259959f744aaf7da25bbd7ce97511805600 —
#4 Closed without merge; Postgres 18.4 did not match the supported PostgreSQL 16 baseline 37edbcc54c9889f05d7876f8b67f48f3761b5960 —
#5 Closed without merge; Python 3.14 duplicated the supported-Python correction and remaining CodeQL setup duplicated #14 a8aa31178569c2cd0c41106fb272848a1ba38998 —
#6 Closed without merge; broad dependency set included changes superseded on main and updates belonging to the rejected M4 candidate 99969a18bbb13d9d871e71ec0d8d25f9cbb336be —
#7 Closed without merge; mypy 2.4.0 was already present on main 3bc638127551822d84ff666c1b2937baaf6f572f —
#8 Closed without merge; pytest 9.1.1 was already current on main 51ef1b8b4364a1bcbb4b471a1ed47fdd7730eb68 —
#9 Closed without merge; Node image update was superseded by current image configuration 7e42edea1e0015ff7a762b9c48f0fe0f64346e90 —
#10 Closed without merge; Redis 8.1.0 was already on main 6f211b39eaf4db70fea640d337458c85c2979b9c —
#11 Closed without merge; pytest update belonged to the rejected M4 candidate dependency set e1f6eaf00c14b448c2197a0f21c6ee9b0051b844 —
#12 Closed without merge; Redis update targeted the rejected M4 LangGraph candidate e9b84c1f99d4be0f0986bfde0170c89c188a3578 —
#13 Merged; public launch documentation 5f87d4cd2ed5b58a881d4cfd1d02ee02b81dfaff c76bd94a305121628db5eb2c98bce0e2c2109e49
#14 Closed without merge; old dependency revisions superseded, with Node 26 CodeQL setup addressed on main 101df239931d7ca3028615cdd3f8e9b69620966e —
#15 Merged; community PR template e10d2865d18032601220cf22c25647f9d3e2e4c0 d9e514a6ce867b5862b578c2ede0f0f5a1052fd9
#16 Merged; M6 OpenSpec workflows 3fab604da1d64313018482aff0412b44d157b78c 6f9afaa074f0d66b6ab53662193898ba024e2a03
#17 Merged; protected-review delivery contract 3cfb11aeeb32781231fb77082b2b9511a447abc7 7a9503e164135297b570dd329b665220c518fa7e
#18 Merged; M6 merge evidence 7dc15a602ba21ae1028b405c69e5b604474363d4 1ae0e3925c8c61e5da23a4573b6c58083e5437ca
#19 Merged; M6 final evidence 2424117fb4983a1a1da88603ae1f7301a5270a62 3872b0e09ac92c6dde76955869def2d1e3bad2f0
#20 Merged; OpenCode 2 default with 1.19.4 compatibility ff43e75b5080a2cdd52ec038e96d73b54bdbd1fb 5420268ade76129d9234a89995dbe3227edddfcd
#21 Merged; final M6 Architect remediation after R1–R5 resolution and final no-findings review ef11d3362186d687eea8f76d4e5d1a0f0251e201 a55924350aebf2112ff7906978548727de081e4a

The only live repository branch after refresh is main; the remote PR inventory is empty. Original merged/rejected PR branches were already removed. There are no dependent open PRs. Repository rules were not bypassed.

Kickoff documentation and helper

Reviewed tracked AGENTS.md, the M7 prompt, the revised specification, architecture decisions, planning lifecycle, milestone reports 1–6, package.json, pnpm-workspace.yaml, each active app/package package.json, the API Python configuration, Alembic layout, and existing retrieval/auth/API boundaries. Corrected the root guide to be a concise map and linked source of truth; it retains M4 NO-GO and scheduler, authorization, untrusted-input, contract-generation, credentials, and dirty-work protections. Root package scripts remain the source of verification commands.

Added a fixed allowlist helper: pnpm harnessa list and pnpm harnessa <target> <command>. Targets are api, web, marketing, cloud-portal, ui-react, ui-svelte, and contracts. It invokes only listed commands, uses the target workspace cwd, inherits output/environment, and returns the child exit status. Unknown target/command exits 2. Clean checkout prerequisites are pinned Node/pnpm/Python/uv and the documented frozen installs. See AGENTS.md for examples and service-variable requirements.

Verification Result
node --check scripts/harnessa.mjs Passed.
pnpm harnessa list Passed; lists API, web, marketing, cloud-portal, React UI, Svelte UI, and contracts allowlists.
pnpm harnessa api __proto__ and pnpm harnessa unknown list Both rejected with exit 2. The helper uses own-property checks and cannot dispatch object-prototype keys.
HARNESSA_API_URL=http://127.0.0.1:28011 pnpm contracts:generate Passed against a temporary loopback API using OpenAPI TypeScript 7.13.0; generated vector_omitted_reason and updated M7 API schemas.
pnpm harnessa contracts typecheck Passed.
podman compose --project-name harnessa -f infra/compose.yaml config --quiet Passed with the retrieval profile and deployment-owned MCP settings.

Retrieval/MCP implementation, versions, and acceptance evidence

The existing RepositorySearchPort, search_repository service, authenticated specification-search route, repository membership checks, and OpenAPI TypeScript generation remain the single public search path. Source content remains authoritative in Git; PostgreSQL stores metadata/provenance and reauthorizes before search/open. M4's LangGraph NO-GO and OpenCode 2-default/ACP v1-compatibility decision remain unchanged.

Implemented: versioned Git-tree indexing for OpenSpec/docs/repository files and explicitly approved skill files; size/path/secret/evaluation filters at both ingestion and live search; dry-run counts and omissions; source/chunk metadata, idempotent repeated sync, stale revisions, deletion tombstones only after complete scans and connector-failure status; lexical citation manifests and context budgets; optional LlamaIndex/Qdrant adapter and isolated optional service profile; authenticated status/sync/MCP contracts; administrator-managed project MCP grants, allowlisted read-only discovery/invocation, per-server deployment-owned secret-reference allowlists, protocol/capability checks, nested tool argument validation, per-call limits, post-call authorization recheck and hash-only audit. The adapter does not store source text in Qdrant payloads.

Item Version/configuration/evidence
Python, Node, pnpm, uv Python 3.12.15, Node 24.22.1, pnpm 10.34.7, uv 0.13.1.
API and optional retrieval packages FastAPI 0.159.1; llama-index-core==0.14.25, llama-index-vector-stores-qdrant==0.10.4, qdrant-client==1.19.1 in the isolated retrieval extra. Package pins and license review are recorded in pyproject.toml/uv.lock; optional packages are not production defaults.
Qdrant image/service docker.io/qdrant/qdrant:v1.19.2@sha256:390ca16351185f9913c23d0c95ded0cdf2ce17e525dd7fbe58d3339c9c80e633, cached local linux/amd64 image; persistent Compose volume harnessa_qdrantdata; 127.0.0.1-only published port; /healthz probe; 1 GiB memory, 1 CPU, 128 PIDs. Live local container reported 29.59 MiB idle memory and 0.05% CPU at the sample instant. Compose profile config and the actual image health probe passed. No registry pull occurred in this run.
Qdrant pilot PYTHONPATH=apps/api uv run --offline --extra retrieval python scripts/m7_retrieval_pilot.py --qdrant-url http://127.0.0.1:16333 passed against the persistent Qdrant container. Four synthetic documents/four chunks, three fixed queries: lexical/vector recall@3 1.0/1.0, MRR@3 1.0/1.0; median latency 0.018631 ms lexical / 1.897670 ms vector; duplicate upsert 4 points; revision deletion converged to 3; Qdrant payload had no source text. Fixture embedding cost was $0. The token-hash embedding is deterministic test code, not a semantic model; this result does not establish production quality or benefit.
Embedding/reranking No approved embedding/reranking route exists at Harnessa's model-budget boundary. Vector querying remains disabled with approved_embedding_route_not_configured; lexical search is the supported default. The deterministic pilot is a fixture, not representative semantic evaluation. No provider call occurred.
Local Qdrant recovery Exported the stopped pilot volume with podman volume export, imported it into a second volume, started a second container from the same digest, and verified /healthz, the collection, and its one synthetic recovery point. Both test containers/volumes and the temporary archive were removed afterward. This is a local recovery smoke, not a production backup rehearsal.
Focused offline tests UV_OFFLINE=1 uv run --offline pytest -q tests/test_retrieval_governance.py tests/test_retrieval_vector.py tests/test_mcp_http.py — 14 passed; one expected warning says local/in-memory Qdrant ignores payload indexes. Coverage includes traversal/secrets/evaluation omission, project filter, untrusted text, deletion convergence, MCP legacy/modern protocol envelopes, capability/schema validation, timeout, size and deployment secret-reference policy.
Disposable database integration PostgreSQL 16.10 and Redis 7.4.2, loopback-only disposable containers. TEST_DATABASE_URL=postgresql+asyncpg://harnessa:<temporary>@127.0.0.1:56438/harnessa_m7_test TEST_REDIS_URL=redis://127.0.0.1:56439/2 DATABASE_URL=postgresql+asyncpg://harnessa:<temporary>@127.0.0.1:56438/harnessa_m7_test REDIS_URL=redis://127.0.0.1:56439/2 UV_OFFLINE=1 uv run --offline pytest -q ../../tests/integration/test_retrieval_index.py from apps/api — 4 passed, covering preview/idempotence/deletion, outage, repository membership revocation and MCP revocation during an in-flight call. The remote result was withheld and a failed hash-only audit row remained.
Full project tests UV_OFFLINE=1 pnpm test with temporary loopback PostgreSQL 16.10 and Redis 7.4.2 URLs supplied in the process environment — 137 Python unit, 44 integration, 10 web and 2 cloud-portal tests passed; marketing static artifact check passed. API line coverage 85.28%, aggregate line 85.49%, aggregate statements 85.74%.
Typecheck/static checks UV_OFFLINE=1 pnpm typecheck passed (web, API, generated contracts, React, Svelte; zero Svelte diagnostics). UV_OFFLINE=1 uv run --offline mypy --strict --follow-imports=silent apps/api/harnessa passed, 50 files. UV_OFFLINE=1 pnpm lint and UV_OFFLINE=1 uv run --offline ruff check apps/api tests scripts passed after Ruff import ordering fixes.
Migration behavior DATABASE_URL=<disposable> uv run --offline python -m alembic check — no new operations. Downgrade one revision and upgrade to head both passed; alembic current reported 9f3c7a1d4e20 (head).
MCP live endpoint None configured; no external MCP service was contacted. MockTransport tests are offline protocol evidence, not remote interoperability. The prompt permits deterministic fixtures when external services are unavailable. Modern MCP 2026-07-28 stateless discovery and legacy 2025-11-25, 2025-06-18, 2025-03-26, and 2024-11-05 are supported with exact grant-pinned protocol confirmation.

Data, recovery, and limitations

Migration 9f3c7a1d4e20 creates metadata-only retrieval_sources, retrieval_chunks, retrieval_syncs, mcp_project_grants, and mcp_tool_audit; af64c011b715 records incremental and complete-snapshot state for an honest coverage baseline. Downgrade with cd apps/api && DATABASE_URL=<target> uv run python -m alembic downgrade d6a5e7c4b209 only after PostgreSQL backup; this removes M7 metadata/grants/audit and leaves the separate Qdrant volume untouched. The first sync is a bounded Git snapshot; later syncs read blobs changed since the last successful ancestor revision and process deletions. A missing/non-ancestor base, absent complete coverage baseline, or changed skill-approval policy forces a full snapshot. Changed-file and deletion behavior is covered by disposable PostgreSQL/Redis integration evidence below. Fixture/MockTransport and local-container evidence remain distinct from provider/live-MCP evidence.

Remaining acceptance gap and limitations

  • A live M9 verifier producer has not yet populated the new trusted evidence port. M7 fixture evidence proves the contract and retrieval behavior; it does not claim a live verifier run. Run.status == SUCCEEDED is not proof and is never converted to a passed record.
  • The vector pilot used a synthetic four-document corpus and deterministic fixture embeddings. It tied lexical recall/MRR while adding about 1.88 ms median query latency; therefore lexical remains the only enabled production path. The vector adapter remains optional and unavailable without an approved budgeted embedding port and representative approved corpus/evaluation.
  • No live MCP endpoint was configured, so remote-server interoperability is not claimed. Offline protocol fixtures cover modern and legacy envelopes; no live endpoint is required for those checks.
  • The authenticated status/search and grant APIs are contract-generated, but no UI wiring is part of M7. M8 must use these contracts and preserve all authorization checks.

Independent review of PR #22 identified four defects which were addressed: search filters secret-like and hidden-evaluation material, incomplete bounded snapshots mark unseen source rows stale and never infer their deletion, MCP grants and invocation enforce the deployment-owned per-server MCP_SECRET_REFERENCES_JSON allowlist, and the existing lexical search path now retrieves OpenSpec change history and explicitly approved skills. Regression coverage checks live search exclusions, partial-snapshot preservation, unrelated secret rejection, and citations for an OpenSpec proposal and a project-approved skill. The earlier fresh-head no-findings review is recorded on PR #22 for code/workflow head 7f78f8fbca68c3cada22600e295e7d22e6b42318; later incremental-sync reviews and repairs follow below.

The next independent review found and reported a coverage-baseline defect: incremental batch counts were being used as a repository-wide denominator. The proposal was accepted in the PR discussion. Migration af64c011b715, generated status provenance, and no-change/deletion/legacy-baseline regression cases now keep coverage tied to the latest complete full snapshot and mark newer incremental state explicitly. The follow-up review found no remaining issue in those changes.

The fresh review at head a498bc516b3350a3e20e90db676c1238722dbfe9 also found that an empty but complete snapshot was excluded from the coverage baseline. I accepted M7-R1 in the PR discussion: empty corpora now report 100% baseline coverage and seed incremental sync. The new integration regression covers empty snapshot status followed by first-file delta; the fresh-head review found no further issue in that code. The subsequent report-only update at 667e5c8a251346844186317f00c8c6020c4cd74f received an exact-head no-findings review at PR review 5622209887.

Earlier hosted PR checks (head 7f78f8fbca68c3cada22600e295e7d22e6b42318) Result
Local CI PR run 39869634746 passed in 3m01s after uv sync --frozen --extra retrieval: 137 unit, 44 integration, 10 web and 2 cloud-portal tests; marketing artifact and 85% coverage gates passed. API line/statements 85.21%; aggregate line 85.42%, statements 85.67%.
CodeQL PR run 39869634914, Python and JavaScript/TypeScript analyses passed.
Documentation PR run 39869635340, mkdocs build --strict --site-dir site passed; deployment correctly skipped for a pull request.

The first hosted Local CI run on 3614fd0 exposed that the base image omits the optional retrieval extra while mypy checked imports in the pilot adapter. pyproject.toml now scopes ignore_missing_imports only to llama_index.* and qdrant_client.*; the retrieval extra remains runtime-optional and the pilot tests exercise it when installed. The normal hosted typecheck command and strict local mypy both pass with the extra installed.

Hosted Local CI on 6a1d1a0 confirmed a second consequence of the base-only install: tests/test_retrieval_vector.py was skipped and coverage measured API lines/statements at 84.47% and aggregate lines/statements at 84.70%/84.96%, below the 85% gate. The CI install now uses uv sync --frozen --extra retrieval, keeping the pilot optional in production while including it in test coverage. The exact command passed locally with uv sync --offline --frozen --extra retrieval; the exact-head PR check above confirms success.

These gaps keep this report ACTIVE and prevent archival. They do not authorize starting milestone 8.

Changed-file sync follow-up (2026-10-23)

The repository connector now uses git-tree-v2-<skill-policy-hash>. It resolves the last successful sync commit and diffs the current default branch against that ancestor, reading blob contents only for changed eligible files. Unchanged source records retain their last-content revision. Replacements tombstone old chunk rows, deletions tombstone old source/chunk rows, and known changed paths that become ineligible cannot leave old content current. A first sync, a missing or non-ancestor base, or a changed approved-skill path set uses a bounded full snapshot. Sync results expose whether the pass was incremental; a no-change repeat is idempotent. Status reports indexed_revision from the latest successful sync while coverage remains tied to the latest complete full-snapshot coverage_revision; the freshness field identifies when incremental work is newer than the coverage baseline. A missing baseline forces a full snapshot. considered counts deleted paths as well as changed and omitted files.

  • UV_OFFLINE=1 uv run --offline ruff check apps/api/harnessa/adapters/specification_workspace.py apps/api/harnessa/services/retrieval_index.py tests/integration/test_retrieval_index.py — passed.
  • UV_OFFLINE=1 uv run --offline mypy --strict --follow-imports=silent apps/api/harnessa/adapters/specification_workspace.py apps/api/harnessa/services/retrieval_index.py apps/api/harnessa/contracts.py — passed, 3 files.
  • TEST_DATABASE_URL=postgresql+asyncpg://<ephemeral-role>:<redacted>@127.0.0.1:56438/harnessa_m7_continue_<run>_test TEST_REDIS_URL=redis://127.0.0.1:56439/5 UV_OFFLINE=1 uv run --offline pytest -q tests/integration/test_retrieval_index.py — 6 passed against disposable PostgreSQL 16.10 and Redis 7.4.2. The fixture made a guide-only commit and confirmed one changed file was indexed while an unchanged OpenSpec source retained its prior current revision. It also verified missing-base full-snapshot fallback, secret-like replacement tombstoning, and deletion tombstones. The temporary database and role were dropped; only Redis DB 5 was used.
  • Focused offline policy/protocol/vector tests — 14 passed; one expected local Qdrant payload-index warning.
  • HARNESSA_API_URL=http://127.0.0.1:28011 pnpm contracts:generate — passed against a temporary loopback-only API; generated TypeScript now exposes the incremental sync response field. The API process was stopped afterward.
  • UV_OFFLINE=1 pnpm lint and UV_OFFLINE=1 pnpm typecheck — passed; the latter covered web, API, generated contracts, React and Svelte with zero Svelte diagnostics.
  • TEST_DATABASE_URL=postgresql+asyncpg://<ephemeral-role>:<redacted>@127.0.0.1:56438/harnessa_m7_suite_<run>_test TEST_REDIS_URL=redis://127.0.0.1:56439/5 UV_OFFLINE=1 pnpm test — passed: 137 unit, 44 integration, 10 web, and 2 cloud-portal tests; marketing artifact check passed. API line/statements 85.21%; aggregate lines 85.43%, statements 85.67%. PostgreSQL 16.10 and Redis 7.4.2 were disposable; the test role/database were dropped afterward.
  • TEST_DATABASE_URL=postgresql+asyncpg://<ephemeral-role>:<redacted>@127.0.0.1:56438/<ephemeral-db> TEST_REDIS_URL=redis://127.0.0.1:56439/5 UV_OFFLINE=1 uv run --offline pytest -q tests/integration/test_retrieval_index.py — 8 passed with disposable PostgreSQL 16.10/Redis 7.4.2. The deletion-only commit reports considered == 1 and the endpoint reports its successful repository revision; no-change and deletion-only status preserve the full-snapshot coverage baseline, while freshness reports newer incremental state. Empty complete snapshots report 100% coverage and seed subsequent incremental sync. A legacy sync with no complete-baseline metadata forces a full snapshot. Temporary role/database were dropped; only Redis DB5 was used.
  • UV_OFFLINE=1 uv run --offline ruff check apps/api/harnessa/api/retrieval_routes.py apps/api/harnessa/services/retrieval_index.py apps/api/harnessa/db/retrieval.py apps/api/harnessa/contracts.py tests/integration/test_retrieval_index.py apps/api/migrations/versions/af64c011b715_retrieval_sync_coverage_baseline.py, strict mypy on the four API source files, and git diff --check — passed.
  • HARNESSA_API_URL=http://127.0.0.1:28011 pnpm contracts:generate served from a locally generated OpenAPI schema over a temporary loopback-only file server; generated coverage_revision in TypeScript. Contract package typecheck passed. The server was stopped.
  • DATABASE_URL=<ephemeral PostgreSQL 16.10 URL> UV_OFFLINE=1 uv run --offline python -m alembic upgrade head, alembic check, alembic downgrade 9f3c7a1d4e20, alembic upgrade head, and alembic current — passed; no schema drift, downgrade/re-upgrade succeeded, final revision af64c011b715 (head). Disposable role/database were dropped.

This removes changed-file sync and misleading incremental coverage from the open acceptance list. The verified-run contract follow-up below removes the missing durable evidence model/port gap; until that follow-up passes independent review, required hosted checks, and protected merge, M7 remains ACTIVE. Optional production vector activation and remote MCP interoperability remain disabled/unclaimed; lexical search and deterministic MCP fixture evidence remain usable offline. No model provider or external MCP endpoint was contacted.

Verified-run evidence follow-up (2026-10-23)

The former verified-run blocker is addressed in this follow-up branch. verification_evidence is a durable immutable result record scoped to organization, project, connected repository, task, run, attempt and fencing token. The trusted server-side record_verification_evidence port validates those IDs against durable Harnessa records, validates verifier identity, source revision, bounded criteria/summary and optional run-fenced artifact digest, rejects secret-like text, and enforces idempotency by verifier source record ID and canonical content hash. It has no public route and does not infer outcomes from scheduler status. The existing repository search path lexically includes only explicit passed evidence for the selected project and repository, then rechecks project membership and repository ownership before returning content. Citations reference the run/evidence ID, verifier source revision, and immutable content hash. Failed, manual-review and unverified records remain stored but are not searchable as passing evidence.

Evidence status is offline fixture only for the producer and retrieval behavior. The integration fixture records an explicit verifier result for a succeeded run, checks identical replay is idempotent, rejects a mismatched attempt, confirms citation revision/content hash, and confirms an explicit failed result is not returned as verified evidence. It does not claim a live M9 verification runner exists or has produced results. M9 is the next producer; until then the port is available only to trusted server-side verifier adapters.

  • UV_OFFLINE=1 uv run --offline ruff check apps/api/harnessa/db/retrieval.py apps/api/harnessa/services/specifications.py apps/api/harnessa/services/verification_evidence.py apps/api/migrations/versions/c83b2e441a79_verification_evidence.py tests/integration/test_retrieval_index.py — passed.
  • UV_OFFLINE=1 uv run --offline mypy --strict --follow-imports=silent apps/api/harnessa/services/verification_evidence.py apps/api/harnessa/services/specifications.py — passed, 2 files.
  • With disposable PostgreSQL 16.10 container harnessa-m7-test-pg at loopback port 56438 and Redis 7.4.2 container harnessa-m7-test-redis at loopback port 56439, a new database harnessa_m7_evidence_20261023_test was created. TEST_DATABASE_URL=postgresql+asyncpg://harnessa:<redacted>@127.0.0.1:56438/harnessa_m7_evidence_20261023_test TEST_REDIS_URL=redis://127.0.0.1:56439/5 UV_OFFLINE=1 uv run --offline pytest -q tests/integration/test_retrieval_index.py — 9 passed, including the new verified-run evidence case. The one failed exploratory run exposed that the response rehashed the full verifier record instead of preserving its content hash; this was corrected and the complete focused suite then passed. The password was read from the disposable container environment and was not printed or recorded. The database used a dedicated test DB and Redis DB 5.
  • Migration revision c83b2e441a79 follows af64c011b715; rollback of only this follow-up is DATABASE_URL=<target> uv run python -m alembic downgrade af64c011b715, and reapplication is alembic upgrade head.
  • On a fresh disposable PostgreSQL 16.10 database with DATABASE_URL=postgresql+asyncpg://harnessa:<redacted>@127.0.0.1:56438/harnessa_m7_evidence_final_20261023_test, from apps/api, UV_OFFLINE=1 uv run --offline python -m alembic upgrade head, alembic check, alembic downgrade af64c011b715, alembic upgrade head, and alembic current passed. Schema check reported no new operations and final revision was c83b2e441a79 (head).
  • TEST_DATABASE_URL=postgresql+asyncpg://harnessa:<redacted>@127.0.0.1:56438/harnessa_m7_evidence_final_20261023_test TEST_REDIS_URL=redis://127.0.0.1:56439/5 UV_OFFLINE=1 pnpm test — passed after all review fixes: 137 API unit, 47 integration, 10 web, and 2 cloud-portal tests; marketing static artifact check passed. API line/statements 85.30%; aggregate lines 85.50%, statements 85.74%. These are local fixture/service results, not hosted PR checks. The disposable PostgreSQL database and dedicated nonzero Redis DB were used; no provider or external MCP endpoint was contacted.
  • UV_OFFLINE=1 pnpm lint, UV_OFFLINE=1 pnpm typecheck, and git diff --check — passed. Full API typecheck reported 40 files and Svelte reported zero errors/warnings.

Overall M7 remains ACTIVE pending exact-head independent review, required hosted checks, repository protections and protected merge for this follow-up. A live M9 producer is not required to finish the M7 evidence contract, but any claims about actual verifier-produced history must wait for M9 integration. M8 remains out of scope.

The first exact-head independent review on PR #25 (head 3b65d97e2c3dcc41fdbdb9e9af7a42edcd8f776f) raised three P2 proposals in PR comments: verified-run source URIs were mislabeled as repository URIs; combined search hits did not preserve the overall result limit or ranking; and criterion-only matches returned an excerpt that did not contain the match. All three were accepted in maintainer reply 6354220758 and fixed on the PR branch. Regression coverage now checks the evidence-specific manifest URI, combined result cap, and criterion-only excerpt.

The fresh review on head 0d0cac07e69e13cde5a318ba5b0842eca508fd08 raised P2 M7-R4 (comment 6354247568): a project can contain multiple repositories, but neither the Task nor Run rows bind to a repository, and a supplied source revision had not been checked against Git. I accepted the proposal in maintainer reply 6354269284. The producer port now requires the task's durable SpecificationInterview.repository_id to match the evidence repository and verifies the full commit SHA exists in that connected repository through SpecificationWorkspaceManager.contains_revision. Integration regressions reject a different same-project repository and a nonexistent source revision.

The next fresh review on head f9fe8d9beebd3de249e07c7e32acf87a60bc6e3b raised P2 M7-R5 (comment 6354292808): repository commit existence alone does not prove that the run tested that commit. I accepted the proposal in maintainer reply 6354305593. The follow-up adds nullable Run.source_revision and trusted bind_run_source_revision, which binds a repository-validated commit SHA to the exact task/run/attempt/fence once; record_verification_evidence now requires the persisted run SHA to match the verifier result. The fixture creates two valid commits, binds one to the run, and rejects evidence claiming the other valid commit. The schema migration owns the additional column.

The next review on head 60cd646f9b24182cb083e6520f7becca8a79b1d0 raised P1 M7-R6 (comment 6354348521): two concurrent binders could both observe an empty source revision and overwrite the value. I accepted it in maintainer reply 6354358817. bind_run_source_revision now uses an atomic conditional UPDATE ... WHERE source_revision IS NULL RETURNING id, then confirms the persisted value on a lost race. The integration fixture races two distinct valid commits through separate database sessions and asserts exactly one binding succeeds. A fresh review is required on the repaired final head.

The next exact-head review on e5d09663b1c5b85d4dd2dd1a556f74ae874d48f4 raised P2 M7-R7 (PR comment 6354398667): concurrent writes with the same verifier source record could race the unique constraint, leaking an uncaught IntegrityError to one caller. I accepted the finding in maintainer reply 6354401730. Evidence persistence now uses PostgreSQL INSERT ... ON CONFLICT DO NOTHING on (project_id, source_record_id), then reads the winner and compares the canonical content hash. Identical concurrent retries return the same durable record; differing content remains a 409 conflict. The integration fixture invokes two independent sessions concurrently and asserts both receive the same evidence ID.

R7 verification on the working head before the final exact-head review:

  • UV_OFFLINE=1 uv run --offline ruff check apps/api/harnessa/services/verification_evidence.py tests/integration/test_retrieval_index.py — passed.
  • UV_OFFLINE=1 uv run --offline mypy --strict --follow-imports=silent apps/api/harnessa/services/verification_evidence.py apps/api/harnessa/services/specifications.py — passed, 2 files.
  • TEST_DATABASE_URL=postgresql+asyncpg://harnessa:<redacted>@127.0.0.1:56438/harnessa_m7_evidence_final_20261023_test TEST_REDIS_URL=redis://127.0.0.1:56439/5 UV_OFFLINE=1 uv run --offline pytest -q tests/integration/test_retrieval_index.py — 9 passed on disposable PostgreSQL 16.10 and Redis 7.4.2, including simultaneous identical evidence inserts through separate sessions.
  • TEST_DATABASE_URL=postgresql+asyncpg://harnessa:<redacted>@127.0.0.1:56438/harnessa_m7_evidence_final_20261023_test TEST_REDIS_URL=redis://127.0.0.1:56439/5 UV_OFFLINE=1 pnpm test — passed: 137 API unit, 47 integration, 10 web, and 2 cloud-portal tests; marketing artifact check passed. API line/statements 85.37%; aggregate lines 85.57%, statements 85.81%. This is local offline fixture/service evidence, not provider or live-agent evidence.
  • UV_OFFLINE=1 pnpm lint, UV_OFFLINE=1 pnpm typecheck, and git diff --check — passed. API typecheck covered 40 files; Svelte reported zero errors and warnings.

No model provider, registry, external MCP endpoint, or other external service was contacted for this R7 change. The prior hosted check results applied to the prior head; fresh exact-head review and required hosted checks are still required.

Final M7 delivery and post-merge status

PR #22 was reviewed at exact final head 11281130d19809ea2466798765f0e0f5de39e520. The exact-head independent review reported no findings: review 5622221177. GitHub reported no unresolved review threads. Required PR Local CI run 39873032572 passed (lint/typecheck, builds, tests, and coverage); push Local CI run 39873028097 passed; CodeQL run 39873032436 passed Python and JavaScript/TypeScript analyses; Documentation run 39873032447 passed strict build, with deployment correctly skipped for the PR. PR #22 merged by squash through repository protection at b2ad7dbb13a4b1ce97e96b4f84a677278f9b4920.

After that merge, the M6 report/index were reconciled with M6's final successful acceptance evidence and its prompt was archived byte-for-byte in PR #23, merged at 078617e992c8b381fef9d23f6edefd540a373018.

The final M7 follow-up was PR #25, with all implementation and evidence changes in the PR. Independent review of exact head 20d09bd9eb8266cec21d00cee65f7e8a8baa3716 found no actionable findings (comment 6354437566); GitHub showed zero unresolved review threads. Active Protect main ruleset 25647158 required strict Local CI and CodeQL, review-thread resolution, and allowed squash merge; bypass permission was never.

Final-head hosted check Result
Local CI PR run 39878468500, job 120170602796, passed in 2m54s: lint/typecheck, builds, unit/integration/application tests, and coverage.
CodeQL PR run 39878468726: Python analysis passed in 46s and JavaScript/TypeScript analysis passed in 59s; required CodeQL check run 120170034784 passed.
Documentation PR run 39878468649, build passed in 16s; deployment correctly skipped for the PR.

PR #25 merged by squash through the active ruleset at d992bc1266ed08add12f54d0921546b5dc73528b at 2026-10-23T00:35:46Z. The final-head local offline suite and hosted check evidence are recorded above. No paid model/provider call or live MCP endpoint was used for this evidence follow-up. Optional production vector activation remains disabled: lexical retrieval is usable without embeddings and the fixture pilot did not justify enabling a vector default. Live MCP interoperability and M9 producer evidence remain explicitly unclaimed; deterministic fixtures satisfy the unavailable-integration evidence in this milestone.

The M7 prompt was moved byte-for-byte from planning/prompts/07-retrieval-mcp.md to planning/archive/completed/07-retrieval-mcp.md after PR #25 acceptance. The planning index now marks M7 archived complete. M8 has not been started.

Next milestone prerequisites

Milestone 8 prerequisites are satisfied by the completed M7 evidence above. A live M9 verifier producer or live MCP endpoint was not required because deterministic integration fixtures cover unavailable integrations. This run stops before milestone 8.