Skip to content

dewey-distill-auto: rolling_pr replaces validated articles with raw draft dumps of new learnings #295

Backlog

Description

@jflowers

What happened

The first real unattended /dewey-distill-auto run (dewey v3.11.0, in a hub checkout of unbound-force/unbound-force, started 2026-11-28 ~23:10 UTC) opened 33 per-theme PRs. Its regenerated articles replace the existing compiled articles instead of extending them:

  • The frontmatter goes from tier: validated (human-reviewed, merged) to tier: draft.
  • sources: is cut down to only the newly in-scope learnings; every previously cited source is dropped.
  • The compiled prose is gone. The body is the new learnings pasted verbatim under ## <learning-id> headings, with no synthesis.

Merging any of these PRs would wipe a reviewed article. All 33 are being closed unmerged.

Examples

Most PRs have far more deletions than additions. The few that grow (for example unbound-force/unbound-force#1248 and unbound-force/unbound-force#1249) are large new-learning dumps.

Expected

Per #193: an existing article's regeneration keeps its prior sources and adds the newly cited ones, re-synthesizes the body, and does not demote an article out of validated by rewriting it wholesale. A learning only lands in a theme it actually belongs to.

Also seen during the run

  • One rolling_pr call (21 themes) hit the MCP request timeout; the server had already opened 11 PRs and recorded no run artifact. The agent finished with smaller batches.
  • gh pr create inside the tool passes no --head, so on a fork checkout it failed with "you must first push the current branch to a remote" until the agent pre-wrote branch tracking config for all 33 branches.
  • The agent created the human-gate and dewey-distill labels in unbound-force/unbound-force itself.

The 33 PRs (all closed unmerged)

PR Branch Diff
unbound-force/unbound-force#1247 dewey-distill/index-be943c5c +7/−101
unbound-force/unbound-force#1248 dewey-distill/content-pipeline-25be5186 +1307/−103
unbound-force/unbound-force#1249 dewey-distill/issue-triage-ac31c147 +1277/−115
unbound-force/unbound-force#1250 dewey-distill/scaffold-db8a7260 +312/−134
unbound-force/unbound-force#1251 dewey-distill/spec-workflow-ae0283cd +639/−97
unbound-force/unbound-force#1252 dewey-distill/uf-workflow-696c574e +202/−161
unbound-force/unbound-force#1253 dewey-distill/change-management-102f2698 +112/−116
unbound-force/unbound-force#1254 dewey-distill/command-contract-tests-e87bae57 +87/−98
unbound-force/unbound-force#1255 dewey-distill/constitution-eb9a7650 +137/−96
unbound-force/unbound-force#1256 dewey-distill/review-dispatch-f48ac690 +177/−264
unbound-force/unbound-force#1257 dewey-distill/token-reduction-193d72c4 +190/−10
unbound-force/unbound-force#1258 dewey-distill/uf-workflow-testing-81fccce2 +147/−118
unbound-force/unbound-force#1259 dewey-distill/blast-radius-scope-audit-a1e39e7a +8/−80
unbound-force/unbound-force#1260 dewey-distill/ci-coverage-bea76f37 +57/−103
unbound-force/unbound-force#1261 dewey-distill/dependency-governance-453646a7 +57/−126
unbound-force/unbound-force#1262 dewey-distill/determinism-f723e6c9 +24/−134
unbound-force/unbound-force#1263 dewey-distill/dewey-63389cb1 +23/−120
unbound-force/unbound-force#1264 dewey-distill/documentation-gate-abfde12f +5/−193
unbound-force/unbound-force#1265 dewey-distill/documentation-pipeline-150355ff +17/−125
unbound-force/unbound-force#1266 dewey-distill/fail-fast-d69f49e0 +17/−74
unbound-force/unbound-force#1267 dewey-distill/finale-56469d61 +87/−85
unbound-force/unbound-force#1268 dewey-distill/gatekeeping-c74c2820 +72/−131
unbound-force/unbound-force#1269 dewey-distill/go-patterns-b43f096d +42/−99
unbound-force/unbound-force#1270 dewey-distill/openspec-3c274c1d +11/−166
unbound-force/unbound-force#1271 dewey-distill/plugin-architecture-85bc7a2e +17/−126
unbound-force/unbound-force#1272 dewey-distill/release-pipeline-a55cc1c2 +11/−68
unbound-force/unbound-force#1273 dewey-distill/review-council-db43192a +67/−145
unbound-force/unbound-force#1274 dewey-distill/seam-verification-abf2d856 +67/−110
unbound-force/unbound-force#1275 dewey-distill/security-checklist-cfe30263 +42/−129
unbound-force/unbound-force#1276 dewey-distill/spec-authoring-fba2a7b5 +62/−134
unbound-force/unbound-force#1277 dewey-distill/spec-review-bb100725 +20/−123
unbound-force/unbound-force#1278 dewey-distill/test-discipline-5740d261 +72/−141
unbound-force/unbound-force#1279 dewey-distill/uf-unleash-6c9fb617 +42/−167

Investigation of the OpenCode session will follow in a comment.

🤖 Generated with Claude Code

Activity

  1. jflowers commented on Nov 29, 2026

    @jflowers
    ContributorAuthor

    Investigation of the OpenCode session

    Source: session ses_ddba6f1a2ffeug2TbMe7kvuOpT on the hub (agent autonomy, model GLM 5.3), read against dewey v3.11.0.

    Root cause: the create path renders only the new members over the existing article

    All 33 themes came back from group_learners with an existing_article, and none had an open PR yet, so every theme went through createThemePR (tools/rolling_pr.go):

    1. git checkout -B <branch> <baseSHA>
    2. writeThemeFiles(theme, input, nil, nil), which is called with existingCited = nil
    3. RenderDraftArticle(theme, input.Texts, draft) builds the whole file from theme.Members alone: fresh frontmatter (tier: draft, compiled_by: dewey-distill-auto, sources: = members only), then each member's body pasted under ## <id>.
    4. That content is written to themeArticlePath(theme), which is theme.ExistingArticle, overwriting the validated article.

    Nothing on this path reads the base article. Its sources, prose and tier are never merged, and the "an existing article must not be emptied" check in planThemeWrites only runs on the update path. The update path (planThemeWrites → parseArticleSources) does read the branch's current citations, but only to word the PR body ("N learnings added"). It still calls the same RenderDraftArticle, so it would rewrite the article from members alone too.

    Also, RenderDraftArticle doesn't synthesize anything. Even a correct merge would give an article that is a list of raw learnings, not a compiled one.

    Assignment quality made it worse

    Of 1,089 assigned learnings, 1,020 (94%) were tie_breaker (closest-centroid resolution of a narrow margin, confidence 0.68–0.89) and only 69 were embedding_distance. No new themes were opened, so every learning was forced onto one of the 33 existing articles. Example: documentation-gate's only member was gh-cli-20261030T010350 (tie_breaker, 0.769), a gh CLI learning with nothing to do with documentation gating. Combined with the create path above, that learning replaced the whole article. One in-scope learning (1,090 in scope, 1,089 grouped) was dropped by group_learners without a reason.

    Operational issues from the run

    • Fork checkouts: pushBranch pushes an explicit refspec with --force-with-lease and sets no upstream, then createPR runs gh pr create without --head. In a fork checkout (origin = fork, upstream = org repo), gh can't resolve the head and fails with "you must first push the current branch to a remote". The agent worked around it by writing branch.<name>.remote/merge for all 33 deterministic branch names.
    • Labels: human-gate and dewey-distill are hard-coded but nothing makes sure they exist. gh pr create failed until the agent created both labels in unbound-force/unbound-force.
    • Payload size and timeouts: the agent read scope and group_learners output back from saved tool-output files and re-sent members plus decisions as rolling_pr input (calls of 33–50 KB). A 21-theme call hit the MCP request timeout. The handler was cancelled after opening 11 PRs, left a half-made local branch (openspec), and recorded no run artifact. Passing the grouping result by reference (a run ID or file) instead of through the model would remove both the size limit and the chance for the model to alter the payload.
    • The agent compressed its context six times to get through the run.

    Suggested fixes

    1. When theme.ExistingArticle is set, start from the base article: keep its sources (union with the new members), keep its body, and append or merge the new material. Never write the file from members alone. Add a test where an existing validated article goes through the create path.
    2. Refuse to rewrite an article whose base tier is validated unless the new citations are a superset of the old ones.
    3. Fail grouping, or open a new tag theme, when the best match is only a narrow-margin tie, instead of joining an existing article with tie_breaker.
    4. Push with -u (or pass --head <owner>:<branch> to gh pr create), and create or check the labels before the first PR.
    5. Have rolling_pr accept the grouping by reference, and process themes so that a cancelled call still records an artifact for the themes it finished.

    Left behind

    On the hub checkout unbound-force@coffee: 33 local dewey-distill/* branches with tracking config, untracked .uf/dewey/distill-runs/ (7 artifacts), and /tmp/dewey-*.json batch files. The 33 branches are still on the jflowers/unbound-force fork. The two labels are still in unbound-force/unbound-force.

    🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions