feat(review): warn user when review manifest is not persisted#1166
Merged
Conversation
When `entire review` ran but the review session was not tagged as `KindAgentReview` (env-var handshake did not reach the hook), the manifest write would silently no-op. Three downstream features (`--findings`, `--fix`, end-of-run footer) all gate on the same manifest, so a single silent miss broke them as a unit with no user-visible signal. This change makes the silent failure modes legible: - `lifecycle.go`: debug-log when adoption is skipped because `ENTIRE_REVIEW_SESSION` is unset on the hook process. Other adoption-skip branches already log at WARN; this was the only silent one. DEBUG level keeps it quiet for normal coding turns unless `ENTIRE_LOG_LEVEL=debug` is set. - `review/cmd.go`: when `writePostReviewManifest` skips at any of its three early-return branches (state-store load error, no matching review sessions, manifest write error), print a user-visible note explaining what happened, that `--findings` / `--fix` will not see this run, and how to get diagnostic detail. Replaces three silent debug-only returns. Happy path is unchanged: working reviews print exactly the same output they do today. The warning only fires on failure paths that today produce zero user-visible signal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: fa74d61feb1b
Contributor
There was a problem hiding this comment.
Pull request overview
Improves observability for entire review when post-run manifest persistence is skipped, ensuring users get a clear, actionable warning and operators have an extra debug breadcrumb for env adoption.
Changes:
- Print a user-visible note when the review manifest isn’t written (state load failure, no matching review sessions, or disk write failure).
- Add a DEBUG log line for the previously silent
ENTIRE_REVIEW_SESSION-not-set branch inadoptReviewEnv. - Add unit tests covering the new warning helper and the “no matching sessions” warning path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/entire/cli/review/cmd.go | Adds warnManifestNotWritten and calls it on the manifest non-persistence early returns. |
| cmd/entire/cli/lifecycle.go | Adds a DEBUG log breadcrumb when review env adoption is skipped due to ENTIRE_REVIEW_SESSION not being "1". |
| cmd/entire/cli/review/manifest_test.go | Adds tests asserting the warning text and that it fires when no sessions match. |
Comments suppressed due to low confidence (1)
cmd/entire/cli/lifecycle.go:1045
- This branch triggers when ENTIRE_REVIEW_SESSION is anything other than "1" (including "0"); the log message says "not set", which is inaccurate in that case. Consider rewording to something like "not enabled" / "not '1'", or include the observed value in a field for clarity.
}
if transErr := strategy.TransitionAndLog(ctx, state, session.EventSessionStop, session.TransitionContext{}, session.NoOpActionHandler{}); transErr != nil {
logging.Warn(logging.WithComponent(ctx, "lifecycle"), "session stop transition failed",
slog.String("error", transErr.Error()))
- lifecycle.go: log message said "not set" but the branch fires for any value other than "1" (including "0"). Reword to "is not \"1\"" and include the observed value as a structured slog field. - cmd.go: warning text said "review skills ran successfully" but writePostReviewManifest can be reached when individual AgentRuns have AgentStatusFailed (the early return only checks Cancelled and zero-runs). Drop the "successfully" claim — per-agent statuses are already shown earlier in the review output, so the warning doesn't need to assert success it can't guarantee. - manifest_test.go: update assertion strings to match new wording. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 9847dd86142a
alishakawaguchi
approved these changes
May 8, 2026
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.
https://entire.io/gh/entireio/cli/trails/340
Summary
entire review: when manifest persistence skips (env-handshake didn't reach the hook, state-store load fails, or disk write fails), the user now sees a clear note explaining what happened and how to diagnose.EnvSession-not-set return inadoptReviewEnv, completing observability across all five adoption decisions.Background
After running
entire review, three downstream features (entire review --findings,entire review --fix, and the end-of-run "To apply all review findings:" footer) all read from the local manifest at.git/entire-review/manifests/. If the spawned agent's lifecycle hook does not adopt theENTIRE_REVIEW_*env vars set byentire review— for any reason — the session is never tagged asKindAgentReview, the manifest matcher finds zero sources, andwritePostReviewManifestreturns silently. All three features then quietly no-op with no error, no warning, no missing-file message that a user could grep.We hit this in practice today: a review ran end-to-end, agents produced findings, the synthesis verdict printed — and then
entire review --findingsclaimed there was nothing to show, with no breadcrumb in the user-visible output explaining why. The actual root cause for that specific reproduction is still unidentified (running from a fresh terminal worked; running from the same shell a few hours earlier did not, with identical shell env). Without observability in the failure path, every future reproduction will be equally opaque.What this PR does
cmd/entire/cli/lifecycle.go— Two-line debug log added to theEnvSession-not-set silent return. The other four branches inadoptReviewEnvalready log at WARN (agent mismatch, SHA mismatch, malformed skills JSON) or DEBUG (success). This was the only branch with no breadcrumb, so a "review env didn't take" failure produced zero log lines diagnosing it.cmd/entire/cli/review/cmd.go— Each of the three silent early returns inwritePostReviewManifestnow also calls a new helperwarnManifestNotWrittenwhich prints a user-visible four-line note to the sameoutwriter the success-path footer uses. The helper is centralized so the wording is consistent and editable in one place.What this PR does NOT do
User-visible change
Today, when manifest persistence skips:
After this PR, same scenario:
Test plan
mise run fmtcleanmise run lint— 0 issuesgo test ./cmd/entire/cli/review/passes (incl. two new tests:TestWarnManifestNotWritten_PrintsReasonAndDiagnosticHints,TestWritePostReviewManifest_WarnsWhenNoMatchingSessions)go test ./cmd/entire/cli/passesmise run test:integrationpasses (incl. existingTestReview_EnvVarAdoptionCondensesReviewMetadataOnNextCommit— confirms happy-path env adoption still works)entire review --agent codexfrom a fresh terminal on this branch successfully writes a manifest and prints the existing "Review complete." footer with--fix <id>commands. Warning correctly does not fire on success.Decisions worth flagging for review
ENTIRE_LOG_LEVEL=debug.TestAdoptReviewEnv_NormalSession) covers the path; if the log line is ever removed, behavior is unchanged but observability degrades silently. Acceptable risk for v1; revisit if a future reproduction shows this matters.🤖 Generated with Claude Code
Note
Low Risk
Low risk: changes are limited to logging/user messaging on failure paths and new tests, with the successful review flow unchanged.
Overview
Prevents silent failures in
entire reviewwhen local manifest persistence is skipped:writePostReviewManifestnow prints a user-visible note (via newwarnManifestNotWritten) when session state can’t be loaded, no matching review sessions are found, or manifest disk writes fail.Adds a missing
Debuglog inadoptReviewEnvwhenENTIRE_REVIEW_SESSIONis not set, improving diagnostics for env-var adoption issues, and includes new tests covering the warning output and the “no matching sessions” warning path.Reviewed by Cursor Bugbot for commit 4189e7c. Configure here.