Skip to content

feat(directive_detection): Path A intent-prefix filter (#374) - #467

Merged
robotrocketscience merged 2 commits into
mainfrom
feat/issue-374-directive-detection-path-a
May 7, 2026
Merged

feat(directive_detection): Path A intent-prefix filter (#374)#467
robotrocketscience merged 2 commits into
mainfrom
feat/issue-374-directive-detection-path-a

Conversation

@yoshi280

@yoshi280 yoshi280 commented May 7, 2026

Copy link
Copy Markdown
Collaborator

What

Implements the Path A intent-prefix filter ratified on issue #374 (2026-05-07). Adds a head-position lexical pre-filter to detect_directive() so imperative coding-task verbs short-circuit to False unless a rule-marker connective is also present. Targets the monolithic FP cluster identified against lab corpus v0.1 (P=0.664 / R=0.937) — imperative-grammar one-shot coding tasks like "Refactor X so it never blocks" that the 29-verb regex misclassifies.

Why

The H1 enforcement gate is P ≥ 0.80 ∧ R ≥ 0.60 ∧ n ≥ 200. Current measurement is below the precision floor with 23 percentage points of recall headroom — the iteration is a precision problem. Failure-mode analysis on the 45 FPs showed a single dominant cluster: imperatives the user issues to the agent for the immediate session, not durable rules. Path A isolates that cluster on a structural property (head-verb position) without weakening the imperative bank or breaking determinism.

Changes

  • src/aelfrice/directive_detector.py (+34, -1)
    • Add _CODING_TASK_PREFIX_VERBS (16 verbs) and _CODING_TASK_PREFIX_PATTERN (anchored regex).
    • Add _RULE_MARKER_CONNECTIVES (empty per feat(hook): directive detection — #199 H1 split (deferred, bench-gated) #374 decision) and _RULE_MARKER_PATTERN (precompiled to None when the list is empty so the hot path skips the search).
    • Insert filter step 5 in detect_directive() between hedge check and verb check; short-circuit to False when prefix matches and no connective is registered or present.
    • Update docstring to enumerate the new filter step.
  • tests/test_directive_detector.py (+47)
    • test_directive_coding_task_prefix_short_circuits — 16 rows, one per head-position verb. Each embeds a downstream imperative-bank verb so the row would pass under the pre-Path-A detector if the short-circuit weren't applied; load-bearing for the new branch.
    • test_directive_prefix_filter_does_not_swallow_rules — regression: rules with a non-coding-task head verb (always, never, must, only, before) still classify True.

Decision provenance

All four iteration-spec asks ratified on the issue thread (2026-05-07):

Ask Resolution
Iteration target Path A
Verb bank (16) Confirmed as proposed
Rule-marker connectives Empty list — coding-task prefix always wins
Lab corpus v0.1 → lab main Done

Verification

  • Sanity tests: uv run pytest tests/test_directive_detector.py — 39 passed.
  • Full suite: uv run pytest — 2616 passed, 41 skipped, no regressions.
  • Two atomic signed commits (feat(directive_detection): + test(directive_detection):).
  • Discretion grep on the diff: clean.

Out of scope

  • process_directive, the TODO lifecycle, the repetition counter, the escalation table, hook wiring. All gated on the bench gate passing per docs/v2_enforcement.md § H1.
  • Corpus authoring (lab-side per directory-of-origin rules).
  • Verb-bank expansion in the existing 29-imperative regex. Path A composes with it; this PR does not modify it.

Closes / refs

Refs #374, #199 (umbrella). Does not close #374 — that requires a passing bench-gate run against AELFRICE_CORPUS_ROOT/directive_detection/v0_1.jsonl (now landed on lab main) demonstrating P ≥ 0.80 ∧ R ≥ 0.60 ∧ n ≥ 200. Lab-side closing PR strikes the H1 row from docs/V2_REENTRY_QUEUE.md and posts the bench numbers in the PR body.

Summary by Sourcery

Introduce a head-position coding-task prefix filter to improve directive detection precision while preserving durable rule detection.

New Features:

  • Add a coding-task intent-prefix filter in directive detection that short-circuits one-shot coding commands even when downstream imperative verbs are present.

Enhancements:

  • Document the new prefix-filter step in the directive detector workflow and keep rule-marker connective wiring in place for future iterations.

Tests:

  • Add parametrized tests ensuring coding-task prefix phrases no longer classify as directives and that non-coding-task deontic rule statements continue to be detected as directives.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved directive detection to exclude common coding-task imperatives (such as "Refactor," "Add," "Write," "Build") at the beginning of sentences from being classified as directives unless specific rule markers are present.
  • Tests

    • Added comprehensive test coverage for the updated directive detection logic, including case-insensitive prefix filtering and regression scenarios.

Pre-filter the leading clause: imperative coding-task verbs in head position
short-circuit detect_directive() to False unless a rule-marker connective is
also present. Targets the dominant FP cluster from lab corpus v0.1
(P=0.664 / R=0.937) — imperative-grammar one-shot coding tasks like
"Refactor X so it never blocks" or "Add a test that ensures …" that fire on
the 29-verb regex but encode session tasks, not durable rules.

Verb bank (16 head-position verbs, ratified 2026-05-07 on #374):
  refactor, add, implement, write, create, update, fix, make, build,
  remove, rename, extract, merge, split, move, delete.

Rule-marker connective list: empty (ratified 2026-05-07). Coding-task prefix
always wins on first iteration; expand only with corpus evidence. The pattern
is precompiled to None when the list is empty so the hot path skips the
search.

Spec: docs/v2_directive_detection.md (PR #466). Iteration target is precision;
recall has 23 percentage points of headroom over the 0.60 floor.

Closes the iteration-spec gap; does not close #374. Re-entry still requires
P≥0.80 ∧ R≥0.60 ∧ n≥200 from a lab-side bench-gate run against
AELFRICE_CORPUS_ROOT/directive_detection/v0_1.jsonl.
Two parametrized test functions:

- test_directive_coding_task_prefix_short_circuits — 16 rows, one per
  head-position verb in the ratified bank. Each row deliberately embeds a
  downstream imperative-bank verb (never, ensure, must, only, avoid, …)
  so the test would have passed under the pre-Path-A detector if the
  short-circuit weren't applied; the row is load-bearing for the new
  branch.

- test_directive_prefix_filter_does_not_swallow_rules — regression: durable
  rules with a non-coding-task head verb (always, never, must, only,
  before) still classify True. Confirms the prefix filter is positional,
  not a verb-bank shrinker.

39 sanity tests pass locally (full suite: 2616 pass, 41 skip).
@yoshi280 yoshi280 added the attn:review Needs review (PR open, awaiting reviewer) label May 7, 2026
@sourcery-ai

sourcery-ai Bot commented May 7, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a Path A intent-prefix filter to detect_directive() to suppress one-shot coding-task imperatives when they appear as head-position verbs, along with tests that ensure the new prefix filter short-circuits non-durable coding tasks while preserving durable rule detection.

Class diagram for directive_detector module with Path A prefix filter

classDiagram
    class directive_detector {
        <<module>>
        +_CODING_TASK_PREFIX_VERBS : tuple~str~
        +_CODING_TASK_PREFIX_PATTERN : re.Pattern~str~
        +_RULE_MARKER_CONNECTIVES : tuple~str~
        +_RULE_MARKER_PATTERN : re.Pattern~str~ | None
        +_HEDGE_PATTERN : re.Pattern~str~
        +_VERB_PATTERN : re.Pattern~str~
        +detect_directive(text: str) bool
    }

    class _CODING_TASK_PREFIX_VERBS_details {
        <<value>>
        refactor
        add
        implement
        write
        create
        update
        fix
        make
        build
        remove
        rename
        extract
        merge
        split
        move
        delete
    }

    directive_detector --> _CODING_TASK_PREFIX_VERBS_details : defines
Loading

Flow diagram for updated detect_directive intent-prefix filter

flowchart TD
    start([Start detect_directive])
    strip[Strip input text]
    empty{Is text empty or whitespace?}
    question{Matches question pattern?}
    narration{Matches narration pattern?}
    hedge{Matches hedge pattern?}
    prefix{Matches _CODING_TASK_PREFIX_PATTERN at head?}
    ruleMarkerConfigured{Is _RULE_MARKER_PATTERN configured?}
    ruleMarkerPresent{Does _RULE_MARKER_PATTERN match?}
    verbMatch{Matches _VERB_PATTERN?}
    trueResult([Return True])
    falseResult([Return False])

    start --> strip --> empty
    empty -- Yes --> falseResult
    empty -- No --> question

    question -- Yes --> falseResult
    question -- No --> narration

    narration -- Yes --> falseResult
    narration -- No --> hedge

    hedge -- Yes --> falseResult
    hedge -- No --> prefix

    prefix -- No --> verbMatch
    prefix -- Yes --> ruleMarkerConfigured

    ruleMarkerConfigured -- No --> falseResult
    ruleMarkerConfigured -- Yes --> ruleMarkerPresent

    ruleMarkerPresent -- No --> falseResult
    ruleMarkerPresent -- Yes --> verbMatch

    verbMatch -- Yes --> trueResult
    verbMatch -- No --> falseResult
Loading

File-Level Changes

Change Details Files
Introduce Path A head-position coding-task prefix filter in directive detection to short-circuit non-durable imperatives while keeping connective-based override hooks.
  • Define a bank of 16 head-position coding-task verbs and compile an anchored, case-insensitive regex that matches them at the start of the text.
  • Add rule-marker connective scaffolding with a precompiled pattern that is None when the connective list is empty so the hot path doesn’t pay a regex cost.
  • Insert a new filter step in detect_directive() between hedge and verb checks to return False when the coding-task prefix matches and no rule-marker connective is present, and update the function docstring to document the new step.
src/aelfrice/directive_detector.py
Extend directive detector tests to cover the Path A prefix filter behavior and guard against regressions on durable rules.
  • Add a parameterized test suite where each sample starts with a coding-task prefix verb and contains a downstream imperative-bank verb, asserting they now classify as non-directives (False).
  • Add a parameterized regression test ensuring deontic-rule sentences with non-coding-task head verbs still classify as directives (True), validating that the prefix filter is head-position sensitive and does not swallow valid rules.
tests/test_directive_detector.py

Assessment against linked issues

Issue Objective Addressed Explanation
#374 Implement the full H1 directive-detection hook: detect_directive(), process_directive(), and the TODO lifecycle (auto-creating TODO-tagged beliefs from directives, repetition detection, escalation) as described in docs/v2_enforcement.md. The PR only modifies detect_directive() by adding the Path A intent-prefix filter and corresponding tests. It explicitly declares process_directive, the TODO lifecycle, repetition counter, escalation table, and hook wiring as out of scope, so the full H1 hook is not implemented.
#374 Satisfy the H1 benchmark gate by achieving and publishing ≥80% precision and ≥60% recall on a labeled corpus of at least 200 coding prompts, and documenting the sample location (e.g., directive_corpus.jsonl). The PR is an iteration aimed at improving precision (Path A filter) but does not include any benchmark run or results, nor corpus publication. The PR body states that closing the gate and updating docs (e.g., V2_REENTRY_QUEUE.md) will be done in a separate lab-side PR after a passing bench-gate run.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2de5123d-6799-40f9-94f4-feae778122f8

📥 Commits

Reviewing files that changed from the base of the PR and between 84499c4 and ff7ba63.

📒 Files selected for processing (2)
  • src/aelfrice/directive_detector.py
  • tests/test_directive_detector.py

📝 Walkthrough

Walkthrough

This PR adds a coding-task intent-prefix filter to detect_directive that prevents sentence-initial coding imperatives ("Refactor…", "Add…", "Write…") from being classified as durable directives unless a rule-marker connective is present. Configuration and regex patterns support the new filter step; tests verify both the short-circuit behavior and that non-coding-task directives remain unaffected.

Changes

Coding-Task Prefix Filter

Layer / File(s) Summary
Configuration & Contract
src/aelfrice/directive_detector.py
Introduces _CODING_TASK_PREFIXES tuple with verbs like "refactor", "add", "write", "build" and compiles regex pattern to match at string start; adds _RULE_MARKER_CONNECTIVES tuple (currently empty) and optional _RULE_MARKER_PATTERN to gate the prefix filter.
Core Implementation
src/aelfrice/directive_detector.py
Updates detect_directive docstring to document prefix filter as step 5; implements early-return logic that checks if stripped text starts with a coding-task prefix and returns False unless a rule-marker connective matches (or pattern is None).
Test Coverage
tests/test_directive_detector.py
Adds parametrized test test_directive_coding_task_prefix_short_circuits with multiple coding-task-prefixed cases asserting False return; adds regression test test_directive_prefix_filter_does_not_swallow_rules with imperative rules not in the coding-task bank asserting True return.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • robotrocketscience/aelfrice#377: Both PRs modify the detect_directive implementation in src/aelfrice/directive_detector.py; this PR adds a prefix-filter gate to the original imperative-verb detection introduced in #377.

Suggested labels

attn:review

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: implementing a Path A intent-prefix filter for directive detection, directly addressing issue #374.
Description check ✅ Passed The description comprehensively covers all required sections: summary of changes, verification steps, decision provenance, scope boundaries, and linked issues with clear explanation of why the PR does not close #374.
Linked Issues check ✅ Passed The PR fully implements the Path A iteration specified in #374: adds the 16-verb coding-task prefix filter with empty rule-marker connectives, includes comprehensive test coverage for the new filter logic and regression cases, and defers closing the issue pending benchmark-gate validation.
Out of Scope Changes check ✅ Passed All changes are narrowly scoped to the Path A implementation: the directive detection prefix filter and supporting tests. Out-of-scope items (process_directive, TODO lifecycle, corpus authoring, verb-bank expansion) are appropriately deferred.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-374-directive-detection-path-a

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/aelfrice/directive_detector.py" line_range="102-105" />
<code_context>
+    "fix", "make", "build", "remove", "rename", "extract",
+    "merge", "split", "move", "delete",
+)
+_CODING_TASK_PREFIX_PATTERN = re.compile(
+    r"^\s*(?:" + "|".join(_CODING_TASK_PREFIX_VERBS) + r")\b",
+    re.IGNORECASE,
+)
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Escape the verbs when building the prefix pattern to future‑proof against special regex characters.

Currently this is safe because all verbs are simple alphabetic tokens, but if a future verb includes regex metacharacters (e.g. `C++`, `.net`, or a hyphen), the pattern could behave incorrectly. To make this robust, build the alternation with `"|".join(re.escape(v) for v in _CODING_TASK_PREFIX_VERBS)` as you did for `_RULE_MARKER_CONNECTIVES`.

```suggestion
_CODING_TASK_PREFIX_PATTERN = re.compile(
    r"^\s*(?:" + "|".join(re.escape(v) for v in _CODING_TASK_PREFIX_VERBS) + r")\b",
    re.IGNORECASE,
)
```
</issue_to_address>

### Comment 2
<location path="tests/test_directive_detector.py" line_range="55-64" />
<code_context>
+# Regression: leading deontic anchors and durable rules where the head verb
+# is NOT in the coding-task bank still classify True. The prefix filter is
+# case-insensitive but positional, and only fires on the head verb.
+@pytest.mark.parametrize(
+    "text",
+    [
+        "always update the changelog before tagging",
+        "never delete a worktree without releasing the claim first",
+        "must rename the temp file before commit",
+        "only merge after the gate passes",
+        "before merging, ensure CI is green",
+    ],
+)
+def test_directive_prefix_filter_does_not_swallow_rules(text: str) -> None:
+    assert detect_directive(text) is True
</code_context>
<issue_to_address>
**suggestion (testing):** Consider adding cases with leading whitespace/punctuation before the coding-task verb to lock in the intended anchoring behavior.

The `_CODING_TASK_PREFIX_PATTERN` already supports leading whitespace, but the current parametrization only covers verbs at column 0. Adding a couple of cases like `"   refactor X so it never blocks"` or `"\tAdd a test that ensures …"` would validate that the prefix filter still behaves correctly with common leading-whitespace formats and guard against regressions if the regex is changed later.
</issue_to_address>

### Comment 3
<location path="tests/test_directive_detector.py" line_range="57-66" />
<code_context>
+# case-insensitive but positional, and only fires on the head verb.
+@pytest.mark.parametrize(
+    "text",
+    [
+        "always update the changelog before tagging",
+        "never delete a worktree without releasing the claim first",
+        "must rename the temp file before commit",
+        "only merge after the gate passes",
+        "before merging, ensure CI is green",
+    ],
+)
+def test_directive_prefix_filter_does_not_swallow_rules(text: str) -> None:
+    assert detect_directive(text) is True
</code_context>
<issue_to_address>
**suggestion (testing):** Add negative controls where coding-task verbs appear non-initially so we prove the filter is strictly head-position based.

Since `detect_directive` is explicitly head-verb positional, add a few cases where a non-coding verb appears first and the coding-task verb appears later (e.g. `"before merging, add a test that ensures …"`). These should still be `True` to validate that the filter only keys off the head verb and ignores non-head occurrences of coding-task verbs.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +102 to +105
_CODING_TASK_PREFIX_PATTERN = re.compile(
r"^\s*(?:" + "|".join(_CODING_TASK_PREFIX_VERBS) + r")\b",
re.IGNORECASE,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Escape the verbs when building the prefix pattern to future‑proof against special regex characters.

Currently this is safe because all verbs are simple alphabetic tokens, but if a future verb includes regex metacharacters (e.g. C++, .net, or a hyphen), the pattern could behave incorrectly. To make this robust, build the alternation with "|".join(re.escape(v) for v in _CODING_TASK_PREFIX_VERBS) as you did for _RULE_MARKER_CONNECTIVES.

Suggested change
_CODING_TASK_PREFIX_PATTERN = re.compile(
r"^\s*(?:" + "|".join(_CODING_TASK_PREFIX_VERBS) + r")\b",
re.IGNORECASE,
)
_CODING_TASK_PREFIX_PATTERN = re.compile(
r"^\s*(?:" + "|".join(re.escape(v) for v in _CODING_TASK_PREFIX_VERBS) + r")\b",
re.IGNORECASE,
)

Comment on lines +55 to +64
@pytest.mark.parametrize(
"text",
[
"Refactor X so it never blocks",
"Add a test that ensures the gate fires",
"Implement the parser so it must reject empty input",
"Write a guard that always returns False on the empty case",
"Create a wrapper that should not propagate exceptions",
"Update the README so it only mentions the public API",
"Fix the pre-push hook to avoid bypassing on rebase",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Consider adding cases with leading whitespace/punctuation before the coding-task verb to lock in the intended anchoring behavior.

The _CODING_TASK_PREFIX_PATTERN already supports leading whitespace, but the current parametrization only covers verbs at column 0. Adding a couple of cases like " refactor X so it never blocks" or "\tAdd a test that ensures …" would validate that the prefix filter still behaves correctly with common leading-whitespace formats and guard against regressions if the regex is changed later.

Comment on lines +57 to +66
[
"Refactor X so it never blocks",
"Add a test that ensures the gate fires",
"Implement the parser so it must reject empty input",
"Write a guard that always returns False on the empty case",
"Create a wrapper that should not propagate exceptions",
"Update the README so it only mentions the public API",
"Fix the pre-push hook to avoid bypassing on rebase",
"Make the worker shutdown ensure no half-flushed batches",
"Build a fixture that requires the v0.1 corpus path",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Add negative controls where coding-task verbs appear non-initially so we prove the filter is strictly head-position based.

Since detect_directive is explicitly head-verb positional, add a few cases where a non-coding verb appears first and the coding-task verb appears later (e.g. "before merging, add a test that ensures …"). These should still be True to validate that the filter only keys off the head verb and ignores non-head occurrences of coding-task verbs.

@yoshi280

yoshi280 commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

[claim:review:Gylf:2026-05-07T20:14:52Z]

@yoshi280

yoshi280 commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

[claim:review:Toug:2026-05-07T20:14:59Z]

@yoshi280

yoshi280 commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

[release:review:Toug:2026-05-07T20:15:04Z]

@yoshi280

yoshi280 commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

[claim:review:Setr:2026-05-07T20:16:32Z]

@yoshi280

yoshi280 commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

[release:review:Setr:2026-05-07T20:16:37Z]

@robotrocketscience
robotrocketscience merged commit ff7ba63 into main May 7, 2026
28 of 34 checks passed
@robotrocketscience
robotrocketscience deleted the feat/issue-374-directive-detection-path-a branch May 7, 2026 20:16
@yoshi280

yoshi280 commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

Merged via FF push (no merge commit). Both commits signed, all green CI checks, discretion grep clean.

Non-blocking nit (post-merge, for future awareness): one short-circuit row in test_directive_coding_task_prefix_short_circuits"Add a test that ensures the gate fires" — claims to be load-bearing for the new branch, but \bensure\b won't match ensures (word-boundary fails on the trailing s), so under the pre-Path-A detector this row already classified False (no verb match anywhere). The test still passes — just the inline docstring overstates load-bearing for that row. The other 15 rows are genuinely load-bearing (each has a non-prefix-position bank verb that matches: never, must, always, should not, only, avoid, ensure, requires, before, cannot, unless, after, whenever).

Worth fixing in a follow-up only if the row inventory changes.

@yoshi280

yoshi280 commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

[release:review:Gylf:2026-05-07T20:17:00Z]

@yoshi280 yoshi280 removed the attn:review Needs review (PR open, awaiting reviewer) label May 7, 2026
robotrocketscience added a commit that referenced this pull request Aug 5, 2026
…ding (#1341)

Both docs carried P=0.664 as the detector's standing measurement. That was the
pre-Path-A number; Path A shipped in #467 and the confirming re-run this memo
asked for never happened. The shipped detector measures P=0.706 / R=0.937, and
Path A removed 8 false positives rather than the ~45 estimated.

The larger correction is that the gate cannot presently certify anything: v0.1
separates its classes by opening vocabulary, so head-position rules buy free
precision. Records the measurement, replaces the monolithic-cluster failure
analysis with the six families actually present, and makes corpus v0.2 the
blocking item ahead of any further detector iteration.
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.

feat(hook): directive detection — #199 H1 split (deferred, bench-gated)

2 participants