Skip to content

feat(work-items): add a Landed section to the morning brief - #13564

Merged
kyle-sexton merged 2 commits into
mainfrom
feat/morning-brief-landed
Nov 5, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
feat/morning-brief-landed

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs #7578

Summary

This delivers the #7578 Decisions item: "/harness-ops:morning-brief moves to /work-items:morning-brief: read-only, Attention first, Landed section with 3 sampled PRs under "Read these", landed_at saved after a full read, per machine (D68, D72, D87, Q516). Setting: landed-PR sample size 3."

The move itself had already shipped. The Landed section had not: git grep -i landed over plugins/work-items/skills/morning-brief on main found no such section.

Fix

  • scripts/morning-brief.sh gains print_landed, a new section placed after Stranded findings. It lists the PRs merged since landed_at with a count. A first read covers the last day.
  • Under "Read these" it lists --landed-sample PRs (default 3), each with its link: the oldest, the newest, and PRs spaced evenly between them. The pick is deterministic, so fixture tests stay stable.
  • landed_at is a file beside the stranded bookmark, under the plugin data dir (<data>/morning-brief/<repo>/landed-at). The data dir is per machine. The stamp moves to the run's clock only after a full read. A failed read leaves it where it was, and a fixture run never touches it.
  • The section reuses the stranded read's merged-PR pages when they reach back to its cutoff, and reads again only when landed_at is older. On the REST transport it is UNREADABLE, like Stranded findings.
  • The sample size is also the morning_brief.landed_sample key, added to schemas/work-items.schema.json. Its layer prints in the Landed section, not on the Cost settings line.
  • SKILL.md: a new section-table row, the flag, and the read-only paragraph and trifecta table now name both local stamps.
  • The section count goes from 9 to 10.

Verification

  • morning-brief.test.sh: all cases pass. That includes the new fixture and live-stub cases: window, count, sample spread and size, flag layer, page reuse versus re-read, landed_at saved after a full read, and landed_at unchanged on a failed read.
  • shellcheck on the script and its test: clean.
  • check-skill.sh plugins/work-items/skills: morning-brief PASS with 0 errors.
  • Not changed: the section order. Attention sections (Queues, Stuck, Merge-ready, Parked decisions) already print first.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 5, 2026 12:28
The brief lists the PRs merged since this machine's landed_at (the last
day on a first read) with a count, and under "Read these" a sample of
3: the oldest, the newest and evenly between. --landed-sample or the
morning_brief.landed_sample key sets the size. landed_at is a stamp
beside the stranded-findings bookmark under the plugin data dir and
moves only after a full read. The section reuses the stranded read's
merged-PR pages when they reach back to its cutoff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 5, 2026 17:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T17:33:34.770552Z e84fa01 Draft marked ready
ℹ️ 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.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed e84fa0162ae5cbecb33f0764fa34def699506be9: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #13564 (morning-brief Landed section)

No security issues found. I read every hunk of all 5 changed files. None of them matches a trusted-path glob, and none is a plugin manifest (.claude-plugin/plugin.json or marketplace.json), so no manifest <field> lines apply.

What I checked:

  • The new local write (landed-at). print_landed builds its path from stranded_bookmark_path() and swaps only the last segment for landed-at (morning-brief.sh#L2026). So it gets the same checks as the bookmark: the repo key must match ^[a-z0-9._-]+/[a-z0-9._-]+$ with no .., and --data-dir must be absolute with no .. or control characters (#L1845). The write goes through save_bookmark, which refuses a symlinked target and writes via a fresh mktemp file and mv (#L1851-L1859). The value written is the run's own clock, never ingested text. A fixture run neither reads nor writes the stamp.
  • Reading the stamp. Its contents go only through to_epoch. If that fails, the run falls back to the last day, and nothing from the file is evaluated or interpolated into a command.
  • Sample size reaching jq. --landed-sample passes require_uint, and the config key is read with config_value ... uint 3. So --argjson k only ever gets a validated integer.
  • Untrusted PR titles. The Landed section prints merged-PR titles and URLs the same way the existing Stranded findings and Merge-ready sections already do. That is the skill's stated purpose, and its lethal-trifecta table still cuts the outbound channel: read-only gh queries, and allowed-tools admits only morning-brief.sh. No new outbound path, network write or credential use is added.
  • Instruction surface. The SKILL.md edits change the read-only paragraph and the trifecta table from "one local write" to "two cutoff stamps". That matches the code, and no guardrail is removed or weakened.
  • Schema. morning_brief.landed_sample is a count added to work-items.schema.json. It is not a plugin userConfig key and gates no security control.
  • PR context file. It contains no embedded instructions aimed at the review.

Spend: none beyond the existing gh reads. The section reuses the Stranded pages, and makes one more paged GraphQL read only when landed_at is older than the stranded cutoff.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed e84fa0162ae5cbecb33f0764fa34def699506be9: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Code review: add a Landed section to the morning brief

No blocking or advisory findings. I read every hunk of all 5 changed files. I also read the unchanged code the new section calls in morning-brief.sh: config_value, fetch_merged_gql, MERGED_QUERY, stranded_bookmark_path, save_bookmark, print_stranded, to_epoch and from_epoch.

What I checked

  • Reusing the Stranded pages is sound.
    • STRANDED_READ_CUTOFF is set only after fetch_merged_gql succeeds.
    • The pages are ordered by UPDATED_AT and the walk stops at the cutoff, so they hold every PR merged since then.
    • print_landed reuses them only when STRANDED_READ_CUTOFF <= cutoff, and fetches again otherwise.
    • Both sections run in the same shell because they use plain redirection, not a subshell, so the global value carries over. Stranded's first-read window (3 days) always covers Landed's (1 day).
  • The sample pick is correct. floor(i*(n-1)/(m-1)) gives distinct indices when m <= n. m == 1 picks the newest PR, and $k == 0 prints only the count.
  • landed_at is safe and never skips a merge.
    • It is written only on a live read with a resolved repo, after the jq render succeeds.
    • It goes through save_bookmark, which refuses symlinks and writes via a temp file.
    • from_epoch rounds the stamp down to the minute, so the worst case is listing a merge again on the next run, never dropping one.
    • A failed read leaves the stamp alone, and a test covers that.
  • The setting stays separate. Slicing COST_SETTING_LAYERS keeps landed_sample off the Cost section's settings line. Its value is validated as a uint, so no control characters can reach the Landed line.
  • The counts agree. SECTIONS_TOTAL is 10, s5b is in the cat order, and every test's unreadable-count string is updated to match.
  • The changelog bump is right. bump: minor fits a new section. No plugin.json or marketplace.json changed, so the manifest checks don't apply.

Closing issue: none. The PR only says Refs #7578, so there are no acceptance criteria to check.

Verification: I ran nothing; this lane has no shell. The PR says morning-brief.test.sh, shellcheck and check-skill.sh pass. That is the author's claim, not something I confirmed.

Spend: none of this triggers a hold. A live run makes one more paged GraphQL read of merged PRs, and only when landed_at is older than the Stranded cutoff. That uses the operator's own gh quota.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body does not yet satisfy the issue-linkage contract:

  • Missing a native closing keyword (Closes/Fixes/Resolves #N). If this PR references an issue it must not close, put "Refs: #N" (or "Relates to: #N") on its own line. If it relates to no GitHub issue at all, state "No linked issue" (or "No related issue:") in the body instead.

Edit the body and this comment updates itself on the next run.

@github-actions github-actions Bot added the needs-issue-linkage Pull request body has no issue linkage line; set by the check-contract step, advisory. label Nov 5, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 34c26c0 Nov 5, 2026
58 of 70 checks passed
@kyle-sexton
kyle-sexton deleted the feat/morning-brief-landed branch November 5, 2026 17:47
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 5, survived 2, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 71%; mutation score 71%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/work-items/skills/morning-brief/scripts/morning-brief.sh 5 2 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/work-items/skills/morning-brief/scripts/morning-brief.sh:2073 ROR productive input-gap
plugins/work-items/skills/morning-brief/scripts/morning-brief.sh:2077 LCR productive input-gap

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-issue-linkage Pull request body has no issue linkage line; set by the check-contract step, advisory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant