Skip to content

fix(efficacy): write a trial's refreshed token back while the trial runs - #88

Merged
braboj merged 2 commits into
mainfrom
fix/credential-watch
Oct 31, 2026
Merged

braboj merged 2 commits into
mainfrom
fix/credential-watch

Conversation

@braboj

@braboj braboj commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

A trial's token refresh retires the refresh token the account's file holds. The harness wrote the new one back only at the trial's end, so the owner's session was forced to log in mid-trial. A watch now writes it back within 15 s. Closes #87.

before:  15:05 trial refreshes ... 15:10 owner logged out ... ~16:00 trial ends, write-back
after:   15:05 trial refreshes -> <=15 s later written back -> owner's session refreshes fine
File Change
tests/efficacy/harness.py new credential_watch: polls the home's file during each build and change trial; writes back through write_back under credential_lock
tests/efficacy/harness.py 3 self-test checks: mid-trial write-back, older token ignored, watch stops
docs/architecture/06-runtime-view.md the credential bullet explains the watch
  • The link is still remade only between trials; refresh_credentials stays the final pass.
  • Prints no token, only a line when a write-back happens.

Verification

  • Self-test 147/147 (BENCHMARK_TEMPLATES=../solid-ai-templates)
  • Negative control: with the write-back disabled, the new checks fail (145/147)
  • pyflakes clean, no line over 88 columns
  • Round 5c picks it up only on a restart, which is the owner's call

🤖 Generated with Claude Code

https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX

A trial's refresh retires the refresh token the account's file holds, and
the write-back waited for the trial's end, so the owner's own session was
forced to log in mid-trial. A watch now writes a later home token back as
soon as it appears, under the same lock and compare; the link is still
remade only between trials.

Closes #87

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX
The watch stopped without a final look, so a refresh after it waited for
the next trial's re-link, which the last trial of a run, or one before a
long wait for the generator, does not reach for hours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX
@braboj

braboj commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the P2 finding in 3b1cc92: the watch now does one final write-back as the trial ends, after the watcher has stopped.

  • New check: a token refreshed with no look due (every_s=3600) reaches the account's file when the context exits.
  • Negative control: without the final write-back, that check fails (147/148).
  • Self-test 148/148; pyflakes clean.

@braboj
braboj merged commit 70b268e into main Oct 31, 2026
2 checks passed
@braboj
braboj deleted the fix/credential-watch branch October 31, 2026 04:22
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.

Copy a trial's refreshed token back while the trial runs, not after

1 participant