Skip to content

Persist uncertain installation-token acquisition attempts - #220

Merged
HemSoft merged 3 commits into
mainfrom
feature/issue-176-installation-journal
Oct 21, 2026
Merged

HemSoft merged 3 commits into
mainfrom
feature/issue-176-installation-journal

Conversation

@HemSoft

@HemSoft HemSoft commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

A process crash or lost response during installation-token acquisition could leave no durable indication that a token POST had already been attempted. A restarted caller could then mint again without acknowledging the uncertainty.

Add a nonsecret SQLite acquisition journal with per-role cross-process ownership. Persist intent before HTTP and mint_pending before the non-replayable POST. Uncertain acquisition stays latched across restart; no fresh attempt reaches HTTP until a separate stopped-owner recovery check passes. Qualified transports are withheld and closed if their receipt cannot be persisted. The low-level explicit handshake retains its current role, repository and identity checks.

Records contain enrollment, attempt/role identity, stage, times, optional qualification metadata and hashed recovery evidence. Canonical JSON schemas and 4-KiB read/write bounds reject malformed records. Retention keeps at least seven days of terminal history, every unresolved attempt and the latest record per role, with a 1,024-record cap before HTTP. Credential acquisition changes no review job or provider budget. It creates no background renewal, key discovery, credential import, App installation or activation path.

Relates to #176 and #172. Atomic role-generation handover, admitted-request drain, refresh ownership, exact object acquisition and packaged runtime composition remain open. The owner freeze is unchanged.

Validation

Validated exact head 3e255a057c6d797be3dcf9fcb006e409cc75694a. go -C reviewer vet ./... and go -C reviewer test -race -count=1 ./... passed, 77.614 seconds combined. Focused race tests passed in 3.870 seconds.

  • Independently verified a generated RSA JWT and sent it through both actual local TLS role handshakes. The fake server observed committed mint intent before processing the token response. Seven requests and one mint per role.
  • Killed real child processes before the token POST and after fake-server acceptance while its response was withheld. Fresh Store/journal instances made zero HTTP calls until explicit stopped-owner recovery. Recovery also refused to race a still-live owner, and all children were reaped.
  • Exercised SQL failures before dispatch, after remote qualification, and while recording uncertainty; lost responses and post-mint identity rejection; cross-process flock; proof mismatch; cap/retention and symlink refusal.
  • Reproduced an ambiguous JSON state-field bypass before canonical field validation, then verified rejection with zero HTTP afterward. Actual persisted producer records, optional receipt/recovery objects and generated JWTs remain accepted.
  • Verified no JWT/token bytes in journal records, SQLite database/WAL files or handle formatting, and no review state/budget mutation.

All credentials and GitHub responses are synthetic. No public backend, actual account/profile/key, provider inference, activation or deployment was used. Reproduction commands and exact boundary limits are in reviewer/INSTALLATION-JOURNAL.md. GitHub Actions remain disabled by owner instruction.

Additional self-review regression: a malformed historical terminal record could point its JSON ID at another unresolved attempt. The pre-fix test deleted that evidence and made seven HTTP calls. Retention now validates every record against its SQLite row role and attempt ID before choosing deletions. The corrected case preserves unresolved evidence and makes zero HTTP calls.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T12:44:52.748779Z 3e255a0 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@HemSoft

HemSoft commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

Additional fault testing found and reproduced a retention bug at be81e4a: a malformed terminal JSON record could name a different unresolved attempt, delete its evidence, and make seven HTTP calls. Fixed in 3e255a0 by validating every historical record against its SQLite row role and attempt ID before any deletion. The regression now preserves unresolved evidence and makes zero HTTP calls. Full vet and fresh race suite passed at this exact head in 77.614 seconds; focused TLS, process-crash, locking, SQL-fault, recovery and retention checks passed in 3.870 seconds.

@HemSoft

HemSoft commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@HemSoft

HemSoft commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 3e255a057c

ℹ️ 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".

@HemSoft
HemSoft merged commit 7ddf301 into main Oct 21, 2026
@HemSoft
HemSoft deleted the feature/issue-176-installation-journal branch October 21, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant