Skip to content

fix(pipeline): docs-only custody normalization + docs push coverage - #888

Open
RooseveltAdvisors wants to merge 5 commits into
kunchenguid:mainfrom
RooseveltAdvisors:fm/nm-docs-only-diff-defect-20260827
Open

fix(pipeline): docs-only custody normalization + docs push coverage#888
RooseveltAdvisors wants to merge 5 commits into
kunchenguid:mainfrom
RooseveltAdvisors:fm/nm-docs-only-diff-defect-20260827

Conversation

@RooseveltAdvisors

Copy link
Copy Markdown

Summary

  • Keep fresh zero-history documentation pushes in the normal validation and delivery pipeline, including multi-commit pushes ending in an empty commit.
  • Normalize successful custody recovery after the durable stamp so recovered: true cannot leave the branch reported as pipeline_owned and loop back to recover_custody.
  • Keep missing preserved heads fail-closed with a regression proving --recover --keep-local does not claim recovery or stamp custody.
  • Include the PR 848 hook-binding fix and the missing-custody-head fresh-run safety fix.

Live fleet evidence

On 2026-08-27 on gpu, lane portal-agents-train-2 was a fresh worktree with a fresh run whose only commit changed AGENTS.md and CLAUDE.md. The engine reported PASSED with no docs diff and skipped review, tests, lint, push, PR, and CI. A worker death left recorded pipeline head fc934137 absent from both the worktree and gate; four recovery attempts remained blocked on blocked_recover_preserved_head_missing, while sync --recover --keep-local refused with unpublished pipeline commits preserved. Another lane reported a branch missing from the home-B mirror although it existed in home A, exposing the hook home-binding problem addressed by PR 848.

Verification

  • go test -race ./...
  • make lint
  • go build -o ./bin/no-mistakes ./cmd/no-mistakes
  • make e2e
  • Focused docs-only and custody-recovery regressions

RooseveltAdvisors and others added 5 commits August 27, 2026 13:58
Route receive-hook daemon calls through the gate-derived NM_HOME and reject
notifications whose gate belongs to another daemon home.

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Aug 29, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The PR should not merge until fresh multi-commit documentation pushes ending in an empty commit are guaranteed to run the remaining validation and delivery stages.

The new documentation exception depends on a branch reflog unavailable in the normal bare-gate topology, causing its HEAD-parent fallback to miss earlier documentation commits and retain the pipeline-skipping behavior this change intends to fix.

Files Needing Attention: internal/pipeline/steps/rebase.go, internal/pipeline/steps/rebase_test.go, internal/e2e/docs_only_pipeline_test.go

Reviews (1): Last reviewed commit: "fix(pipeline): cover multi-commit docs p..." | Re-trigger Greptile

Comment on lines +578 to +587
entries, err := git.Run(ctx, workDir, "reflog", "show", "--format=%H", "refs/heads/"+branch)
if err == nil {
lines := strings.Fields(entries)
if len(lines) > 0 && strings.TrimSpace(lines[0]) != "" {
return strings.TrimSpace(lines[len(lines)-1]), nil
}
}
}
parent, err := git.Run(ctx, workDir, "rev-parse", head+"^")
return strings.TrimSpace(parent), err

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Reflog fallback skips docs

When a fresh multi-commit documentation push ends in an empty commit, the detached worktree normally lacks this bare-gate branch reflog, so freshPushBase falls back to HEAD^. The resulting empty tip-only diff makes freshDocumentationPush return false and causes updateHeadSHA to skip all remaining validation and delivery stages.

Context Used: If there is a VISION.md file at the root of the re... (source)

Knowledge Base Used:

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: first-time fork CI is approved after reviewing the diff (no security stop). Runs 33223464446 (CI), 33223464482 (docs), 33223464498 (Require no-mistakes), 33223464670 (Guard generated files). This is a successor to closed #872, not a last-resort port.

This is corrective in intent (docs-only empty-diff skip, recovered:true stuck on pipeline_owned, missing-head fresh-run dead-end, hook home binding). Not merging yet. Waiting on you, not the captain.

Greptile P1 on freshPushBase is real. I inspected internal/pipeline/steps/rebase.go and TestUpdateHeadSHA_DocsOnlyFreshPushDoesNotUseEmptyDiffShortcut. The new test creates a multi-commit docs push ending in an empty commit, but it runs in a normal repo with a branch reflog. The live topology is a detached bare-gate worktree that usually has no refs/heads/<branch> reflog. The HEAD^ fallback then diffs only the empty tip, freshDocumentationPush returns false, and updateHeadSHA still sets SkipRemaining. That is the same skip this PR intends to close. Fail-closed here means: if the exception cannot prove a documentation push, do not skip remaining validation (or use a base that does not depend on a missing reflog).

VISION.md exists. Per-rule:

  • R1 One gate, one meaning: aligns in intent (do not skip core steps on a stale empty-diff). Implementation cannot tell on the multi-commit empty-tip path until the P1 is fixed. Evidence: updateHeadSHA + freshPushBase HEAD^ fallback.
  • R2 Never lose work: aligns. normalizeRecoveredState stops recovered:true + pipeline_owned loops. freshRunHasNoPipelineEvidence fails closed on unreadable gate or surviving recovery anchors. Hook NM_HOME bind is fail-closed on relative/unresolved gate paths.
  • R3 Judgment stays human: aligns. No judgment transfer.
  • R4 Independent, adversarial validation: aligns in intent. Same P1 can still skip review/test/lint/push.
  • R5 Evidence over confidence: aligns on custody (cat-file + recovery ref). Does not align on the docs exception (reflog absence is treated as "not docs" rather than "cannot prove skip").
  • R6 Humans and agents are both first-class: aligns. Skill/docs/guidance updated together.
  • R7 Scope and evaluation: aligns. Field incident to regression.

contract-class: restore. The unconfigured gate already promised that a shortcut failure falls back to the slower correct path, and that recovered custody is actually returned. Not auto-merge-ready while the P1 stands.

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.

3 participants