Skip to content

Rank far-future facts by when they were written, keep one fundraise tag per deal, and refuse hidden remember item keys (GST-3170) - #9833

Merged
capy-ai[bot] merged 45 commits into
masterfrom
capy/facts-wave-3170
Nov 20, 2026
Merged

capy-ai[bot] merged 45 commits into
masterfrom
capy/facts-wave-3170

Conversation

@garrytan

Copy link
Copy Markdown
Owner

Newest-first fact reads no longer let a fact dated years ahead hold the top of the list, the fact extractor files a deal's round amounts under one fundraise tag, and a narrower tool surface can no longer pass a hidden remember parameter inside an items entry.
Why: these three fact-quality fixes from GST-3170 make entity facts, recall and the deal trajectory honest, and close a gap in starter-surface confinement.
Nothing to do for users; nothing re-extracts and stored facts keep their labels.

What changed
  • Far-future facts: entity facts, fact lists, the relevance pool's entity reads, question refresh and the call-off window rank a fact whose valid_from is in the future by its created_at. The single-entity reads (listFactsByEntity, the relevance pool's active entity arm) run as two index-ordered branches merged in SQL. On a 100k-fact entity a plain CASE sort measured 28 ms against 0.05 ms for the index scan, and the split keeps the index scan. The multi-entity reads (= ANY) sorted anyway on master.
  • One tag per deal: normalizeExtractedMetricLabel folds the extractor's round and deal-amount labels (seed_round, series_a, round_size, deal_amount_usd) into fundraise. Valuation, share price, cap, ownership, count, runway, loan, interest and target labels never fold, and Facts-fence labels are kept as written. The extractor's system prompt is byte-identical (its pinned hashes pass).
  • Hidden remember item keys: itemParamKeys holds each items[] key of remember to the same surface check as a top-level parameter, in both paramNotOnSurface and the dispatch render check, refused with param_not_on_surface "(in an item)".
  • Test only: a remote write's private-rows notice counts only active rows.
Scope and what moved to the follow-up
  • This is part 1 of GST-3170 (the scope agreed with GBRA-108, P1). Items 1 and 3 and the extractor-prompt line of item 2 go to a second PR, sized with the GBRA-574 harness before any spend.
  • The R94 check (on a test brain, the owner-bound credential reads the new private facts through recall, query, entity and hot memory) belongs to item 1, so it runs in that second PR. This PR adds no private facts.
  • Stored slot ends (item 4) were built, reviewed and taken out: one stored end on a fact cannot follow each reader's trust floor, quarantine and private-row access, and the second-model review reproduced an untrusted fact hiding a trusted one. Item 4 needs a read-time design, so it goes back to GBRA-108.
  • Item 5 (owner attribution) needs stored data or a setting that does not exist yet, so it waits on a product decision.
Tests
  • test/facts-future-valid-from-gst3170.test.ts (PGLite and Postgres, listed in test/postgres-unit-arms.txt): red on master.
  • test/facts-extract-deal-metric-gst3170.test.ts: folds and never-folds, red without the extractor change.
  • test/surface-param-confinement-9669.test.ts: a starter client's typed-claim key inside items, red without the src/mcp change.
  • test/import-hidden-rows-gst3170.test.ts: red when the active-row filter is removed.
  • SQL-text goldens regenerated for listFactsByEntity (test/fixtures/goldens/sql-text).
Agent notes
  • gstack: ok 1.101.0.0 for=ship. The review plan as printed: specialists (testing, security, state machines), red team, adversarial, second-model review on GPT-6.1 Sol, and a targeted money read. One round, VERIFY: clean briefs=5 outputs=5. All CRITICAL findings were about stored slot ends, which this PR no longer carries. The index cost and the over-broad label fold were fixed in the one fix round. Left as notes: per-item content_origin is refused on starter as at the top level since Remote read-only starter clients can read soft-deleted pages via include_deleted (fullSurfaceOnly param not enforced) #9669, though the batch hint lists it; acquisition deal_size labels fold rarely.
  • Guards: page-body readers ok (716 rows); core world reads ok (load_config 108, process_env 577, fs_import 566, module_collection 255, spawn_import 119, process_global 55, als_store 47); raw-SQL ratchet ok (5679 sites in 1218 files); remote-read-floor 2 pass (17 expects); canonical-writer-inventory 4 pass (1260 expects); verify 103/103; typecheck clean; export-surface golden pass.
  • Fragments: changelog.d/capy-facts-wave-3170.md; behavior-changes.d/far_future_fact_rank_gst3170.md, extracted_deal_label_fundraise_gst3170.md, remember_item_params_on_surface_gst3170.md (all kind: fix).

Open in Capy

garrytan and others added 23 commits November 19, 2026 14:07
…s (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…els into fundraise (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… reads (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…aces too (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ll commands, no crash line on inspect, doctor re-checks the host skill list

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… so every reader sees the old value end (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…of failing the write (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…es and Postgres arm in their inventories (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-running full setup

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…L.C. as LLC; judge restricted pages in the engine scope (GST-3127)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…he scoped check

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…y lets it load; bound doctor's skills list probe at 20 s

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…olicy lets the plugin load

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…tials never read as a title

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…blish at once, keep the newest-first fact scans on their index, and stop folding runway, loan and target labels into fundraise (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ng does

The owner-only tests built their engines without the connect-time version
read, so on a snapshot-restored PGLite or a cloned Postgres brain the
restricted-page check fell back to treating every page as owner-only.
The two new owner-only tests also wrote the source config as a JSON
string on Postgres; they now write a real JSON object.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…w each reader's trust floor and access, so they go to a follow-up (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…art instead of matching or merging it, and keep managed imports as read (GST-3170)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 6 commits November 19, 2026 16:35
…approved

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ules at their previewed prefix

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…6143)

The race hunt planned each shard at 55 minutes of tests while the shards of
the 2026-11-19 nightly took 30 to 45 minutes with setup, so the 3-iteration
floor filled long before the runners did. Re-mine the stress iteration
weights from that night's 24 shard logs, and schedule the files listed in
test/postgres-unit-arms.txt before the importers of changed helpers, so a
widely imported helper can no longer push listed arms out of the night.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… comment (193, not 167)

Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan and others added 16 commits November 19, 2026 22:08
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…page writes strip U+0000

Frontmatter parsing now removes U+0000 for page writes, which also reached two
readers that must not change:

- Rename identity (S-51) read a frontmatter title holding U+0000 with the character
  removed. Such a title reads as no value again, so the pair takes the
  unconfirmed-rename path and never matches a page with the plain title. A lone
  surrogate still reads as no value, as before.
- The skill resolver's module graph gained src/core/text-safe.ts through
  data-frontmatter.ts. The helper now lives in data-frontmatter.ts itself, so the
  resolver loads exactly the modules it loaded before.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai capy-ai Bot added the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 20, 2026
@github-actions github-actions Bot removed the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 20, 2026
@capy-ai
capy-ai Bot merged commit a90156b into master Nov 20, 2026
216 of 217 checks passed
garrytan added a commit that referenced this pull request Nov 20, 2026
This was referenced Nov 20, 2026
@capy-ai
capy-ai Bot deleted the capy/facts-wave-3170 branch November 21, 2026 17:14
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