Files
gbrain/test/fixtures/conversation-formats/adversarial.jsonl
T
041d89babe v0.41.29.0 feat(conversation-parser): bold-name-no-time builtin + fix(orphans): source-scoped orphan_ratio (supersedes #1613) (#1620)
* feat(conversation-parser): add bold-name-no-time builtin (Circleback/Granola/Zoom, no timestamp)

The 14th built-in pattern parses `**Speaker:** text` transcripts with NO
per-line timestamp — the shape Circleback / Granola / Zoom emit. Every prior
builtin required a time anchor, so this shape matched nothing: a production
brain had 104 conversation pages + 3,423 eligible pages silently extracting
zero facts. Messages anchor at T00:00:00Z of the frontmatter date (no
fabricated wall-clock; line order preserves sequence), same convention as
irc-classic.

Hardening beyond the original community proposal:
- regex `/^\*\*(?!\[)(.+?):\*\*\s*(.*)$/`: the colon-inside-bold (NOT
  declaration order) is what prevents shadowing bold-paren-time; the `(?!\[)`
  lookahead rejects telegram-bracket `**[18:37] Name:**` so disabling
  telegram-bracket yields an honest no_match instead of speaker="[18:37] Name".
- new optional PatternEntry.score_full_body: `**Label:** text` is a common
  prose idiom, so a notes page with bold labels clustered in its first 10
  lines scored 0.3 on the head pass (NOT < SCORING_HEAD_TRIGGER_THRESHOLD, so
  the full-body fallback never fired) and cleared the 0.05 floor. parse.ts now
  recomputes the winner's score over the full body before the floor, so such a
  page drops to its true low density and stays no_match.
- scrubbed pre-existing real names from bold-paren-time test_positive samples
  (privacy rule).

Fixtures use placeholder names only. Pinned by new bold-name-no-time +
clustered-head no_match cases in parse.test.ts and the eval corpus.

Co-Authored-By: garrytan-agents <noreply@github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(orphans): scope orphan_ratio + find_orphans by source; fix total_linkable denominator

`gbrain doctor --source <id>` and `gbrain orphans --source <id>` now scope
the orphan scan to that source instead of reporting brain-wide. Three fixes:

- findOrphanPages(opts?: { sourceId?, sourceIds? }) on both engines scopes the
  CANDIDATE set (scalar `= $1` or federated `= ANY($1::text[])`). Inbound links
  from ANY source still count, so a page in source X linked FROM source Y is
  reachable and NOT an orphan of X (the deliberate, less-surprising definition).
- corrected the total_linkable denominator in findOrphans: it now enumerates
  all live pages (scoped) and subtracts every excluded-by-slug page, not just
  excluded orphans. The old `total - excludedOrphans` left excluded NON-orphan
  pages (templates/, scratch/) with inbound links in the denominator, inflating
  it and suppressing warnings. Changes orphan_ratio output for every brain, in
  the accurate direction.
- the find_orphans MCP op threads sourceScopeOpts(ctx), closing a cross-source
  read leak where a source-bound OAuth client saw brain-wide orphans (v0.34.1
  source-isolation class).

doctor uses an explicit `--source` flag parse (NOT resolveSourceWithTier, which
would scope bare invocations to a default), and under explicit --source reports
the ratio with a low-scale caveat below 100 entity pages instead of a vacuous
"ok". Thin-client doctor --source orphan_ratio deferred (TODOS.md).

Pinned by test/orphans-source-scope.test.ts (PGLite: scoping, cross-source
inbound, denominator, find_orphans op scope) + a Postgres↔PGLite parity case
in test/e2e/engine-parity.test.ts (scalar + federated binding).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: v0.41.29.0 — bold-name-no-time + orphan source scoping

VERSION + package.json → 0.41.29.0; CHANGELOG entry; CLAUDE.md conversation-parser
(13→14 patterns) + orphans source-scoping notes; regenerated llms bundles; TODOS
for thin-client doctor --source + check-test-real-names widening.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: garrytan-agents <noreply@github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 07:06:08 -07:00

7 lines
7.8 KiB
JSON

{"fixture_id":"adversarial-recipe","pattern":null,"frontmatter":{"date":"2024-03-15"},"body":"Chocolate Chip Cookies\n\nIngredients:\n- 2 cups flour\n- 1 cup sugar\n- 1 cup chocolate chips\n\nInstructions:\nMix dry ingredients. Add wet. Bake at 375 for 12 minutes.","expected_messages":0,"expected_participants":[]}
{"fixture_id":"adversarial-readme","pattern":null,"frontmatter":{"date":"2024-03-15"},"body":"# My Project\n\nA short description.\n\n## Install\n\n```\nnpm install my-project\n```\n\n## Usage\n\nImport the package and call the function.","expected_messages":0,"expected_participants":[]}
{"fixture_id":"adversarial-code","pattern":null,"frontmatter":{"date":"2024-03-15"},"body":"function add(a, b) {\n return a + b;\n}\n\nconst result = add(1, 2);\nconsole.log(result);","expected_messages":0,"expected_participants":[]}
{"fixture_id":"adversarial-lyrics","pattern":null,"frontmatter":{"date":"2024-03-15"},"body":"Twinkle twinkle little star\nHow I wonder what you are\nUp above the world so high\nLike a diamond in the sky","expected_messages":0,"expected_participants":[]}
{"fixture_id":"adversarial-json","pattern":null,"frontmatter":{"date":"2024-03-15"},"body":"{\n \"key\": \"value\",\n \"num\": 42,\n \"list\": [1, 2, 3]\n}","expected_messages":0,"expected_participants":[]}
{"fixture_id":"adversarial-bold-labels-clustered-head","pattern":null,"frontmatter":{"date":"2026-05-28"},"body":"**Attendees:** Alice Example, Bob Example, Participant 2\n**Date:** 2026-05-28\n**Goal:** decide on the Q3 roadmap and unblock the vendor migration\nThis is an ordinary prose sentence number 0 describing the meeting in detail.\nThis is an ordinary prose sentence number 1 describing the meeting in detail.\nThis is an ordinary prose sentence number 2 describing the meeting in detail.\nThis is an ordinary prose sentence number 3 describing the meeting in detail.\nThis is an ordinary prose sentence number 4 describing the meeting in detail.\nThis is an ordinary prose sentence number 5 describing the meeting in detail.\nThis is an ordinary prose sentence number 6 describing the meeting in detail.\nThis is an ordinary prose sentence number 7 describing the meeting in detail.\nThis is an ordinary prose sentence number 8 describing the meeting in detail.\nThis is an ordinary prose sentence number 9 describing the meeting in detail.\nThis is an ordinary prose sentence number 10 describing the meeting in detail.\nThis is an ordinary prose sentence number 11 describing the meeting in detail.\nThis is an ordinary prose sentence number 12 describing the meeting in detail.\nThis is an ordinary prose sentence number 13 describing the meeting in detail.\nThis is an ordinary prose sentence number 14 describing the meeting in detail.\nThis is an ordinary prose sentence number 15 describing the meeting in detail.\nThis is an ordinary prose sentence number 16 describing the meeting in detail.\nThis is an ordinary prose sentence number 17 describing the meeting in detail.\nThis is an ordinary prose sentence number 18 describing the meeting in detail.\nThis is an ordinary prose sentence number 19 describing the meeting in detail.\nThis is an ordinary prose sentence number 20 describing the meeting in detail.\nThis is an ordinary prose sentence number 21 describing the meeting in detail.\nThis is an ordinary prose sentence number 22 describing the meeting in detail.\nThis is an ordinary prose sentence number 23 describing the meeting in detail.\nThis is an ordinary prose sentence number 24 describing the meeting in detail.\nThis is an ordinary prose sentence number 25 describing the meeting in detail.\nThis is an ordinary prose sentence number 26 describing the meeting in detail.\nThis is an ordinary prose sentence number 27 describing the meeting in detail.\nThis is an ordinary prose sentence number 28 describing the meeting in detail.\nThis is an ordinary prose sentence number 29 describing the meeting in detail.\nThis is an ordinary prose sentence number 30 describing the meeting in detail.\nThis is an ordinary prose sentence number 31 describing the meeting in detail.\nThis is an ordinary prose sentence number 32 describing the meeting in detail.\nThis is an ordinary prose sentence number 33 describing the meeting in detail.\nThis is an ordinary prose sentence number 34 describing the meeting in detail.\nThis is an ordinary prose sentence number 35 describing the meeting in detail.\nThis is an ordinary prose sentence number 36 describing the meeting in detail.\nThis is an ordinary prose sentence number 37 describing the meeting in detail.\nThis is an ordinary prose sentence number 38 describing the meeting in detail.\nThis is an ordinary prose sentence number 39 describing the meeting in detail.\nThis is an ordinary prose sentence number 40 describing the meeting in detail.\nThis is an ordinary prose sentence number 41 describing the meeting in detail.\nThis is an ordinary prose sentence number 42 describing the meeting in detail.\nThis is an ordinary prose sentence number 43 describing the meeting in detail.\nThis is an ordinary prose sentence number 44 describing the meeting in detail.\nThis is an ordinary prose sentence number 45 describing the meeting in detail.\nThis is an ordinary prose sentence number 46 describing the meeting in detail.\nThis is an ordinary prose sentence number 47 describing the meeting in detail.\nThis is an ordinary prose sentence number 48 describing the meeting in detail.\nThis is an ordinary prose sentence number 49 describing the meeting in detail.\nThis is an ordinary prose sentence number 50 describing the meeting in detail.\nThis is an ordinary prose sentence number 51 describing the meeting in detail.\nThis is an ordinary prose sentence number 52 describing the meeting in detail.\nThis is an ordinary prose sentence number 53 describing the meeting in detail.\nThis is an ordinary prose sentence number 54 describing the meeting in detail.\nThis is an ordinary prose sentence number 55 describing the meeting in detail.\nThis is an ordinary prose sentence number 56 describing the meeting in detail.\nThis is an ordinary prose sentence number 57 describing the meeting in detail.\nThis is an ordinary prose sentence number 58 describing the meeting in detail.\nThis is an ordinary prose sentence number 59 describing the meeting in detail.\nThis is an ordinary prose sentence number 60 describing the meeting in detail.\nThis is an ordinary prose sentence number 61 describing the meeting in detail.\nThis is an ordinary prose sentence number 62 describing the meeting in detail.\nThis is an ordinary prose sentence number 63 describing the meeting in detail.\nThis is an ordinary prose sentence number 64 describing the meeting in detail.\nThis is an ordinary prose sentence number 65 describing the meeting in detail.\nThis is an ordinary prose sentence number 66 describing the meeting in detail.\nThis is an ordinary prose sentence number 67 describing the meeting in detail.\nThis is an ordinary prose sentence number 68 describing the meeting in detail.\nThis is an ordinary prose sentence number 69 describing the meeting in detail.\nThis is an ordinary prose sentence number 70 describing the meeting in detail.\nThis is an ordinary prose sentence number 71 describing the meeting in detail.\nThis is an ordinary prose sentence number 72 describing the meeting in detail.\nThis is an ordinary prose sentence number 73 describing the meeting in detail.\nThis is an ordinary prose sentence number 74 describing the meeting in detail.\nThis is an ordinary prose sentence number 75 describing the meeting in detail.\nThis is an ordinary prose sentence number 76 describing the meeting in detail.\nThis is an ordinary prose sentence number 77 describing the meeting in detail.\nThis is an ordinary prose sentence number 78 describing the meeting in detail.\nThis is an ordinary prose sentence number 79 describing the meeting in detail.","expected_messages":0,"expected_participants":[]}