feat(runtime): current-upstream shared auth and result-metadata convergence - #5
feat(runtime): current-upstream shared auth and result-metadata convergence#5cermm wants to merge 53 commits into
Conversation
Co-authored-by: Hermes Agent <hermes-agent@local>
Co-authored-by: Hermes Agent <hermes-agent@local>
Co-authored-by: Hermes Agent <hermes-agent@local>
…e-380-shared-auth-authority
…runtime candidate
…runtime candidate
…runtime candidate
…frozen upstream
# Conflicts: # ui-tui/src/__tests__/bundleNoAsyncEsmDeadlock.test.ts # ui-tui/src/__tests__/cursorDriftRegression.test.ts # ui-tui/src/__tests__/statusRule.test.ts # ui-tui/src/__tests__/virtualHeights.test.ts # website/package.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7fa5fdf27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _merge_section(merged, source, "providers", conflict_policy) | ||
| _merge_section(merged, source, "credential_pool", conflict_policy) |
There was a problem hiding this comment.
Preserve suppression state during shared migration
When a legacy profile has suppressed_sources entries, such as an env:OPENROUTER_API_KEY source the user explicitly removed, apply_shared_migration() copies only providers and credential_pool. After the profile switches to shared authority, the suppression is absent from the selected store, so load_pool() can reactivate that credential from the environment. Migrate or explicitly resolve conflicts for this top-level auth control state rather than silently undoing credential removals.
AGENTS.md reference: AGENTS.md:L84-L87
Useful? React with 👍 / 👎.
| locked_paths = sorted( | ||
| {*paths, *(home / "config.yaml" for home in homes)}, | ||
| key=lambda path: os.fsencode(str(path.resolve(strict=False))), | ||
| ) | ||
| with _auth_transition_lock(), _auth_store_locks( | ||
| locked_paths, transaction_target=target |
There was a problem hiding this comment.
Coordinate config writers during auth migration
Adding each config.yaml to _auth_store_locks() only acquires the derived config.lock, but normal writers such as save_config_value() and the dashboard config endpoints do not use that lock. If one writes after the dry-run precondition check, either migration can overwrite the concurrent setting or the concurrent stale write can remove auth.authority: shared; the journal may then record that unintended file as the committed postcondition. Use synchronization shared by all config writers or revalidate the intended config bytes before committing.
AGENTS.md reference: AGENTS.md:L84-L87
Useful? React with 👍 / 👎.
| if auth_src.is_file() and not _too_large(auth_src, "auth authority"): | ||
| encrypted_result = _encrypt_auth( | ||
| auth_src.read_bytes(), | ||
| auth_passphrase, | ||
| ) | ||
| if encrypted_result is not None: |
There was a problem hiding this comment.
Reject quick snapshots when requested auth is omitted
With --quick --auth-mode include-encrypted, a missing or oversized authority leaves encrypted_result as None, and encryption/read failures are merely logged below. The function still writes a manifest with no auth authority, returns a snapshot ID, and the CLI reports that the snapshot was created successfully. An operator can therefore rely on an explicitly requested credential backup that cannot restore credentials; fail the snapshot and remove the partial directory instead.
AGENTS.md reference: AGENTS.md:L84-L87
Useful? React with 👍 / 👎.
| if ( | ||
| getattr(cli, "result_meta_file", None) | ||
| or getattr(cli, "result_meta_fd", None) is not None | ||
| ): | ||
| cli._publish_result_metadata(result) |
There was a problem hiding this comment.
Publish interruption metadata on KeyboardInterrupt
Metadata is published only after run_conversation() returns normally, while the immediately preceding KeyboardInterrupt branch exits with code 130. If a parent requests either metadata transport and interrupts an in-flight query, it receives an absent sidecar or FIFO EOF rather than the schema's interrupted: true result, preventing consumers from distinguishing this supported outcome through the requested contract. Publish a conservative interrupted frame before exiting.
AGENTS.md reference: AGENTS.md:L80-L83
Useful? React with 👍 / 👎.
Evidence-preserving supersession closurePre-close readback for #5: state=OPEN; updatedAt=2026-07-31T17:20:23Z; headRefOid=a7fa5fdf27b5382e8c3e4f4837605df8687940cd; baseRefOid=afc54ca8060f65f918f9ff4341302db136897f19; mergeable=MERGEABLE; mergeStateStatus=UNSTABLE. This stale PR is superseded by merged PR #10 (#10), which preserves the reviewed producer-bound NousResearch#358 evidence, and merged PR #17 (#17), which delivered the NousResearch#380 shared-auth repair. Merged PR #16/current main is e0c3e1b. Closure does not prove NousResearch#358 integration. NousResearch#358 remains OPEN and not close-ready; current repair/review continues on t_9be14185 / the result-metadata FD path, followed by required protected canary evidence. This PR is closed as superseded without merge, force-push, branch deletion, or ref alteration. No issue closure, install, rollout, or live Hermes/SOUL/profile mutation is authorized. |
Repo-only CI/publication artifact for cermm/wc-infrastructure#358 and NousResearch#380.
Exact independently reviewed candidate:
a7fa5fdf27b5382e8c3e4f4837605df8687940cd16e541a6732a099c14d4a7d06273b4848aa33520afc54ca8060f65f918f9ff4341302db136897f19and21b21db0ebd82baa91b2999f2da854b6b6302e08da89c8500df9a2d5272224afeb460c8b12186a26Independent exact review: 75 focused + 822 broad tests PASS; Ruff, compile, diff, secret and clean one-writer checks PASS. This fork-side PR is based on the exact reviewed upstream commit because the available token cannot create a NousResearch upstream PR. It does not claim upstream integration or authorize install, live auth/profile/SOUL/config mutation, canary, rollout, or issue closure.