Skip to content

Facts block shows a later retraction next to the fact it takes back (GBRA-574) - #9633

Closed
garrytan wants to merge 6 commits into
masterfrom
gbra574-b5-retractions
Closed

garrytan wants to merge 6 commits into
masterfrom
gbra574-b5-retractions

Conversation

@garrytan

@garrytan garrytan commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

When the facts block shows a fact, it now also shows a later fact from the same source about the same entity that takes it back or calls it off ("that trip fell through", "I was wrong about…"), right after the fact it answers and with its own date.
Why: answers kept stating plans and claims the user had later cancelled, because the cancellation never made it into the context.
Nothing to do: this is a read-side change only, with no new setting, and dev can't measure it, so the sealed run decides.

How a retraction is found
  • Cue: the later fact matches a short, literal cue list: the existing retraction words from saved-facts-match.ts (now exported, value unchanged) plus rumour/rumor, called off, cancelled/canceled, fell through, not happening, never happened, no longer planned. The list is not configurable.
  • Negation guard: a cue doesn't count when not, never, no or an n't contraction sits a word or two before it, so "not cancelled", "wasn't called off", "never cancelled" and "isn't a rumour" never pair. Only the words before the cue are checked, so cues that start with a negation ("not happening", "never happened", "no longer planned") still count. The negation words are fixed, not configurable.
  • Pairing: same source and entity, dated strictly later, and either the same slot (dimension and value, unchanged) or a close word match. Leaving out name words and cue words, either every word of the retraction appears in the fact (and it has at least one), or the two share at least two words. So "the trip fell through" and "the Lisbon trip was called off" pair with "plans a trip to Lisbon", but "Berlin concert tickets were cancelled" no longer pairs with "moved to Berlin".
  • Read policy: candidates come only through the facts block's existing pool predicate (visibility, private provenance and member scope, trust floor, source scope), so a retraction the caller can't read never shows. Withdrawn facts never appear.
  • Budget: a retraction takes a row and tokens from the facts block's existing budget. One already in the block moves into place instead of taking a second row. If the read fails, the block stays as it was.
  • It writes nothing: no proposals, no ledger change, no extraction change, no model call.
Tests

Tests are in test/facts-block-retractions-gbra574.test.ts and its Postgres arm test/e2e/facts-block-retractions-gbra574-postgres.test.ts.

Five tests fail before the fix and pass after it:

  • a later retraction that shares a term is placed right after the fact
  • a retraction with the same conversation slot attaches even with no shared term
  • the repo-less brain gets the same behaviour
  • a private retraction is hidden from remote callers
  • a retraction filed on a member's own page reaches only that member

Six guards cover cases the code must never change. Breaking the code on purpose makes each one fail:

  • a "cancelled" sentence about another entity does not attach
  • a fact about the same entity with no shared term and no shared slot does not attach
  • a retraction dated before the fact does not attach
  • with no cue, the output is unchanged
  • a withdrawn retraction never appears
  • a withdrawn fact never appears

Precision tests (commit 04c265d, red before e7822ab and green after):

  • a negated cue ("confirmed the trip is not cancelled") does not pair, checked in laterRetractions and in the rendered block
  • cues after "wasn't", "never" or "isn't a" do not pair
  • a retraction sharing one word with the fact and adding words of its own (the concert case) does not pair, checked in laterRetractions and in the block

Guards that stay green, and that fail when their rule is removed on purpose: "the trip fell through" pairs (all its words are in the fact), a two-word overlap pairs and moves under its fact once, and "not happening", "never happened" and "no longer planned" still pair.

Agent notes

GBRA-574 B5, approved by GBRA-108 ("go B5") under Garry's letter E. The ready block will say "dev can't measure this; the sealed run decides". Notes for review:

  • the inherited RETRACTION words include "disregard" and "ignore …", which are broad
  • each retraction is placed once, after the first fact it answers
  • core-search-2.md is now at its 60,000-byte cap
  • Precision fix (GBRA-108's request, after reproducing two false pairs): one changed expectation. Nina's "plans a trip." plus "the trip to Riga in June fell through" shares only "trip", so it no longer pairs and the retraction stays at its own date. The move-under-the-fact case is now covered by a two-word fixture.
  • True retractions the tightened rule now misses: (1) a retraction that names the plan with one shared word and adds detail the fact lacks, like "the trip to Riga in June fell through" against "plans a trip", or "the trip fell through because of the strike" against "plans a trip to Lisbon"; (2) one that names the plan with a different word ("the journey was cancelled" against "trip"), which also never paired before; (3) a retraction whose cue sits right after a negation but still retracts, like "the trip was not only cancelled but refunded". The same-slot path still pairs all of these when the two facts share a slot.

Open in Capy

garrytan and others added 3 commits November 17, 2026 07:56
…ow the fact it answers (GBRA-574 B5)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…f (GBRA-574 B5)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@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

Review-Finding: p1/specialist-batched#2 reader=red-team
Review-Finding: p1/specialist-batched#3 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review November 17, 2026 08:39
garrytan and others added 2 commits November 17, 2026 08:55
…term overlap should not pair (GBRA-574 B5)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…match (GBRA-574 B5)

A cue a word or two after not, never, no or an n't contraction no longer pairs, and a retraction pairs on words only when all of its words are in the fact or it shares two with it. The same-slot path is unchanged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot added a commit that referenced this pull request Nov 17, 2026
…only folders; owner agents read more private facts; retractions shown with facts; silent Postgres connections freed; unzip-free install; 5 flaky tests; macOS helper pre-merge rule (#9627)

Eight changes land together: this branch holds the seven pull requests listed with it, each merged unchanged, and its tree is the one the full test runs passed on.

- Held private facts (#9645, GST-2900): a private fact that an agent restated as world, and that waits for the owner's accept, stays hidden from callers who cannot read the private copy in think, in the reply to the held write, and when the restatement is written onto another page about the same entity. A credential with a private-facts grant reads held rows again on page reads and search when it can read every copy the row restates. Known, not fixed here: recall, query, entity and context_pack still show a held row to such a grant, and a member reads a held row on its own page.
- Untrack (#9640, GST-2964): `gbrain git commit-push --untrack` in a managed checkout takes every tracked file under a declared, ignored database-only folder, .json included, and refuses any file whose untracking would let the next sync delete a page. On PGLite, stop a running `gbrain serve` or sync first, because every managed untrack now reads the brain.
- Owner reads (#9643, GST-2951): the brain owner's own remote agents see the owner's private facts on the entity card, in the facts search and query attach, in the list of facts saved without an entity, and in forget's similar-facts check. Every other caller reads what it read before.
- Retractions (#9633): the facts block shows a later fact from the same source that takes an earlier one back, right after the fact it answers and with its own date.
- Postgres connections (#9644): a discarded connection frees its pool slot when the server or pooler has gone silent, and the job worker survives a server that refuses connections while shutting down. Reported and first fixed by @javieraldape (#9624).
- Install guides (#9642, GST-2970): every install guide says Bun's installer needs unzip and gives a tested route for machines without it.
- Flaky tests (#9626): five tests no longer depend on the clock, query order, a 1 ms lease or a reused port; one was a real bug where a large `gbrain capture --file` could name one day in its slug and the next in its receipt.
- Pre-merge check (#9627): the check accepts the macOS helper's Swift files, which build and test only on a Mac; every other changed file still needs a Linux test run.

Supersedes #9624

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: javieraldape <6430563+javieraldape@users.noreply.github.com>
Co-authored-by: garrytan <garrytan@gmail.com>
@capy-ai

capy-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Landed on master inside the group commit 43a26be (pull request #9627) at 2026-11-17T14:25Z. This branch's head was merged into that group unchanged, and the group's tree passed the full Test and E2E runs (44096307024, 44096311434). Closing this pull request as landed.

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