Skip to content

factory: every job's PR carries its own file list; Brief words stay plain - #2515

Merged
santoshkumarradha merged 3 commits into
factory/general-intakefrom
factory/pr-files-brief-words
Nov 8, 2026
Merged

santoshkumarradha merged 3 commits into
factory/general-intakefrom
factory/pr-files-brief-words

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

What

1. Every job's pull request carries its own file list. pr.files on the job wire: each file's path, status (added / modified / removed / renamed, GitHub's other words as GitHub spells them; mode-only changed reads modified), added / removed line counts, and previous_path for a rename or copy. Beside it pr.files_total (the whole change's file count, from the PR's changed_files) and pr.files_head (the commit the list was read on).

  • Same file shape as the desk's FactoryChangedFile (apps/desktop/src/lib/factoryJobsWire.ts), so mergeChangesOf can take { files: pr.files, stat: { files: pr.files_total } } directly.
  • Desk rule: show the list only while pr.files_head === pr.head_sha; otherwise it is unknown (MERGE_CHANGE_WORDS.unknown). The engine also never carries a list onto a different head.
  • Read in followPR through the same GitHub client as follow/merge (new PullFileList on internal/praf/github, paged 100 at a time), for every followed job, including AgentField/SWE-AF (RunDeliveredPR) jobs.
  • One read per head. The job's stored list for the same head answers first, then a per-process cache (bounded at 1024 PRs). A merged or closed PR makes no file read and keeps the list it has, which keeps the terminal-PR "one request" law.
  • Bounded at factory.PRFilesMost = 300 files, in GitHub's order.
  • A failed list read leaves the list unknown. It is not a problems entry and never blocks Merge.

2. Brief words stay plain. Both Brief prompts now carry BriefPlainWordsRule. After the check, every drafted heading and text goes through a deterministic filter, BriefPlainWords, before the version is kept. The filter rewrites the verdict, bullets, flow, table, spots, questions, options and shot labels. It runs before the heading dedupe, so "What the verification found" becomes What the checks found, verified → checked, verdict → outcome, auditor → reviewer, refuted → disproved, unverified → unchecked. Proof commands, paths, step names, evidence refs and mermaid are left as written.

Manual: two new sections in internal/manual/chat/factory.md, one on the PR file list and one on plain Brief words.

Out of scope / not touched

internal/factory/serve/workers.go, lease.go, cellstore, keys and the quit path (another lane). The desk side, which reads pr.files keyed to head_sha, is codeaf-desk's.

Briefs kept before this change keep their old headings until the next write.

Proof

  • internal/factory/github/pr_files_test.go, against a fake GitHub on the real client:
    • statuses and renames, and the wire JSON
    • one read per head, a stored list reused after restart, a new head re-read, a failed read left unknown
    • 450 files bounded to 300 over 3 pages
    • an AgentField job stored through followOpened, and a merged PR that keeps its list with no read
  • internal/factory/brief_words_test.go:
    • the filter table
    • a draft whose headings all use banned words is kept with plain headings, checked against an independent regex
    • both prompts carry the rule
  • Strict fake forges in readiness, nochecks and partial_read tests now serve /pulls/7/files.

🤖 Generated with Claude Code

…lain

A followed pull request now carries pr.files (path, status, line counts,
previous_path for a rename), pr.files_total and pr.files_head, read from
GitHub once per head and bounded at 300 files, for every job with a PR,
AgentField/SWE-AF runs included. A list is only ever about its own head.

The Brief writer is told not to use auditor, verdict, verified,
verification, unverified or refuted, and every drafted heading and text
goes through a deterministic plain-words filter before it is kept, so
"What the verification found" reads "What the checks found".
@santoshkumarradha
santoshkumarradha merged commit 06e9641 into factory/general-intake Nov 8, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the factory/pr-files-brief-words branch November 8, 2026 15:30
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