Skip to content

feat(brief): quote reStructuredText documentation sections - #1214

Merged
navidemad merged 18 commits into
mainfrom
brief/1200-docs-rst
Oct 18, 2026
Merged

navidemad merged 18 commits into
mainfrom
brief/1200-docs-rst

Conversation

@navidemad

@navidemad navidemad commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1200

Stack (L7, #906): #1208 (#1201) ← #1209 (#1196) ← #1210 (#1197) ← #1211 (#1198) ← this PR (#1200). Base: brief/1198-flow-chain. GitHub links Closes #1200 only once the PR targets main.

Summary

On the live hook budget (#1201), documentation oracle lines are already covered at 9.2 % on main (the issue's 2 % came from the starved brief command route), and the doc-sections probe is the docs pack. Its remaining blind spot: it split only Markdown. Projects documented in reStructuredText never had a section quoted, for example requests (docs/api.rst, docs/user/advanced.rst) and flask (docs/config.rst). Underlined .rst titles now make sections too.

 doc-sections
-  git ls-files *.md *.mdx           -> sections by "#" headings
+  git ls-files *.md *.mdx *.rst     -> .rst: a title line followed by a rule of one punctuation char, at least as long
+                                       (a transition rule after a blank line is not a title)
   rank sections by the prompt's words (unchanged), show the best two

Evidence

  • Before → after, frozen-probe harness, same binary (main 7887b9e6). Probes frozen at 31086a92 (brief: flow/impact pack — the call chain with hop bodies (flow 7%, impact 6%) #1198) vs 4cd7de05:

    python3 -I scripts/bench/tool-census/score_brief.py pinned --base <pixel @7887b9e6> \
      --probe-commit 31086a92 --head-probe-commit 4cd7de05 --label ab-1200 --root /tmp/pixel-906-baseline
    before after
    docs oracle lines 320/3 488 (9.2 %) 371/3 488 (10.6 %)
    all: file_recall / region_cov / line 0.436 / 0.099 / 14.3 % 0.447 / 0.105 / 14.7 %
    config category file_recall 0.310 0.370

    7 sessions gain and none lose: requests-03 0.26 → 0.37 line (file recall 0.67 → 1.00), requests-08 0.05 → 0.10, flask-03 0.15 → 0.19, plus requests-02, requests-04, flask-02, flask-07. The base reproduces brief: flow/impact pack — the call chain with hop bodies (flow 7%, impact 6%) #1198's head exactly (56/56). requests-01's 240 lines of docs/api.rst stay unquoted: no heading there carries two of the question's words.

  • Test that fails without the change. probes/doc-sections/tests/test_probe.py (3 cases: the matching .rst section is quoted with its exact range, a transition rule is no title, Markdown unchanged). Against the previous probe:

    FAIL: test_an_underlined_rst_title_is_a_section_and_the_matching_one_is_quoted
    FAILED (failures=1)
    
  • probe-test.py --guard on 21 overview, config and lookup prompts: the only refusals are oracle path stems (CHANGELOG, HISTORY, CHANGES) from the probe's existing SKIP list, identical on the previous probe. --check-all: ok.

  • Not run: the live Codex A/B.

Merge Danger

Door: one-way for installs (pixel setup rewrites ~/.pixel/plugins/doc-sections/); a revert ships the old copy back on the next setup.

Blast radius: low. Same gating and the same two-section limit; it only gains .rst candidates, and it appends.

Docs touched

.github/changelog.d/doc-sections-rst.changed.md, docs/bench/brief-public-acceptance-2026-10-17/README.md (pack table). ARCHITECTURE.md: unchanged.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…dget

score_brief.py gains freeze-home (the probes a binary built at a commit
embeds, hashed), --probe-home, and pinned (two binaries or two probe sets
on frozen homes, then compare). report.json records the probe identity,
the route and the question SHA-256; compare flags runs that differ in more
than one input. The default route is now the prompt-submit hook's
brief-only payload (3 s window, probe floor, all parts): the brief command
gave probes 750 ms and no floor, and config-registry timed out on one run
and not the next.

Refs #906
A test-bodies probe (append, kind tests or a prompt naming tests) quotes
the test cases whose name or body carries the prompt's subject: Python
def test_*, JS it/test, Rust fn under #[test] including inline modules.
Candidates are the test files the brief names, then those whose path
names the subject; word weights come from how many cases carry a word,
not from a word list. Registered in bundled_probes.rs; the install tests
derive their counts from the allowlist.

Closes #1196
…es without quoting it

error-origin ran only on a quoted message, and none of the seven
error-origin questions of the public bench quotes one. It now also takes
the short string literal that carries the most of the prompt's words,
each weighed by how few source lines carry it, with the call and function
that emit the string counted beside it. A string longer than the window
is a manual, not a message; a JSON catalogue entry is followed to the
code that names its key; inline test modules are skipped. CI installs
ripgrep for the probes' own tests.

Closes #1197
…tion names

flow-rank followed the entry the brief's trace guessed, which for 'when I
call requests.get' was auth.py's __call__. It now takes the entry the
question names in code form (a dotted name, snake_case or camelCase) when
the graph defines it: a path holding the leading parts first, a function
before a method, no tests. From a named entry, a level where fewer than two
callees carry the question's words keeps its best three, since a narrow
chain is the path. It also runs for a 'walk me through' prompt the brief
did not classify as flow.

Closes #1198
A run on daemons left in the clones by pixel calls outside the harness
answered 7 of 56 briefs differently from its two replays (an op left
unanswered, flow-rank empty). activate now stops the clone's daemon
before prepare-repo, so every run is served by a daemon it started.

Refs #1201
doc-sections split only Markdown, so a project documented in .rst (flask,
requests) never had a section quoted: requests-01's docs/api.rst and
flask-03's docs/config.rst went unseen. Underlined .rst titles now make
sections too; a transition rule after a blank line is not a title.

Closes #1200
@navidemad
navidemad changed the base branch from brief/1198-flow-chain to main October 18, 2026 17:30
# Conflicts:
#	docs/bench/brief-public-acceptance-2026-10-17/README.md
#	probes/error-origin/probe
#	probes/error-origin/tests/test_probe.py
@navidemad
navidemad merged commit 15ec78d into main Oct 18, 2026
14 checks passed
@navidemad
navidemad deleted the brief/1200-docs-rst branch October 18, 2026 17:39
LivioGama pushed a commit that referenced this pull request Nov 25, 2026
* chore(bench): freeze the probe home and score briefs on the hook's budget

score_brief.py gains freeze-home (the probes a binary built at a commit
embeds, hashed), --probe-home, and pinned (two binaries or two probe sets
on frozen homes, then compare). report.json records the probe identity,
the route and the question SHA-256; compare flags runs that differ in more
than one input. The default route is now the prompt-submit hook's
brief-only payload (3 s window, probe floor, all parts): the brief command
gave probes 750 ms and no floor, and config-registry timed out on one run
and not the next.

Refs #906

* feat(brief): quote the bodies of the tests a tests question asks about

A test-bodies probe (append, kind tests or a prompt naming tests) quotes
the test cases whose name or body carries the prompt's subject: Python
def test_*, JS it/test, Rust fn under #[test] including inline modules.
Candidates are the test files the brief names, then those whose path
names the subject; word weights come from how many cases carry a word,
not from a word list. Registered in bundled_probes.rs; the install tests
derive their counts from the allowlist.

Closes #1196

* docs(bench): record the test-bodies pack on the frozen-probe harness

Refs #1196

* feat(brief): find the origin of an error message the question describes without quoting it

error-origin ran only on a quoted message, and none of the seven
error-origin questions of the public bench quotes one. It now also takes
the short string literal that carries the most of the prompt's words,
each weighed by how few source lines carry it, with the call and function
that emit the string counted beside it. A string longer than the window
is a manual, not a message; a JSON catalogue entry is followed to the
code that names its key; inline test modules are skipped. CI installs
ripgrep for the probes' own tests.

Closes #1197

* docs(bench): record the error-origin pack on the frozen-probe harness

Refs #1197

* feat(brief): start a walkthrough's call chain from the entry the question names

flow-rank followed the entry the brief's trace guessed, which for 'when I
call requests.get' was auth.py's __call__. It now takes the entry the
question names in code form (a dotted name, snake_case or camelCase) when
the graph defines it: a path holding the leading parts first, a function
before a method, no tests. From a named entry, a level where fewer than two
callees carry the question's words keeps its best three, since a narrow
chain is the path. It also runs for a 'walk me through' prompt the brief
did not classify as flow.

Closes #1198

* chore(bench): stop a clone's leftover daemon before scoring on it

A run on daemons left in the clones by pixel calls outside the harness
answered 7 of 56 briefs differently from its two replays (an op left
unanswered, flow-rank empty). activate now stops the clone's daemon
before prepare-repo, so every run is served by a daemon it started.

Refs #1201

* docs(bench): record the flow-rank named-entry pack on the frozen-probe harness

Refs #1198

* feat(brief): quote reStructuredText documentation sections

doc-sections split only Markdown, so a project documented in .rst (flask,
requests) never had a section quoted: requests-01's docs/api.rst and
flask-03's docs/config.rst went unseen. Underlined .rst titles now make
sections too; a transition rule after a blank line is not a title.

Closes #1200

* docs(bench): record the reStructuredText doc-sections pack on the frozen-probe harness

Refs #1200

* test(setup): list the test-bodies probe in the setup goldens and agents data

Refs #1196
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.

brief: docs pack — README/docs sections matching the prompt (docs 2%)

1 participant