Skip to content

fix(chronicle): carry a pending extraction decision across add_link (#9636) - #9639

Closed
Masashi-Ono0611 wants to merge 1 commit into
garrytan:masterfrom
Masashi-Ono0611:fix/issue-9636
Closed

Masashi-Ono0611 wants to merge 1 commit into
garrytan:masterfrom
Masashi-Ono0611:fix/issue-9636

Conversation

@Masashi-Ono0611

Copy link
Copy Markdown
Contributor

Related to #9636

add_link rewrites the source page's Links fence, changing its content hash, but recorded no Chronicle decision for the new hash. On managed brains discovery then wrote skipped/no_write_decision and the pending meeting was never extracted.

Fix: recordChronicleDecision now also runs for add_link, but only when the page already has a pending, automatic, not-no_extract row. In that case the normal decision (including opt-out and confined-writer checks) is recorded for the new hash. Pages with no pending row (extracted, skipped, opted out) are untouched, so add_link never authorizes fresh work on its own.

Test: new case in test/chronicle-auto-decision.test.ts asserts the judge is called once after add_link; it fails on base (0 calls) and passes now. Siblings checked: remove_link and other link ops were not changed.

Discrimination test

Discrimination test: reverted src/core/chronicle/ledger.ts to dbf3d9c9456d, ran bun test test/chronicle-auto-decision.test.ts → fails without the fix. Restored → passes with the fix (T-0 recheck: proceed at master dbf3d9c; pass/fail counts were not captured by the T-0 runner).

Reproduced on latest master dbf3d9c right before submission.

Verification

  • Not verified by this automated submission: any verify command or remediation text this PR adds was not run against a system in the broken state.

Tests

  • test/chronicle-auto-decision.test.ts (added or changed by this PR)
  • bun test test/chronicle-auto-decision.test.ts: fails without the fix, passes with it (T-0 recheck: proceed at master dbf3d9c; pass/fail counts not captured)

@trunk-io

trunk-io Bot commented Nov 17, 2026

Copy link
Copy Markdown

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

Thanks for this pull request, @Masashi-Ono0611. Here is how we handle outside pull requests, so you know what to expect:

  • Documentation people read (not files agents load, such as SKILL.md or AGENTS.md) can be merged as it is, after we check every link, command and install step in it.
  • Small, plainly correct fixes (under about 40 lines not counting tests, such as an error message or a typo) are taken even when the gain is small. We rebuild them on current master and credit you as co-author: the commit says Contributed by @Masashi-Ono0611 and carries a Co-Authored-By: trailer with your name. We land at most one of these a day, so it can take a few days.
  • Everything else, including all other code and anything that runs, we read as a detailed bug report. When we take it, we rebuild it on current master with the same credit.

When we rebuild a change, we close this PR with a link to the PR that landed it. When we don't take one, we close it with a short note saying why and what would change our answer. So apart from documentation, "closed, not merged" is the normal outcome and doesn't mean your work was turned down.

For a larger change, show us:

  • a way to reproduce the problem on current master, or a failing test;
  • what goes wrong for someone using gbrain because of it;
  • the version you saw it on (gbrain version).

A limit of 3 open pull requests applies only to someone whose recent pull requests have mostly been closed without being taken. It never applies to anyone who has had a pull request taken (merged or rebuilt) in the last 90 days.

More in CONTRIBUTING.md, "How an outside pull request is handled": https://github.com/garrytan/gbrain/blob/master/CONTRIBUTING.md#how-an-outside-pull-request-is-handled

This comment comes from the fix-wave gate check. It is red on every outside pull request by design, and a maintainer clears it when merging a documentation change.

…arrytan#9636)

Related to garrytan#9636

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@capy-ai

capy-ai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Thanks @Masashi-Ono0611, and thanks @frxiaobei for the report in #9636. We rebuilt this fix on current master with a test that fails first, in #9710, which supersedes this PR and credits you as first fixer. This PR will be closed when #9710 lands.

capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
…rts (GBRA-633) (#9710)

Fixes three tests that turned the nightly red on busy runners (#6040) and five small bugs, three of them from outside reports, each rebuilt on master with a test that fails first.
Why: a green nightly, and outside reports with a real repro fixed quickly.
Nothing to do: no settings, defaults, migrations, CLI flags or MCP fields change.

#9683: `gbrain reindex --synopsis` sweeps pages that choose the synopsis tier in their own trusted frontmatter, instead of saying "Nothing to do". Reported and first fixed by @Masashi-Ono0611.
#9696: Ollama's "connection refused" 4xx while its runner restarts is a retryable error. Reported by @benswinney; first fixed by @Masashi-Ono0611.
#9636: on a managed brain, `add_link` records a Chronicle decision only when an automatic extraction is pending. Reported by @frxiaobei; first fixed by @Masashi-Ono0611.
Supersedes #9697
Supersedes #9685
Supersedes #9639

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: Masashi-Ono0611 <98894508+Masashi-Ono0611@users.noreply.github.com>
Co-authored-by: garrytan <garrytan@gmail.com>
@github-actions

Copy link
Copy Markdown

Thank you, @Masashi-Ono0611. Pull request #9710 (Fix three nightly flakes and five small bugs, three from outside reports (GBRA-633)) merged into master and supersedes this PR, so the change it proposed has landed there.

I'm closing this PR because nothing is left for it to land, not because anything was wrong with it. If part of it didn't make it into #9710, reply here with what's missing and why it matters.

This comment comes from the fix-wave closeout workflow.

@github-actions github-actions Bot closed this Nov 18, 2026
@capy-ai

capy-ai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

The fix for #9636 landed on master in 4fb1613 (#9710), with credit to you as first fixer and to @frxiaobei for the report. Closing this PR as superseded. Thanks!

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