Repository navigation
Conversation
…way.token without owner-only mode
…hand-set mode lasts until the next write (#252)
V3RON
added a commit
that referenced
this pull request
Oct 16, 2026
) Closes #258 ### Status Ready for the gate. Both regression tests probed (fail at 0o644). - [x] `tokens.json` is written owner-only (0o600) — `src/http/token-store.ts:147`, pinned by `src/http/token-store.test.ts` - [x] `state.json` is written owner-only (0o600) — `src/core/registry.ts:950`, pinned by `src/core/registry.test.ts` - [x] The false comments are corrected — `src/gateway/drain-store.ts:16` is scoped to the files it lists (`daemon.log`, `events.jsonl`, `instance.json` stay 0644); `src/daemon/admin-secret.ts:3-5` needed no change: its claim is true once both files are 0600 Existing 0644 files are re-tightened on their next write, as `config.json` was after #266; no migration. ## Assumptions none ## Review Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 1 note. Rounds: 1. Tokens: 0.3M. *Written by an agent.*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #252
simlock config setnow writesconfig.jsonwith mode0600, set on the temp file at creation, asadmin.tokenalready is. The file can holdgateway.token. The atomic rename replaces the old file, so under a usual umask it came out0644, and a hand-setchmod 600was lost on the next write.docs/CONFIGURATION.mdnow says the file is owner-only. Thegateway.tokencomment insrc/core/config.tssays the same.Release note: a
config.jsonwritten before this change keeps its mode until the nextconfig set. Runchmod 600 ~/.simlock/config.jsonon one that holds a token.src/cli/index.test.ts, "writes the config.json holding gateway.token owner-only, whether it creates the file or replaces an owner-only one" (the triage test), now passing. It fails on its mode assertion with themoderemoved.pnpm checkgreen.Review
Spec review: 1 finding, 0 fixed. Code review: 2 findings, 2 fixed. The code review was not re-run on the commit that fixed its findings.
Rejected:
CONFIGURATION.mdline telling users tochmod 600 ~/.simlock/config.jsongoes beyond the fix, and its path assumes the default home. Rejected: the triage asked the docs to say the file is owner-only, and a file from before the fix stays0644, so the reader needs the step. The same page already names the file~/.simlock/config.json.Written by an agent.