DD-469: Attention 3/6 — bounded queries and ranking #5

Closed
opened 2026-11-15 06:40:48 +00:00 by svc-agent-writer · 6 comments

Scope and authority

Parent: #1 (DD-469). Product decisions: ADR 0002. Agreed decomposition.

Implement attention/1.0 and binding 1.1 pinned to mind-spec 3da6a263e6aeb3f37d25590d6ab755045ff53786, including its schemas and conformance obligations. Preserve the single queue authority, independent grants and host-owned interruption policy. This issue is a bounded implementation brief; it does not claim working software or grant production deployment.

Blocked by

None.

Completed prerequisite

Durable queue/commands #4 landed in PR #11 as 04b0704842de on 2026-11-15. This retires the #4 dependency; it does not dispatch this issue.

Deliverables and acceptance

Deliverables. Implement list, get and explain against the current authorised projection. Use the pinned priority/due/first-acceptance/item-UUID order and fixed reason codes. Preserve terminal items until explicit Forget; eligible is the default view and all still excludes forgotten items. Continuations bind actor, queue, recovery generation, query/limit, mutation generation and frozen evaluation time, with one five-minute deadline measured from the first page. Do not retain historical payload snapshots.

Enforce strict JSON decoding, schema formats, semantic UTF-8 checks, the 16 KiB logical request ceiling, 1 MiB response ceiling and 50/default, 100/maximum row limits. Bound raw transport work as well as logical documents. Shorten pages to the byte budget while ensuring continuation progress. Reauthorise and recheck erasure before releasing buffered content; coordinate the final Forget fence with slice 4.

Acceptance. Exercise equal-priority ties, dated/undated order, replacement age preservation and explain inputs. Verify fractional microsecond snooze boundaries and backward wall-clock correction across actual restart. Mutations invalidate existing views; no-op writes and passive time passage preserve frozen views. Check actor/query/limit/generation mismatches, unknown cursors and the original five-minute expiry. Send malformed Unicode, duplicate keys, nonfinite numbers, extra fields and oversized documents through the actual adapter. Test multibyte record-ID limits and byte-limited pages without empty-page loops. Revoke authority while a response is buffered and prove it cannot subsequently release protected content. Exercise the erasure-fence interface with a test control here; the actual Forget race is required integration evidence in slices 4 and 6.

Boundary. Reads do not acknowledge, dispose or deliver. Passing logical byte fixtures does not establish packaged memory, latency or concurrency budgets; those require measurement in slice 6.

Completion evidence

Link the implementing PR and exact commit, commands and results for the acceptance obligations above. Distinguish actual provider checks from reference-model tests; record unsupported checks as unsupported. Follow the repository's specification/review process before implementation. Do not close the parent epic from this slice.

## Scope and authority Parent: https://git.groupthink.asia/dev/attention-mind-mcp/issues/1 (DD-469). Product decisions: [ADR 0002](https://git.groupthink.asia/dev/attention-mind-mcp/src/branch/main/docs/adr/0002-standalone-product-and-managed-recovery.md). [Agreed decomposition](https://git.groupthink.asia/dev/attention-mind-mcp/src/branch/main/docs/planning/implementation-slices.md). Implement attention/1.0 and binding 1.1 pinned to [mind-spec `3da6a263e6aeb3f37d25590d6ab755045ff53786`](https://git.groupthink.asia/dev/mind-spec/src/commit/3da6a263e6aeb3f37d25590d6ab755045ff53786/contracts/attention-v1/README.md), including its schemas and [conformance obligations](https://git.groupthink.asia/dev/mind-spec/src/commit/3da6a263e6aeb3f37d25590d6ab755045ff53786/contracts/attention-v1/CONFORMANCE.md). Preserve the single queue authority, independent grants and host-owned interruption policy. This issue is a bounded implementation brief; it does not claim working software or grant production deployment. ## Blocked by None. ## Completed prerequisite Durable queue/commands #4 landed in [PR #11](https://git.groupthink.asia/dev/attention-mind-mcp/pulls/11) as `04b0704842de` on 2026-11-15. This retires the #4 dependency; it does not dispatch this issue. ## Deliverables and acceptance **Deliverables.** Implement `list`, `get` and `explain` against the current authorised projection. Use the pinned priority/due/first-acceptance/item-UUID order and fixed reason codes. Preserve terminal items until explicit Forget; eligible is the default view and `all` still excludes forgotten items. Continuations bind actor, queue, recovery generation, query/limit, mutation generation and frozen evaluation time, with one five-minute deadline measured from the first page. Do not retain historical payload snapshots. Enforce strict JSON decoding, schema formats, semantic UTF-8 checks, the 16 KiB logical request ceiling, 1 MiB response ceiling and 50/default, 100/maximum row limits. Bound raw transport work as well as logical documents. Shorten pages to the byte budget while ensuring continuation progress. Reauthorise and recheck erasure before releasing buffered content; coordinate the final Forget fence with slice 4. **Acceptance.** Exercise equal-priority ties, dated/undated order, replacement age preservation and explain inputs. Verify fractional microsecond snooze boundaries and backward wall-clock correction across actual restart. Mutations invalidate existing views; no-op writes and passive time passage preserve frozen views. Check actor/query/limit/generation mismatches, unknown cursors and the original five-minute expiry. Send malformed Unicode, duplicate keys, nonfinite numbers, extra fields and oversized documents through the actual adapter. Test multibyte record-ID limits and byte-limited pages without empty-page loops. Revoke authority while a response is buffered and prove it cannot subsequently release protected content. Exercise the erasure-fence interface with a test control here; the actual Forget race is required integration evidence in slices 4 and 6. **Boundary.** Reads do not acknowledge, dispose or deliver. Passing logical byte fixtures does not establish packaged memory, latency or concurrency budgets; those require measurement in slice 6. ## Completion evidence Link the implementing PR and exact commit, commands and results for the acceptance obligations above. Distinguish actual provider checks from reference-model tests; record unsupported checks as unsupported. Follow the repository's specification/review process before implementation. Do not close the parent epic from this slice.
Author
Member

Architect review of draft spec from Half-A 20261115T112242Z-2d09e15e. This is a hold on dispatch pending correction and re-verification, under the operator’s DD-469 continuation authority. The live Half-A repair pass remains owned by mind-spec@voyager; do not start a duplicate run.

The draft could not read the pinned contract prose from its nested sandbox. I checked the immutable attention/1.0 README at 3da6a263e6ae and CONFORMANCE. The local copy is unchanged at that pin. These are settled contract requirements, not new product decisions.

  1. Correct continuation refusals. The contract says “unknown or incompatible continuations return view_changed”. For a syntactically valid list request, this covers forged/unknown/wrong-purpose cursors and incompatible actor, query/limit or token identity/generation. Preserve the normal top-level request validation and queue/recovery preconditions separately; token expiry is view_expired. Update the approach, invariants and tests together. The draft’s invalid_request mapping is not approved. Its ranking direction and inclusive snooze-expiry boundary do agree with the pin.
  2. Define the actual response-release boundary. A fence in Service.execute runs before FastMCP constructs/buffers/serializes the response; FastMCP/ASGI can await before handing over its body. Require a final fence at the buffered transport boundary and a defined serialization mechanism between response handoff and conflicting authority changes, prepared recovery transitions and Forget. Another check without a serialization rule leaves a race. Add a served-transport barrier after computation/serialization but before body handoff, then revoke or erase through the test seam and prove that protected bytes are withheld. Retain a private hook for #6 to use. If the correct mechanism needs store.py or a coordinator file, add it explicitly to Primary Files and Source Hashes before dispatch. The Attention session independently raised the same gap.
  3. Account for work bounds accurately. State scan/sort work in terms of the enforced configured item-count bound and bounded narrow fields. Test that payload decoding is limited to page rows. The ASGI timeout is not cancellation of synchronous Python/SQLite work. This review does not require a new fixed capacity ceiling; packaged performance measurements remain #8.

The verifier’s existing blocking finding on MCP text-copy escaping/raw-envelope size must also be resolved with the actual encoded envelope budget and transport tests. A logical 1 MiB result can exceed a naive two-copy raw allowance.

Refs #5 is accepted. I will post completion evidence and close #5 only after the reviewed, integrated, exact-head green merge. The real Forget race and packaged acceptance remain with #6/#8; #1 stays open. Thus neither missing-contract access nor the closure bookkeeping needs another human decision.

Full pinned-source snapshots with SHA-256 hashes and this review are available locally at /tmp/dd469-attention5-contract-feedback.md for incorporation into the next stage’s readable context. No portable contract bytes are to change.

Architect review of draft spec from Half-A `20261115T112242Z-2d09e15e`. This is a **hold on dispatch pending correction and re-verification**, under the operator’s DD-469 continuation authority. The live Half-A repair pass remains owned by mind-spec@voyager; do not start a duplicate run. The draft could not read the pinned contract prose from its nested sandbox. I checked the immutable [attention/1.0 README at 3da6a263e6ae](https://git.groupthink.asia/dev/mind-spec/src/commit/3da6a263e6aeb3f37d25590d6ab755045ff53786/contracts/attention-v1/README.md) and [CONFORMANCE](https://git.groupthink.asia/dev/mind-spec/src/commit/3da6a263e6aeb3f37d25590d6ab755045ff53786/contracts/attention-v1/CONFORMANCE.md). The local copy is unchanged at that pin. These are settled contract requirements, not new product decisions. 1. **Correct continuation refusals.** The contract says “unknown or incompatible continuations return `view_changed`”. For a syntactically valid list request, this covers forged/unknown/wrong-purpose cursors and incompatible actor, query/limit or token identity/generation. Preserve the normal top-level request validation and queue/recovery preconditions separately; token expiry is `view_expired`. Update the approach, invariants and tests together. The draft’s `invalid_request` mapping is not approved. Its ranking direction and inclusive snooze-expiry boundary do agree with the pin. 2. **Define the actual response-release boundary.** A fence in `Service.execute` runs before FastMCP constructs/buffers/serializes the response; FastMCP/ASGI can await before handing over its body. Require a final fence at the buffered transport boundary and a defined serialization mechanism between response handoff and conflicting authority changes, prepared recovery transitions and Forget. Another check without a serialization rule leaves a race. Add a served-transport barrier after computation/serialization but before body handoff, then revoke or erase through the test seam and prove that protected bytes are withheld. Retain a private hook for #6 to use. If the correct mechanism needs `store.py` or a coordinator file, add it explicitly to Primary Files and Source Hashes before dispatch. The Attention session independently raised the same gap. 3. **Account for work bounds accurately.** State scan/sort work in terms of the enforced configured item-count bound and bounded narrow fields. Test that payload decoding is limited to page rows. The ASGI timeout is not cancellation of synchronous Python/SQLite work. This review does not require a new fixed capacity ceiling; packaged performance measurements remain #8. The verifier’s existing blocking finding on MCP text-copy escaping/raw-envelope size must also be resolved with the actual encoded envelope budget and transport tests. A logical 1 MiB result can exceed a naive two-copy raw allowance. `Refs #5` is accepted. I will post completion evidence and close #5 only after the reviewed, integrated, exact-head green merge. The real Forget race and packaged acceptance remain with #6/#8; #1 stays open. Thus neither missing-contract access nor the closure bookkeeping needs another human decision. Full pinned-source snapshots with SHA-256 hashes and this review are available locally at `/tmp/dd469-attention5-contract-feedback.md` for incorporation into the next stage’s readable context. No portable contract bytes are to change.
Collaborator

⏸ SVD architect gate: dev/attention-mind-mcp#5 dd-469-attention-3-6-bounded-queries-and-ranking

Status: CLEAN after 1 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity substrate · dispatch effort high

Run: 20261115T112242Z-2d09e15e

Held because: CLEAN but 6 open risk(s) (4 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. Pinned mind-spec README/CONFORMANCE could not be read from the sandbox. The architect must confirm or override three choices: (a) ranking directions; (b) continuation refusal codes (invalid_request / generation_mismatch / view_changed / view_expired); (c) snooze elapsed at until <= evaluated_at, inclusive. [decision]
  2. Real-provider evidence: the transport suite on the PR head and in CI (ci/woodpecker/pr/validation) must show test_http_full_page_wire_bounds, test_http_release_fence_revocation, test_http_backward_clock_restart_preserves_floor_and_view_expiry, test_http_query_strict_decoding and test_http_query_tools_exact_schemas passing against the served subprocess. [verification]
  3. The claim that pydantic-core and Python-json serialization have equal byte length (the basis of the wire bound) is argued from the pinned SDK sources, but could not be executed in Half-A because the cp312 venv does not run in the sandbox. Check: test_http_full_page_wire_bounds passes on host and in CI at the final PR head; if it fails, report a deviation rather than widening the slack or the cap. [verification]
  4. Only a test-control erasure fence and the default live-items fence are exercised. Record the real Forget-during-buffered-release race as unsupported in the #5 completion comment (slice 4 #6 / slice 6 #8 evidence). [verification]
  5. Packaged memory, latency and concurrency budgets for 100-row pages of up to ~1.9 MB are slice 6 (#8) measurements; record them as unsupported here. [verification]
  6. Whole-issue closure: does the architect accept Refs #5, with the completion-evidence comment plus final-head CI as the outstanding work and #5 closed by hand as for #4, or require Closes #5? [decision]

Change: Mirror commands.py's token and precondition shapes (purpose_key/issue/authenticate_token at commands.py:53-140; decide order at 169-190) for the new queries.py. Move RAW_BODY_BYTES, RAW_RESPONSE_BYTES and envelope() verbatim from mcp_adapter.py:29-30,36-41 into contract.py, and re-export them explicitly from mcp_adapter with X as X (mypy strict). Add ENVELOPE_SLACK_BYTES=4096 and ENVELOPE_BYTES=2,093,056 (= RAW_RESPONSE_BYTES − RAW_BODY_BYTES − slack). Bound list pages on the exact MCP envelope bytes, not the logical document. The incremental accounting is fixed + Σ(len(encode(item)) + escaped-text-len(item)) + 2·(n−1), and the assembled page gets one final exact len(encode(envelope(doc))) check. Keep the 2,162,688 cap unchanged, because the client depends on it (binding.py:83,260 and the raw structuredContent ≤ RESULT_BYTES check at binding.py:86-88). OperationTool.run builds its result from envelope(). Boundary.bounded_send (mcp_adapter.py:109-113) checks content-length before forwarding http.response.start: an oversize response becomes 500 internal_failure, never a truncated body. Service.execute dispatches the three queries, branches the post-check at service.py:78-85, and runs a release fence in a fresh transaction.

Files: src/attention_mind_mcp/queries.py · src/attention_mind_mcp/service.py · src/attention_mind_mcp/contract.py · src/attention_mind_mcp/mcp_adapter.py · tests/test_queries.py · tests/test_commands.py · tests/test_foundation.py · README.md

Source Hashes table: 1 of 20 row(s) malformed and skipped — All 17 existing-file hashes were re-computed this rework (shasum -a 256 (cut -c1-12) at HEAD 04b0704842, with a clean tree. binding.py is newly hashed as a read-only reader of the moved wire seam.) — the drift guard cannot check them; Half-A will report HOLD.

Decision: accept the 6 open risk(s) above and dispatch this spec (svd:go), or park (svd:skip) / re-spec (svd:respec)?

Your call (when this issue is held at the gate via svd:hold):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-dd-469-attention-3-6-bounded-queries-and-ranking.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-dd-469-attention-3-6-bounded-queries-and-ranking.md

— mind-spec

### ⏸ SVD architect gate: dev/attention-mind-mcp#5 dd-469-attention-3-6-bounded-queries-and-ranking **Status:** CLEAN after 1 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity `substrate` · dispatch effort `high` **Run:** `20261115T112242Z-2d09e15e` **Held because:** CLEAN but 6 open risk(s) (4 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. Pinned mind-spec README/CONFORMANCE could not be read from the sandbox. The architect must confirm or override three choices: (a) ranking directions; (b) continuation refusal codes (invalid_request / generation_mismatch / view_changed / view_expired); (c) snooze elapsed at until <= evaluated_at, inclusive. [decision] 2. Real-provider evidence: the transport suite on the PR head and in CI (ci/woodpecker/pr/validation) must show test_http_full_page_wire_bounds, test_http_release_fence_revocation, test_http_backward_clock_restart_preserves_floor_and_view_expiry, test_http_query_strict_decoding and test_http_query_tools_exact_schemas passing against the served subprocess. [verification] 3. The claim that pydantic-core and Python-json serialization have equal byte length (the basis of the wire bound) is argued from the pinned SDK sources, but could not be executed in Half-A because the cp312 venv does not run in the sandbox. Check: test_http_full_page_wire_bounds passes on host and in CI at the final PR head; if it fails, report a deviation rather than widening the slack or the cap. [verification] 4. Only a test-control erasure fence and the default live-items fence are exercised. Record the real Forget-during-buffered-release race as unsupported in the #5 completion comment (slice 4 #6 / slice 6 #8 evidence). [verification] 5. Packaged memory, latency and concurrency budgets for 100-row pages of up to ~1.9 MB are slice 6 (#8) measurements; record them as unsupported here. [verification] 6. Whole-issue closure: does the architect accept Refs #5, with the completion-evidence comment plus final-head CI as the outstanding work and #5 closed by hand as for #4, or require Closes #5? [decision] **Change:** Mirror commands.py's token and precondition shapes (purpose_key/issue/authenticate_token at commands.py:53-140; decide order at 169-190) for the new queries.py. Move RAW_BODY_BYTES, RAW_RESPONSE_BYTES and envelope() verbatim from mcp_adapter.py:29-30,36-41 into contract.py, and re-export them explicitly from mcp_adapter with `X as X` (mypy strict). Add ENVELOPE_SLACK_BYTES=4096 and ENVELOPE_BYTES=2,093,056 (= RAW_RESPONSE_BYTES − RAW_BODY_BYTES − slack). Bound list pages on the exact MCP envelope bytes, not the logical document. The incremental accounting is fixed + Σ(len(encode(item)) + escaped-text-len(item)) + 2·(n−1), and the assembled page gets one final exact len(encode(envelope(doc))) check. Keep the 2,162,688 cap unchanged, because the client depends on it (binding.py:83,260 and the raw structuredContent ≤ RESULT_BYTES check at binding.py:86-88). OperationTool.run builds its result from envelope(). Boundary.bounded_send (mcp_adapter.py:109-113) checks content-length before forwarding http.response.start: an oversize response becomes 500 internal_failure, never a truncated body. Service.execute dispatches the three queries, branches the post-check at service.py:78-85, and runs a release fence in a fresh transaction. **Files:** `src/attention_mind_mcp/queries.py` · `src/attention_mind_mcp/service.py` · `src/attention_mind_mcp/contract.py` · `src/attention_mind_mcp/mcp_adapter.py` · `tests/test_queries.py` · `tests/test_commands.py` · `tests/test_foundation.py` · `README.md` **Source Hashes table:** 1 of 20 row(s) malformed and skipped — `All 17 existing-file hashes were re-computed this rework (`shasum -a 256 <file>` (`cut -c1-12`) at HEAD `04b0704842de`, with a clean tree. `binding.py` is newly hashed as a read-only reader of the moved wire seam.`) — the drift guard cannot check them; Half-A will report HOLD. **Decision:** accept the 6 open risk(s) above and dispatch this spec (`svd:go`), or park (`svd:skip`) / re-spec (`svd:respec`)? **Your call** (when this issue is held at the gate via `svd:hold`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-dd-469-attention-3-6-bounded-queries-and-ranking.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-dd-469-attention-3-6-bounded-queries-and-ranking.md`</sub> — mind-spec
Collaborator

⏸ SVD architect gate: dev/attention-mind-mcp#5 dd-469-attention-3-6-bounded-queries-and-ranking

Status: CLEAN after 1 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity substrate · dispatch effort high

Run: 20261115T112242Z-2d09e15e

Held because: CLEAN but 5 open risk(s) (5 verification) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. Real-provider evidence: run uv run python3 -m pytest -m transport -q on the PR head and in CI (ci/woodpecker/pr/validation). Confirm that test_http_release_fence_revocation (all parameters plus the control), test_http_full_page_wire_bounds, test_http_backward_clock_restart_preserves_floor_and_view_expiry, test_http_continuation_refusals, test_http_query_strict_decoding and test_http_query_tools_exact_schemas passed against the served subprocess. [verification]
  2. Several SDK assumptions are argued from the pinned sources but were not executed in Half-A, because the cp312 venv cannot run in the sandbox: serializer equivalence, a single start/body Response created after the tool returns, request-context propagation into the tool task, and uvicorn send suspending only before the write. Check that test_http_full_page_wire_bounds, test_boundary_release_after_serialization, test_release_handoff_bound and the release-fence control case all pass on the host and in CI at the final head. [verification]
  3. json_extract is mandatory with no fallback. Check that test_sqlite_json_functions_available passes in the python:3.12-slim-bookworm CI image (Debian bookworm ships SQLite 3.40) and on the host. [verification]
  4. The erasure fence is exercised only with a test control and the default live-items check. The real Forget-during-buffered-release race is #6/#8 evidence; record it as unsupported in the #5 completion comment. [verification]
  5. Logical byte fixtures and the stated O(item_count) synchronous ranking bound are not packaged memory, latency or concurrency budgets. Those are #8 measurements; record them as unsupported here. [verification]

Change: Mirror commands.py. The continuation token copies issue/authenticate_token (commands.py:63-140) with a distinct purpose_key("continuation"). Result and error documents use domain() (commands.py:150-161), and preconditions follow decide's order (commands.py:164-190). New queries.py provides project/eligible/rank, a scalar-only RANK_SQL scan plus a page-only payload fetch, an envelope-exact page budget, Obligation, ErasureFence/LiveItemsFence and recheck(). Every schema-valid unknown or incompatible continuation (forged, wrong-purpose, token queue or generation, actor, view, limit, position, mutation) returns view_changed, and expiry returns view_expired. service.py owns release_gate (an asyncio.Lock) and the private _erasure_fence control, and adds recheck(). Service.execute only buffers. The release happens in mcp_adapter.py: OperationTool.run executes under release_gate and registers an Obligation in a per-request RELEASE ContextVar slot. Boundary.call bounded_send holds the SDK's http.response.start and buffers the serialized body, fires store.checkpoint("before_release"), then under release_gate runs a read-only Service.recheck and hands off the original bytes or a content-free JSON-RPC refusal, bounded by RELEASE_HANDOFF_SECONDS. RAW*/envelope move to contract.py with an explicit X-as-X re-export. store.py and commands.py are not written: WriterGuard (store.py:59-72, cli.py:102) excludes administrative writers while serving, and every served writer enters through OperationTool.run.

Files: src/attention_mind_mcp/queries.py · src/attention_mind_mcp/service.py · src/attention_mind_mcp/contract.py · src/attention_mind_mcp/mcp_adapter.py · tests/test_queries.py · tests/test_commands.py · tests/test_foundation.py · README.md

Decision: accept the 5 open risk(s) above and dispatch this spec (svd:go), or park (svd:skip) / re-spec (svd:respec)?

Your call (when this issue is held at the gate via svd:hold):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-dd-469-attention-3-6-bounded-queries-and-ranking.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-dd-469-attention-3-6-bounded-queries-and-ranking.md

### ⏸ SVD architect gate: dev/attention-mind-mcp#5 dd-469-attention-3-6-bounded-queries-and-ranking **Status:** CLEAN after 1 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity `substrate` · dispatch effort `high` **Run:** `20261115T112242Z-2d09e15e` **Held because:** CLEAN but 5 open risk(s) (5 verification) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. Real-provider evidence: run `uv run python3 -m pytest -m transport -q` on the PR head and in CI (ci/woodpecker/pr/validation). Confirm that test_http_release_fence_revocation (all parameters plus the control), test_http_full_page_wire_bounds, test_http_backward_clock_restart_preserves_floor_and_view_expiry, test_http_continuation_refusals, test_http_query_strict_decoding and test_http_query_tools_exact_schemas passed against the served subprocess. [verification] 2. Several SDK assumptions are argued from the pinned sources but were not executed in Half-A, because the cp312 venv cannot run in the sandbox: serializer equivalence, a single start/body Response created after the tool returns, request-context propagation into the tool task, and uvicorn send suspending only before the write. Check that test_http_full_page_wire_bounds, test_boundary_release_after_serialization, test_release_handoff_bound and the release-fence control case all pass on the host and in CI at the final head. [verification] 3. json_extract is mandatory with no fallback. Check that test_sqlite_json_functions_available passes in the python:3.12-slim-bookworm CI image (Debian bookworm ships SQLite 3.40) and on the host. [verification] 4. The erasure fence is exercised only with a test control and the default live-items check. The real Forget-during-buffered-release race is #6/#8 evidence; record it as unsupported in the #5 completion comment. [verification] 5. Logical byte fixtures and the stated O(item_count) synchronous ranking bound are not packaged memory, latency or concurrency budgets. Those are #8 measurements; record them as unsupported here. [verification] **Change:** Mirror commands.py. The continuation token copies issue/authenticate_token (commands.py:63-140) with a distinct purpose_key("continuation"). Result and error documents use domain() (commands.py:150-161), and preconditions follow decide's order (commands.py:164-190). New queries.py provides project/eligible/rank, a scalar-only RANK_SQL scan plus a page-only payload fetch, an envelope-exact page budget, Obligation, ErasureFence/LiveItemsFence and recheck(). Every schema-valid unknown or incompatible continuation (forged, wrong-purpose, token queue or generation, actor, view, limit, position, mutation) returns view_changed, and expiry returns view_expired. service.py owns release_gate (an asyncio.Lock) and the private _erasure_fence control, and adds recheck(). Service.execute only buffers. The release happens in mcp_adapter.py: OperationTool.run executes under release_gate and registers an Obligation in a per-request RELEASE ContextVar slot. Boundary.__call__ bounded_send holds the SDK's http.response.start and buffers the serialized body, fires store._checkpoint("before_release"), then under release_gate runs a read-only Service.recheck and hands off the original bytes or a content-free JSON-RPC refusal, bounded by RELEASE_HANDOFF_SECONDS. RAW_*/envelope move to contract.py with an explicit X-as-X re-export. store.py and commands.py are not written: WriterGuard (store.py:59-72, cli.py:102) excludes administrative writers while serving, and every served writer enters through OperationTool.run. **Files:** `src/attention_mind_mcp/queries.py` · `src/attention_mind_mcp/service.py` · `src/attention_mind_mcp/contract.py` · `src/attention_mind_mcp/mcp_adapter.py` · `tests/test_queries.py` · `tests/test_commands.py` · `tests/test_foundation.py` · `README.md` **Decision:** accept the 5 open risk(s) above and dispatch this spec (`svd:go`), or park (`svd:skip`) / re-spec (`svd:respec`)? **Your call** (when this issue is held at the gate via `svd:hold`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-dd-469-attention-3-6-bounded-queries-and-ranking.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-dd-469-attention-3-6-bounded-queries-and-ranking.md`</sub>
Author
Member

Architect gate release by mind-spec@voyager under the operator’s explicit DD-469 grant to continue SVD/batch-SVD and merge T4.

Approved spec SHA-256: cb177b56e9f82a30791ed3cd25a97d470b5b9e17fb46f4dfe6e6d45ee34b1023, base 04b0704842de65cb47fb444a1eb97033299d68a4, Half-A 20261115T112242Z-2d09e15e. The revised spec resolves the prior architect HOLD. Automated verification returned zero blocking, degraded or inconclusive lenses; all 18 existing-file hashes and two create rows were independently checked. Dispatch preflight is ready.

Disposition of the five verification risks: risks 1–3 are required implementation/merge evidence (served transport, actual serializer/context/handoff and SQLite JSON support). They are accepted for implementation and must pass at the PR head before merge. Risks 4–5 are explicit scope limits: real Forget during buffered release remains unsupported until #6/#8; packaged memory, latency and concurrency budgets remain unsupported until #8. This release makes no claim that those later gates passed.

Applying svd:go records this approval; it does not override source drift, implementation tests or exact-head CI. mind-spec owns this single dispatch. No ADR or portable contract change is authorized. Refs #5; completion evidence and manual closure follow the reviewed green merge, while parent #1 remains open.

Architect gate release by mind-spec@voyager under the operator’s explicit DD-469 grant to continue SVD/batch-SVD and merge T4. Approved spec SHA-256: `cb177b56e9f82a30791ed3cd25a97d470b5b9e17fb46f4dfe6e6d45ee34b1023`, base `04b0704842de65cb47fb444a1eb97033299d68a4`, Half-A `20261115T112242Z-2d09e15e`. The revised spec resolves the prior architect HOLD. Automated verification returned zero blocking, degraded or inconclusive lenses; all 18 existing-file hashes and two create rows were independently checked. Dispatch preflight is ready. Disposition of the five verification risks: risks 1–3 are required implementation/merge evidence (served transport, actual serializer/context/handoff and SQLite JSON support). They are accepted for implementation and must pass at the PR head before merge. Risks 4–5 are explicit scope limits: real Forget during buffered release remains unsupported until #6/#8; packaged memory, latency and concurrency budgets remain unsupported until #8. This release makes no claim that those later gates passed. Applying `svd:go` records this approval; it does not override source drift, implementation tests or exact-head CI. mind-spec owns this single dispatch. No ADR or portable contract change is authorized. `Refs #5`; completion evidence and manual closure follow the reviewed green merge, while parent #1 remains open.
Collaborator

spec-verify-dispatch Half B for dev/attention-mind-mcp#5 dd-469-attention-3-6-bounded-queries-and-ranking completed integration verify.

  • PR: #12
  • Branch: feat/svd-dev-attention-mind-mcp-5-dd-469-attention-3-6-bounde-96e56214
  • Commit: 3e976d8d6d
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/76/pipeline/6/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261115T121156Z-96e56214 --confirm-merge)
spec-verify-dispatch Half B for dev/attention-mind-mcp#5 dd-469-attention-3-6-bounded-queries-and-ranking completed integration verify. - PR: https://git.groupthink.asia/dev/attention-mind-mcp/pulls/12 - Branch: feat/svd-dev-attention-mind-mcp-5-dd-469-attention-3-6-bounde-96e56214 - Commit: 3e976d8d6dddc284de8a47a4cf7a63c080d10b2e - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/76/pipeline/6/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261115T121156Z-96e56214 --confirm-merge`)
Author
Member

Completed through PR #12, merged to main at dfcec304d08a14f3734669cef17bafe2bd4a3878 from reviewed head 3e976d8d6dddc284de8a47a4cf7a63c080d10b2e. Exact-head CI and independent SVD integration passed. Full review and evidence: #12 (comment) .

Passed: bounded list/get/explain, ranking, frozen authenticated continuations, logical/wire size limits, served authority and erasure release fencing; 336 unit and 58 HTTP/MCP tests, lint/type checks and package build. Unsupported in this slice: the real Forget-during-buffered-release race (#6/#8) and packaged latency/memory/concurrency budgets (#8). No S3 recovery, delivery, deployment or full-provider conformance is certified. Parent #1 stays open.

Completed through PR #12, merged to main at `dfcec304d08a14f3734669cef17bafe2bd4a3878` from reviewed head `3e976d8d6dddc284de8a47a4cf7a63c080d10b2e`. Exact-head CI and independent SVD integration passed. Full review and evidence: https://git.groupthink.asia/dev/attention-mind-mcp/pulls/12#issuecomment-40272 . Passed: bounded list/get/explain, ranking, frozen authenticated continuations, logical/wire size limits, served authority and erasure release fencing; 336 unit and 58 HTTP/MCP tests, lint/type checks and package build. **Unsupported in this slice:** the real Forget-during-buffered-release race (#6/#8) and packaged latency/memory/concurrency budgets (#8). No S3 recovery, delivery, deployment or full-provider conformance is certified. Parent #1 stays open.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/attention-mind-mcp#5
No description provided.