Repository navigation
feat(env): report project key state in env list --json - #848
Conversation
hack env list --json now carries key_state: ok, missing or unreadable for the layered format, by the same lookup order the runtime uses, and not_checked for the legacy hack.env.json contract. Names are still listed when the key cannot be read. The key and values are never reported. The payload keeps its published bare-object shape; no envelope is added. Refs HACK-2218 (R10). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The runtime skips an empty or whitespace-only key file and uses the next location, so key_state reports missing (or ok through a fallback), not unreadable. Align the docs and probe comment and cover both cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ready for lead: c4d8629 R10 from HACK-2218: Decision to confirm: no envelope. The brief asked for the HACK-2238 envelope. But #835's rule keeps published shapes unchanged, and it lists What I ran (pinned Bun 1.4.4, temporary HOME/TMPDIR, daemon autostart disabled)
Not verified
I will not push to this branch again. |
|
Clarification for the lead: this PR was opened by the environment-track session that took over HACK-2191 (same session that posted the #797 ready note), as item 2 of its original brief. It is not a second, parallel R10 effort. Per the change of plan I am stopping R10 work here: no further pushes. The ready note above ( |
|
Addendum to the ready note at |
Conflicts: - src/commands/env.ts: keep this branch's aliased migration import and next's ProjectEnvKeyState (#848). - scripts/check-native-*-plan-cli.ts: keep this branch's HOME fingerprint and refusal-activity gates; the env plan script also keeps next's setup-unavailable detached refusal (#794). The shared refusal helper now forwards the private inputs to next's assertNativePlanHome check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hack env list --jsonnow reportskey_state, which says whether this checkout can read the project env key. The desktop Env tab needs it for its "Locked" state (HACK-2218, request R10).key_stateokmissingHACK_ENV_SECRET_KEY. An empty or whitespace-only file counts as absent, as it does for the runtime.unreadablenot_checkedhack.env.jsoncontract, which does not use this key..hack.secret.key, then the shared copy, then the primary checkout's copy, thenHACK_ENV_SECRET_KEY. It never creates, repairs or rotates a key. The key text stays inside the probe; only the state is reported.missingorunreadable, and the exit code is unchanged.okmeans only that the key can be read. It does not prove the key decrypts the stored values;hack doctoralready reports undecryptable layers.project_keyrow.flowchart LR A[env list --json] --> B{layered env format?} B -- no --> N[key_state: not_checked] B -- yes --> C[runtime key lookup, read-only] C -- key read --> OK[ok] C -- nothing found --> M[missing] C -- file refused --> U[unreadable]Decision for the lead: no envelope. The brief asked for the HACK-2238 shape (
{ok, data: {schema}}). Butenv list --jsonis a published bare object, and the HACK-2238 rule in #835 keeps published shapes unchanged ("No published payload is silently wrapped"; its inventory listshack env list --jsonas legacy bare). Wrapping it would break the MCP projection and existing scripts. Sokey_stateis an additive field, and errors keep using the existingE_*error envelope. If you want an envelope anyway, I would add it as a separate opt-in variant with its own schema id rather than changing the published shape.Docs:
docs/env.md(a table of the states), the v5 command contracts, the short v5 "Share environment" page, and desktopDESIGN.md(R10 marked as existing, plus the Locked row).Verification (pinned Bun 1.4.4, temporary HOME/TMPDIR, daemon autostart disabled):
tests/env-list-key-state.test.ts: 6 CLI cases (ok, missing, env-var fallback, empty file as absent with and without fallback, refused symlink, legacy). Each also checks that a sentinel secret value never appears in stdout or stderr. With the source change reverted, 0 of the original 5 pass.docs:prepare+docs:check: pass.Not verified: the desktop app consuming the field, macOS, and the full root suite.
🤖 Generated with Claude Code