Skip to content

fix(agentflow): #649 report spec gaps + shared stripSlash - #709

Merged
lis186 merged 2 commits into
mainfrom
fix/agentflow-report-spec-gaps
Oct 17, 2026
Merged

lis186 merged 2 commits into
mainfrom
fix/agentflow-report-spec-gaps

Conversation

@lis186

@lis186 lis186 commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Refs #649. Covers the five checklist items. The follow-up comments on the issue (items C/A/B/residual/D) are not covered, so this PR intentionally doesn't close the issue.

Changes

  1. Freshness notice: Asks newer than the newest imported index line are flagged importStale. The check uses the newest imported row across the whole index, not just the read range, and only counts closed Asks (an open Ask is never "stale").
  2. Close-commit cross-check (new server/agentflow/close-commits.js, read-only git): finds the earliest commit with the Agentflow-Close-Id trailer that touches the notebook and already holds the Reply, matched on the Reply heading and stamp line, with full text as a fallback. If it is more than 1 min from the Reply stamp, the Ask gets the label close commit mismatch, and the stamp is kept. Matching is incremental, with --no-show-signature and GIT_OPTIONAL_LOCKS=0.
  3. Worker bound to another checkout: E4 now tells this checkout, another checkout and unknown apart. Runs bound to another checkout are no longer counted as checkout unknown.
  4. Footer sources: now include worker runs (e.g. Codex openai: import).
  5. Shared stripSlash: one null-safe helper in server/paths.js, used in four places, with a guard test against new local copies.

Docs (docs/agentflow-report.md, docs/agentflow-integration.md) and the CHANGELOG (Unreleased) are updated.

Verification

  • An independent review found no must-fix items. Should-fix 1–4 and nits 1 and 4 are addressed in 5a0f841.
  • New tests in test/agentflow-649.e2e.test.js. Each one failed on the code before its fix and passes now.
  • Full npm test: everything passes except the known box-only Herdr Node launcher fallback failure, plus one Auth header injection E2E failure that only happens under load (it passed 2/2 when run alone).
  • All fixtures are synthetic.

lis186 and others added 2 commits October 17, 2026 23:18
- Footer freshness notice: newest imported turn older than an Ask's window end
  (newestImportedAt / importStale), distinct from `not yet imported`.
- Close-commit cross-check: an Ask whose Agentflow-Close-Id commit is more than
  a minute from its Reply stamp gets `close commit mismatch`; git is read only.
- E4: a worker whose clone was cloned from another checkout is that checkout's
  (F22) and no longer counted as `checkout unknown`.
- Footer sources include the listed worker runs, so a Codex worker's
  one-source choice is stated.
- One null-safe stripSlash in server/paths.js replaces four copies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Freshness: newest imported line is taken over the whole index, not the
  read range, so an import that stopped before `from` still yields the notice.
- Freshness counts closed Asks only: an open Ask's window ends now, which no
  imported turn reaches, so it was always stale and import could not clear it.
- Close commits are read oldest first and matched incrementally, stopping once
  every replied Ask is matched; at most one notebook version is held.
- A Reply is matched by its heading and stamp lines (whole text as fallback),
  so text appended after the close commit no longer hides the round.
- git log --no-show-signature; GIT_OPTIONAL_LOCKS=0 for every read.
- Docs describe the whole-index and closed-Ask rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T15:55:43.227867Z 5a0f841 PR opened
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a0f8412aa

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

Comment on lines +324 to +325
const importStale = newestImportedAt == null ? 0 : reported.windows
.filter(w => w.start != null && w.end != null && w.stamp != null && w.startKind !== 'no local evidence' && Math.min(w.end, now) > newestImportedAt).length;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include closed no-evidence Asks in the stale count

When a closed Ask has no matched local submission, buildWindows still gives it a stamped window end but marks it no local evidence; this predicate excludes it because its start is null and explicitly rejects that start kind. If the newest imported row predates that Reply, the new freshness footer therefore reports zero stale Asks even though the documented check covers every closed Ask whose window end is newer. Base this count on the closed window's stamp/end rather than requiring a locally derived start.

Useful? React with 👍 / 👎.

@lis186
lis186 merged commit 3beb6f2 into main Oct 17, 2026
4 checks passed
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