Repository navigation
feat: orient --refresh + assert confirmed-stale (freshness gate) - #122
Merged
Merged
Conversation
Two moat-safe fixes from a dogfeedback report where a consuming agent skipped `basou refresh` despite a stale orient and read the repo directly, bypassing the freshness gate. [#1 moat-safe] Add opt-in `basou orient --refresh`: imports every adapter first (writes provenance) then renders a guaranteed-fresh position, so a SessionStart hook can close the freshness gate in one command. Bare `basou orient` stays read-only (never imports) - the deliberate invariant that a plain orient never mutates the store is preserved. Default-on auto-refresh was deliberately NOT adopted: it would make every orient consumer (portfolio view, CI) a writer. [#4] Confirmed-stale wording is asserted, not hedged. The top banner and the bottom freshness verdict, for the confirmed-stale branch ONLY (newSessions>0 || updatedSessions>0), now state plainly that the view IS stale (with the uncaptured count) plus an imperative "run basou refresh first", instead of the previous "might be stale" hedge. basou counted the uncaptured work, so it asserts it. The genuinely-uncertain branches (an un-re-importable grown session; an unrun probe) keep their non-asserted wording. Not adopted: suppressing the orient body when stale (removes the honest hedged orientation the report itself praised); a PreToolUse re-injection hook (larger design, backlog). Adversarial review (Codex): no findings - confirmed the wording is confined to the confirmed-stale branch, --refresh runs refreshAll before the probe with a full non-dry import, no stdout pollution, bare orient stays read-only, and a refresh failure routes through the existing clean error handler. Tests: +1 cli (orient --refresh imports an uncaptured session, so the verdict flips to current); updated the confirmed-stale wording assertions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Two moat-safe fixes from a takashimatsuyama-blog dogfeedback report: basou orient correctly detected staleness (the v0.21.0 top banner), but the remediation (
basou refresh) was advisory only, so a consuming agent skipped it and read the repo directly — bypassing the freshness gate.[#1 moat-safe] opt-in
basou orient --refreshImports every adapter first (writes provenance), then renders a guaranteed-fresh position — so a SessionStart hook can close the freshness gate in one command. Bare
basou orientstays read-only (it never imports; the dry-run probe only reports staleness). The deliberate invariant — a plain orient never mutates the store — is preserved.Default-on auto-refresh (the report's proposal #1) was deliberately NOT adopted: it would reverse orient's read-only contract and make every consumer (portfolio view, CI) a writer. The enforcement belongs in the hook layer (which may write), orchestrated via this opt-in flag — not in the read command.
[#4] Assert confirmed staleness instead of hedging
For the confirmed-stale branch only (
newSessions>0 || updatedSessions>0), the top banner and bottom verdict now state plainly that the view is stale (with the uncaptured count) + an imperative "runbasou refreshfirst", instead of "might be stale". basou counted the uncaptured work, so it asserts it rather than understating the urgency. The genuinely-uncertain branches keep their hedged wording (un-re-importable grown session: "cannot confirm"; unrun probe: "run refresh to check").Not adopted (with reasons)
This is consistent with the earlier Stop-hook decision (advisory nudge over forced block): basou's moat is advisory + read-only + human-in-the-loop. The forced-gate proposals are the same enforcement posture already declined there.
Adversarial review (Codex)
No findings. Confirmed: wording confined to the confirmed-stale branch (unverifiable/null branches stay non-asserted),
--refreshrunsrefreshAllbefore the probe with a full non-dry/non-force import, no stdout pollution of the orient body, bare orient writes no provenance, and a refresh failure routes through the existing clean error handler.Tests
+1 cli (
orient --refreshimports an uncaptured session → verdict flips to current); updated the confirmed-stale wording assertions. Full suite green: core 1143, sdk 18, cli 820. typecheck + lint clean. Verified by smoke against the real workspace.🤖 Generated with Claude Code