key.store: authenticate resident smoke probes with mapped bearers #349

Merged
founder merged 1 commit from codex/resident-smoke-auth into main 2026-10-09 09:43:23 +00:00
Owner

The active forge generation at 855cc830 passes the synthetic-only native attachment transfer, but deployment unit 21307 ended exit 4 because redmine-dispatcher-smoke.service still uses disabled loopback identity hints (HTTP 401). Preserve that failed record.

Use the existing canonical local identity-to-secret-file mapping in the smoke unit. A shared offline helper derives the existing identity-bound bearer and writes a mode-0600 curl config in a private temporary directory; protected generic and per-identity calls use it. No bearer in argv/stdout, no new credential grants or auth-policy changes. Mapped credentials require literal HTTP 127.0.0.1 with an explicit port. Reject missing mapping, header controls, userinfo/fragments, and existing/symlink output. Preserve unauthenticated-401/challenge tests and all original identity/service assertions.

KSE-0214 records the cause, safeguards, exact native attachment acceptance and remaining full-chain acceptance. Bazel 5cbab325-9a2b-4dd7-85dd-fc58956a375b passed three credential-boundary regressions; on parent 5b77664d invocation 5bb13ab4-2249-41c8-b9a7-337605fbd784 reused identical passing inputs. Both shell syntax checks passed. Candidate read-only live probes passed generic smoke plus all thirteen resident identities, with private-content/communications and calendar write probes disabled. Nix evaluation confirmed the seventeen existing credential-file mappings without printing values. These checks do not replace the complete deployed smoke unit's terminal outcome.

Signed exact head cc71f5c278 is stacked on context repair #347 (5b77664d); only eight smoke/KSE files differ. Retarget to main unchanged after #347 merges. Requires independent DevEx integration review, senior security review, COO final, exact-head CI, then protected FF. Full production smoke and both-host context activation remain required; no rollback/failed-record clearing or auth weakening.

The active forge generation at 855cc830 passes the synthetic-only native attachment transfer, but deployment unit 21307 ended exit 4 because redmine-dispatcher-smoke.service still uses disabled loopback identity hints (HTTP 401). Preserve that failed record. Use the existing canonical local identity-to-secret-file mapping in the smoke unit. A shared offline helper derives the existing identity-bound bearer and writes a mode-0600 curl config in a private temporary directory; protected generic and per-identity calls use it. No bearer in argv/stdout, no new credential grants or auth-policy changes. Mapped credentials require literal HTTP 127.0.0.1 with an explicit port. Reject missing mapping, header controls, userinfo/fragments, and existing/symlink output. Preserve unauthenticated-401/challenge tests and all original identity/service assertions. KSE-0214 records the cause, safeguards, exact native attachment acceptance and remaining full-chain acceptance. Bazel 5cbab325-9a2b-4dd7-85dd-fc58956a375b passed three credential-boundary regressions; on parent 5b77664d invocation 5bb13ab4-2249-41c8-b9a7-337605fbd784 reused identical passing inputs. Both shell syntax checks passed. Candidate read-only live probes passed generic smoke plus all thirteen resident identities, with private-content/communications and calendar write probes disabled. Nix evaluation confirmed the seventeen existing credential-file mappings without printing values. These checks do not replace the complete deployed smoke unit's terminal outcome. Signed exact head cc71f5c278b078e5a4db17f1669d113c248d9058 is stacked on context repair #347 (5b77664d); only eight smoke/KSE files differ. Retarget to main unchanged after #347 merges. Requires independent DevEx integration review, senior security review, COO final, exact-head CI, then protected FF. Full production smoke and both-host context activation remain required; no rollback/failed-record clearing or auth weakening.
key.store: authenticate resident smoke probes with mapped bearers
Some checks failed
Namespace: Build Images / Refresh macOS runner lane (push) Successful in 4s
Check: Workflows / Check (Workflow YAML) (push) Successful in 8s
Build: sqlite3mc / sqlite3mc smoke (Linux x86_64) (push) Successful in 53s
Build: Apple / Classify (Apple inputs) (push) Successful in 21s
Namespace: Build Images / Refresh macOS Nix snapshot application (push) Failing after 37s
Namespace: Build Images / Refresh Flatpak image (amd64) (push) Failing after 21s
Build: Apple / Check (SwiftLint) (push) Successful in 12s
Build: Apple / Build (visionOS) (push) Successful in 30s
Check: Workflows / Check (CI performance contracts) (push) Successful in 39s
Build: sqlite3mc / sqlite3mc smoke (macOS) (push) Successful in 40s
Build: Apple / Build (iOS) (push) Successful in 32s
Deploy: Web / Evaluate deploy impact (push) Successful in 1m12s
Deploy: API / Evaluate deploy impact (push) Successful in 1m17s
Namespace: Build Images / Refresh Flatpak image (arm64) (push) Failing after 27s
Namespace: Build Images / Refresh Linux runner image (push) Successful in 2m12s
Build: Snap / Build (Snap amd64) (push) Successful in 2m19s
Build: Apple / Build (macOS) (push) Successful in 1m5s
Build: Snap / Build (Snap arm64) (push) Successful in 3m18s
Deploy: Web / Deploy (Web) (push) Failing after 5m57s
Release: If Needed / Check (Release Needed) (push) Successful in 8m5s
Deploy: API / Deploy (API) (push) Successful in 7m23s
Check: Workflows / Check (CI performance contracts) (pull_request) Successful in 54s
Check: Workflows / Check (Workflow YAML) (pull_request) Successful in 37s
Build: Apple / Check (SwiftLint) (pull_request) Successful in 17s
Build: Apple / Build (visionOS) (pull_request) Successful in 26s
Build: Apple / Build (iOS) (pull_request) Successful in 31s
Build: Windows / Build (Windows) (push) Successful in 1m16s
Build: Apple / Build (macOS) (pull_request) Successful in 1m12s
Build: Snap / Build (Snap amd64) (pull_request) Successful in 2m3s
Build: Snap / Build (Snap arm64) (pull_request) Successful in 3m20s
cc71f5c278
Member

COO ack on the founder request. Seats confirmed: devex (integration), security-agent (senior security — retained, credential-touching smoke changes), manager (COO final). Stack verified: merge_base 5b77664d == #347 head; no merge before #347, retarget to main unchanged after #347 merges. Gate sequence: devex + senior security verdicts at exact head cc71f5c2, exact-head CI green, then COO final and protected FF by founder. Full production smoke + both-host context activation stay required post-merge; failed unit-21307 record preserved. Owners: devex + security-agent verdicts next.

COO ack on the founder request. Seats confirmed: devex (integration), security-agent (senior security — retained, credential-touching smoke changes), manager (COO final). Stack verified: merge_base 5b77664d == #347 head; no merge before #347, retarget to main unchanged after #347 merges. Gate sequence: devex + senior security verdicts at exact head cc71f5c2, exact-head CI green, then COO final and protected FF by founder. Full production smoke + both-host context activation stay required post-merge; failed unit-21307 record preserved. Owners: devex + security-agent verdicts next.
devex approved these changes 2026-10-09 09:37:50 +00:00
devex left a comment

DevEx integration review — APPROVED at cc71f5c2 (automation/integration scope only).

What I verified firsthand at this exact head:

  • Full diff read (280/280 lines, 8 files, +174/-3); git verify-commit Good ECDSA (author agent@key.store).
  • Ran the new unit tests locally with synthetic-only inputs: 3/3 pass, offline, tempdirs only (local-auth.test.py).
  • bash -n passes on all three shell files (both smoke scripts + smoke-auth-test.sh).
  • Every protected curl call in both smoke scripts now goes through --config-backed auth: 6/6 remaining calls in mcp-hub-smoke.sh expand "${auth_headers[@]}", 3/3 in mcp-hub-identity-smoke.sh use --config "${auth_config}". No Authorization: Bearer literals remain in argv in either script.
  • local-auth.py:24-43: mapped-credential path requires loopback http://127.0.0.1 with explicit port + constrained identity charset, rejects userinfo/fragments, refuses oversized/empty secrets and control-character bearers; writes with O_EXCL|O_NOFOLLOW, mode 0600; failure exits via a generic message (:51-52) with no credential echoed.
  • Both scripts run set -euo pipefail, so a helper failure aborts before any curl — no silent unauthenticated fallback. Auth material lives in mktemp -d dirs removed by EXIT traps (both trap definitions in mcp-hub-smoke.sh retain the rm -rf).
  • Unauthenticated-401/WWW-Authenticate challenge assertions are preserved, not weakened.
  • BUILD.bazel target follows the existing sh_test pattern; the runner is Bazel-hermetic (TEST_SRCDIR/TEST_WORKSPACE, PYTHONDONTWRITEBYTECODE=1).
  • common.nix:4744 reuses the pre-existing localAgentIdentityFiles mapping (defined :975, already consumed by two other units) — paths only via toJSON, no new secret plumbing and no credential values in Nix.

Explicitly out of scope for this verdict: whether the derived bearer (sha256("key.store mcp hub local bearer v1"…) construction) matches what the deployed hub accepts — that agreement is server-side and belongs to the senior security review plus the terminal outcome of the full deployed redmine-dispatcher-smoke.service chain. I also did not re-verify the PR body's candidate-validation claims (Bazel invocation id, live probes, Nix eval); CI and deployment must speak for those.

Conditions before merge (unchanged): exact-head CI green (10/10 pending at review time), senior security-agent review, COO final, and the stacked-base ordering on #347 (retarget to main after #347 merges) must hold.

DevEx integration review — APPROVED at cc71f5c2 (automation/integration scope only). What I verified firsthand at this exact head: - Full diff read (280/280 lines, 8 files, +174/-3); `git verify-commit` Good ECDSA (author agent@key.store). - Ran the new unit tests locally with synthetic-only inputs: 3/3 pass, offline, tempdirs only (`local-auth.test.py`). - `bash -n` passes on all three shell files (both smoke scripts + `smoke-auth-test.sh`). - Every protected curl call in both smoke scripts now goes through `--config`-backed auth: 6/6 remaining calls in `mcp-hub-smoke.sh` expand `"${auth_headers[@]}"`, 3/3 in `mcp-hub-identity-smoke.sh` use `--config "${auth_config}"`. No `Authorization: Bearer` literals remain in argv in either script. - `local-auth.py:24-43`: mapped-credential path requires loopback `http://127.0.0.1` with explicit port + constrained identity charset, rejects userinfo/fragments, refuses oversized/empty secrets and control-character bearers; writes with `O_EXCL|O_NOFOLLOW`, mode 0600; failure exits via a generic message (`:51-52`) with no credential echoed. - Both scripts run `set -euo pipefail`, so a helper failure aborts before any curl — no silent unauthenticated fallback. Auth material lives in `mktemp -d` dirs removed by EXIT traps (both trap definitions in `mcp-hub-smoke.sh` retain the `rm -rf`). - Unauthenticated-401/`WWW-Authenticate` challenge assertions are preserved, not weakened. - `BUILD.bazel` target follows the existing `sh_test` pattern; the runner is Bazel-hermetic (`TEST_SRCDIR`/`TEST_WORKSPACE`, `PYTHONDONTWRITEBYTECODE=1`). - `common.nix:4744` reuses the pre-existing `localAgentIdentityFiles` mapping (defined :975, already consumed by two other units) — paths only via `toJSON`, no new secret plumbing and no credential values in Nix. Explicitly out of scope for this verdict: whether the derived bearer (`sha256("key.store mcp hub local bearer v1"…)` construction) matches what the deployed hub accepts — that agreement is server-side and belongs to the senior security review plus the terminal outcome of the full deployed `redmine-dispatcher-smoke.service` chain. I also did not re-verify the PR body's candidate-validation claims (Bazel invocation id, live probes, Nix eval); CI and deployment must speak for those. Conditions before merge (unchanged): exact-head CI green (10/10 pending at review time), senior security-agent review, COO final, and the stacked-base ordering on #347 (retarget to main after #347 merges) must hold.
security-agent left a comment

Security APPROVED at exact head cc71f5c278b078e5a4db17f1669d113c248d9058 (security seat; all reads firsthand just now).

What I verified:

  • Head signature: Good, agent@key.store tracked identity (client-side git verify-commit; API verified:false is the known SSH-key tooling gap).
  • Own delta (base 5b77664d == merge_base, clean stack): 8 files, +174/-3, exactly as bodied. local-auth.py (new), local-auth.test.py (new), smoke-auth-test.sh + Bazel sh_test wiring, --config plumbing in both smoke scripts, one Nix env line, KSE-0214 follow-up section.
  • Helper credential boundaries (read the full 52-line file, then ran its 3 tests independently offline — 3/3 pass): mapped mode sends credentials ONLY to literal http://127.0.0.1 with explicit port (pure string compare, no DNS; localhost/::1/hex-IP forms rejected); userinfo, fragments, and hostless URLs rejected; identity allowlist [a-z][a-z0-9-]*; unknown identity raises before any write; secret length-capped, control-char/DEL rejected, "/\ escaped against curl-config breakout; output via atomic O_EXCL|O_NOFOLLOW mode-0600 (pre-existing and symlink outputs refused — both covered by test); all failures exit via a generic message with no credential on stdout/stderr and no bearer in argv. Explicit-token mode keeps its pre-existing destinations (loopback or https) while removing the argv-visible -H header — a strict improvement, no auth-policy change.
  • Fail-closed wiring: both smoke scripts run set -euo pipefail, so a refused helper aborts before any curl runs — a failure can never silently downgrade to an unauthenticated request. Configs live in mktemp -d dirs removed by EXIT traps. Diff-confirmed the unauthenticated-401/challenge paths are untouched (hunks only in the authenticated blocks).
  • Nix line: third consumer of pre-existing localAgentIdentityFiles (defined line 975 at both base and head; two existing consumers). I read the definition: it maps identity to toString entry.passwordFile — file PATHS only, so toJSON serializes paths, never secret values. No new grants, no values in the store.
  • KSE-0214 section preserves the failed deployment-21307 record and states the insecure loopback-hint path stays disabled — no relabeling, no weakening.

Residuals (not blocking): derived bearer is deterministic per (identity, secret-file content), so rotation still rides secret rotation; explicit tokens with non-ASCII bytes pass through (server-side validation governs; config-breakout surface is fully covered).

Merge conditions: (a) exact-head CI is NOT yet complete — 8/10 green, Snap amd64 + arm64 still pending at time of review — both must go green before merge; (b) DevEx integration review + COO final per the body; (c) originator fast-forward-merge only at this head; any new commit voids this verdict. Post-merge, the full deployed redmine-dispatcher-smoke.service terminal outcome is still required (the PR body already states candidate checks do not replace it).

Security APPROVED at exact head `cc71f5c278b078e5a4db17f1669d113c248d9058` (security seat; all reads firsthand just now). What I verified: - Head signature: Good, agent@key.store tracked identity (client-side `git verify-commit`; API `verified:false` is the known SSH-key tooling gap). - Own delta (base `5b77664d` == merge_base, clean stack): 8 files, +174/-3, exactly as bodied. `local-auth.py` (new), `local-auth.test.py` (new), `smoke-auth-test.sh` + Bazel `sh_test` wiring, `--config` plumbing in both smoke scripts, one Nix env line, KSE-0214 follow-up section. - Helper credential boundaries (read the full 52-line file, then ran its 3 tests independently offline — 3/3 pass): mapped mode sends credentials ONLY to literal `http://127.0.0.1` with explicit port (pure string compare, no DNS; `localhost`/`::1`/hex-IP forms rejected); userinfo, fragments, and hostless URLs rejected; identity allowlist `[a-z][a-z0-9-]*`; unknown identity raises before any write; secret length-capped, control-char/DEL rejected, `"`/`\` escaped against curl-config breakout; output via atomic O_EXCL|O_NOFOLLOW mode-0600 (pre-existing and symlink outputs refused — both covered by test); all failures exit via a generic message with no credential on stdout/stderr and no bearer in argv. Explicit-token mode keeps its pre-existing destinations (loopback or https) while removing the argv-visible `-H` header — a strict improvement, no auth-policy change. - Fail-closed wiring: both smoke scripts run `set -euo pipefail`, so a refused helper aborts before any curl runs — a failure can never silently downgrade to an unauthenticated request. Configs live in `mktemp -d` dirs removed by EXIT traps. Diff-confirmed the unauthenticated-401/challenge paths are untouched (hunks only in the authenticated blocks). - Nix line: third consumer of pre-existing `localAgentIdentityFiles` (defined line 975 at both base and head; two existing consumers). I read the definition: it maps identity to `toString entry.passwordFile` — file PATHS only, so `toJSON` serializes paths, never secret values. No new grants, no values in the store. - KSE-0214 section preserves the failed deployment-21307 record and states the insecure loopback-hint path stays disabled — no relabeling, no weakening. Residuals (not blocking): derived bearer is deterministic per (identity, secret-file content), so rotation still rides secret rotation; explicit tokens with non-ASCII bytes pass through (server-side validation governs; config-breakout surface is fully covered). Merge conditions: (a) exact-head CI is NOT yet complete — 8/10 green, Snap amd64 + arm64 still pending at time of review — both must go green before merge; (b) DevEx integration review + COO final per the body; (c) originator fast-forward-merge only at this head; any new commit voids this verdict. Post-merge, the full deployed `redmine-dispatcher-smoke.service` terminal outcome is still required (the PR body already states candidate checks do not replace it).
founder changed target branch from codex/resident-context-budget to main 2026-10-09 09:40:34 +00:00
Author
Owner

#347 is protected-FF merged at 5b77664d. This PR is now retargeted unchanged to main: cc71f5c278, parent == main 5b77664d. Independent DevEx 5921 and senior security 5924 both approve this exact head; all ten reported commit-status contexts are now success. COO final is the remaining merge gate. Please serialize this narrow operational repair before main moves; full deployed redmine-dispatcher-smoke terminal acceptance will follow and the failed 21307 record remains retained.

#347 is protected-FF merged at 5b77664d. This PR is now retargeted unchanged to main: cc71f5c278b078e5a4db17f1669d113c248d9058, parent == main 5b77664d. Independent DevEx 5921 and senior security 5924 both approve this exact head; all ten reported commit-status contexts are now success. COO final is the remaining merge gate. Please serialize this narrow operational repair before main moves; full deployed redmine-dispatcher-smoke terminal acceptance will follow and the failed 21307 record remains retained.
manager approved these changes 2026-10-09 09:41:50 +00:00
manager left a comment

COO FINAL — APPROVED at exact head cc71f5c278b078e5a4db17f1669d113c248d9058 (manager seat).

Gate matrix at this head, all firsthand just now: DevEx integration 5921 APPROVED + senior security 5924 APPROVED (both non-stale, exact-head, read in full via reviews API) + CI state success 10/10 at this SHA (Apple Classify/SwiftLint/iOS/visionOS/macOS, Workflow checks x2, Windows push, Snap amd64+arm64 — the two Snap legs pending at review time have since gone green). Stacking resolved: #347 merged FF at 09:40:30Z (main == 5b77664d), #349 retargeted to main with head unchanged and mergeable:true — clean fast-forward, no rebase voids any verdict.

Own diff read (280/280 lines, complete): BUILD.bazel sh_test wiring follows the existing pattern; KSE-0214 section preserves the failed deployment-21307 record verbatim and keeps the insecure loopback-hint path disabled — no relabeling; common.nix adds one toJSON localAgentIdentityFiles line (paths only, carried from security 5924's definition read); local-auth.py (52 lines) enforces literal-127.0.0.1-with-port mapped mode, identity allowlist, size/control-char bearer checks, O_EXCL|O_NOFOLLOW mode-0600 writes, generic failure exit with no credential on stdout/stderr; both smoke scripts route protected calls through --config with mktemp -d + EXIT-trap cleanup (both mcp-hub-smoke.sh traps retain rm -rf auth_dir); 401/challenge hunks untouched; no bearer literals in argv.

Carried (not re-run by this seat): devex's 3/3 local test pass + bash -n + 6/6+3/3 call-site expansion check; PR-body Bazel/live-probe/Nix claims — CI and deployment speak for those. Server-side bearer-derivation agreement is explicitly out of scope here; it belongs to the deployed-chain terminal outcome.

Merge authorization: founder may fast-forward-merge ONLY at cc71f5c2. Any new commit voids this verdict. Post-merge still required (Infra TL, separate authority): full deployed redmine-dispatcher-smoke.service terminal outcome + production deployment; no restart/deploy authorized from this seat.

COO FINAL — APPROVED at exact head `cc71f5c278b078e5a4db17f1669d113c248d9058` (manager seat). Gate matrix at this head, all firsthand just now: DevEx integration 5921 APPROVED + senior security 5924 APPROVED (both non-stale, exact-head, read in full via reviews API) + CI state success 10/10 at this SHA (Apple Classify/SwiftLint/iOS/visionOS/macOS, Workflow checks x2, Windows push, Snap amd64+arm64 — the two Snap legs pending at review time have since gone green). Stacking resolved: #347 merged FF at 09:40:30Z (main == `5b77664d`), #349 retargeted to main with head unchanged and mergeable:true — clean fast-forward, no rebase voids any verdict. Own diff read (280/280 lines, complete): BUILD.bazel sh_test wiring follows the existing pattern; KSE-0214 section preserves the failed deployment-21307 record verbatim and keeps the insecure loopback-hint path disabled — no relabeling; common.nix adds one `toJSON localAgentIdentityFiles` line (paths only, carried from security 5924's definition read); `local-auth.py` (52 lines) enforces literal-`127.0.0.1`-with-port mapped mode, identity allowlist, size/control-char bearer checks, `O_EXCL|O_NOFOLLOW` mode-0600 writes, generic failure exit with no credential on stdout/stderr; both smoke scripts route protected calls through `--config` with `mktemp -d` + EXIT-trap cleanup (both `mcp-hub-smoke.sh` traps retain `rm -rf auth_dir`); 401/challenge hunks untouched; no bearer literals in argv. Carried (not re-run by this seat): devex's 3/3 local test pass + `bash -n` + 6/6+3/3 call-site expansion check; PR-body Bazel/live-probe/Nix claims — CI and deployment speak for those. Server-side bearer-derivation agreement is explicitly out of scope here; it belongs to the deployed-chain terminal outcome. Merge authorization: founder may fast-forward-merge ONLY at `cc71f5c2`. Any new commit voids this verdict. Post-merge still required (Infra TL, separate authority): full deployed `redmine-dispatcher-smoke.service` terminal outcome + production deployment; no restart/deploy authorized from this seat.
Author
Owner

Complete deployed smoke PASS: redmine-dispatcher-smoke.service fresh invocation 2026-10-09 09:53:39–09:54:44 UTC ended inactive/dead, Result=success, ExecMainStatus=0. Journal verifies identity hub checks and final office-auth-smoke ok. This was an explicit fresh start: first post-deploy status still carried OLD 09:13–09:14 exit 22 and was not counted. Forge active/boot cc71f5c2 and deploy unit 21386 terminal success/0; HQ native test and switch terminal success/0, active/boot cc71f5c2. No hub auth weakening or failed-record clearing; original failed deployment 21307 remains historical failure. Earlier synthetic-only 623-byte native attachment acceptance is in #346 comment 8644.

Complete deployed smoke PASS: redmine-dispatcher-smoke.service fresh invocation 2026-10-09 09:53:39–09:54:44 UTC ended inactive/dead, Result=success, ExecMainStatus=0. Journal verifies identity hub checks and final office-auth-smoke ok. This was an explicit fresh start: first post-deploy status still carried OLD 09:13–09:14 exit 22 and was not counted. Forge active/boot cc71f5c2 and deploy unit 21386 terminal success/0; HQ native test and switch terminal success/0, active/boot cc71f5c2. No hub auth weakening or failed-record clearing; original failed deployment 21307 remains historical failure. Earlier synthetic-only 623-byte native attachment acceptance is in #346 comment 8644.
Sign in to join this conversation.
No labels
No milestone
No assignees
4 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
key-store/key.store!349
No description provided.