Skip to content

session_start static project token regression evidence

Task: 7e828ac9-518d-4e10-8571-e8fc37cb18cb, frozen version 3. Execution: 1dc18beb-8ec2-4251-a18e-c47311cdfa02. Repository: h8v6/heyaira; branch: heyaira/7e828ac9. Source and starting HEAD: 3b43116cba6ac57851d2e0a704a4b623382e76fb (parent 57dd982ee650035d9f4d0c7023561fe0555b9430). Initial worktree was clean. All commands ran in the supplied 7e828ac9-worker worktree on 2026-10-11. No subagents were used. No installation, publication or deployment was performed.

Cause: static project tokens have exactly LEGACY_SCOPES, which omits documents:read. The extra check prevented interactive onboarding. The fix retains memory:read enforcement and execution-token rejection. Account instruction access for interactive memory:read holders is the explicit coordinator decision in the frozen task. Confidence is high from the reproduced assertion and real PostgreSQL checks.

The session suite removes the shared dispatch fixture's instance override of require_actor, checks that the bound method is Runtime.require_actor, and sets synthetic MCP AuthenticatedUser / AccessToken context. Production authentication-context parsing and scope enforcement run for every session test. Git responses remain synthetic; PostgreSQL, handlers and instruction resolution are real. Neither LEGACY_SCOPES nor other tools' scopes changed.

K1

criterion_id: K1 outcome: pass evidence_path: docs/reports/7e828ac9-session-start-scopes.md feedback: The new LEGACY_SCOPES regression fails by assertion against 3b43116 and passes with the fix; both runs use real scope enforcement and disposable PostgreSQL databases.

Command (both implementations):

TMPDIR="$PWD/.bridge-test-tmp" python scripts/test_postgres.py tests/test_session_start.py::test_static_project_token_legacy_scopes_get_layers -p no:cacheprovider

Base run before any server changes, HEAD 3b43116, new regression overlaid: exit 1, 1 failed in 3.56s.

The finalized test was also rerun with the exact base server.py bytes from git show 3b43116cba6ac57851d2e0a704a4b623382e76fb:src/heyaira/server.py. A Python subprocess wrapper saved the fixed bytes in memory, wrote the base bytes, ran the command above, and restored the fix in finally; Git history and branch were never changed. Exit 1, actual output excerpt:

E           AssertionError: LEGACY_SCOPES must allow session_start: Error executing tool session_start: insufficient_scope: documents:read
tests/test_session_start.py:79: AssertionError
FAILED tests/test_session_start.py::test_static_project_token_legacy_scopes_get_layers
1 failed in 2.38s
base_regression_exit=1

Fixed candidate tree run, exit 0:

.                                                                        [100%]
1 passed in 1.93s
postgres_acceptance=passed: selected tests, zero skipped tests

The test checks the exact LEGACY_SCOPES set, absence of documents:read, all five account layers and their content, and project instruction references.

K2

criterion_id: K2 outcome: pass evidence_path: docs/reports/7e828ac9-session-start-scopes.md feedback: Real PostgreSQL session_start suite passes with zero skips; missing memory:read is rejected and a memory:read execution actor is refused before resolving sources.

Command on the fixed candidate tree:

TMPDIR="$PWD/.bridge-test-tmp" python scripts/test_postgres.py tests/test_session_start.py -p no:cacheprovider

Exit 0, actual output:

.............                                                            [100%]
13 passed in 6.30s
postgres_acceptance=passed: selected tests, zero skipped tests

This includes test_missing_memory_read_refused, test_memory_read_alone_gets_account_instructions, and test_execution_and_unknown_role_refused. The negative cases assert insufficient_scope: memory:read and session_start_requires_interactive_session, and zero Git reads.

An earlier suite run exited 1: 10 failed, 3 passed in 6.46s. Its default synthetic actor inherited dispatch-only scopes without memory:read; production enforcement exposed the fixture error. Default onboarding authentication was corrected to LEGACY_SCOPES before the passing run above.

K3

criterion_id: K3 outcome: pass evidence_path: docs/reports/7e828ac9-session-start-scopes.md feedback: Runtime description, generated contract and reference/startup docs specify memory:read and account-instruction access; live contract and docs checks pass.

python scripts/export_mcp_contract.py exited 0: wrote contracts/mcp-tools.json.

Command on the fixed candidate tree:

PYTHONPATH=src python -m pytest tests/test_mcp_runtime_contract.py tests/test_docs_contract.py -q -p no:cacheprovider

Exit 0, actual output:

...........................                                              [100%]
27 passed in 2.39s

The targeted runtime-contract regression checks the sole required scope, the live/generated description match, the explicit account-instruction access sentence and execution rejection. The reference permissions row and startup document no longer require documents:read for session_start.

K4

criterion_id: K4 outcome: pass evidence_path: docs/reports/7e828ac9-session-start-scopes.md feedback: All intended paths are within the frozen scope; starting HEAD is the base and the new commit preserves it as its parent. Post-commit SHAs and exact HEAD checks are recorded in RESULT.

Git executable used after initial launcher diagnostics: /Library/Developer/CommandLineTools/usr/bin/git.

git diff --check exited 0, no output. git merge-base --is-ancestor 3b43116 HEAD exited 0, no output. git diff 3b43116 --stat before adding this evidence file exited 0: 6 files changed, 92 insertions(+), 8 deletions(-). git diff --name-only 3b43116 exited 0 with these paths; this evidence file is the seventh intended path:

contracts/mcp-tools.json
docs/agents/start-here.md
docs/reference/mcp-tools.md
docs/reports/7e828ac9-session-start-scopes.md
src/heyaira/server.py
tests/test_mcp_runtime_contract.py
tests/test_session_start.py

No carried history was amended, rebased or reset. RESULT records the final git diff --name-only 3b43116cba6ac57851d2e0a704a4b623382e76fb..HEAD, ancestor check, result SHA, parent and clean status after commit.

Execution limitations and checks not run

The initial /usr/bin/git launcher attempted an unwritable xcrun cache and Xcode event stream; the slow command sequence was interrupted (exit 130). The prepared CommandLineTools Git binary completed all required Git checks. Git also warned that the global ignore file was unreadable; worktree status and scoped diff checks completed normally. Two attempts to launch the extra base rerun with a zsh here-document exited 1 before Python ran: can't create temp file for here document: operation not permitted. The Python -c subprocess wrapper then completed the base rerun successfully (expected failing assertion, exit 1). The PostgreSQL harness used workspace-local TMPDIR and the already configured local test database; no DSN or credential is printed or committed. No required criterion check remains unrun. The entire repository test suite and independent verification were not run by this worker; Bridge owns the independent verification step.