Skip to content

fix(query): normalize terminal workflow language - #641

Merged
mohanagy merged 1 commit into
nextfrom
agent/issue-631-terminal-language
Aug 2, 2026
Merged

fix(query): normalize terminal workflow language#641
mohanagy merged 1 commit into
nextfrom
agent/issue-631-terminal-language

Conversation

@mohanagy

@mohanagy mohanagy commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • normalize only complete, unquoted natural-language finished report and done report workflow terminals
  • preserve protected-base behavior for identifiers, active operations, compound terminals, and locator precedence
  • classify only the observed pipeline-orchestration recovery wording as a workflow
  • record immutable beta.6 publication and manual-qualification failure history, plus the exact unpublished corrective package receipt

Core Reset contract

  • Target: protected next only
  • Parent: 66b795e76a76c6946b85e5eb878e3f576b4e3dbb
  • Candidate head: 8c21c687adce70a483073c5406e0e5b1356cfaea
  • Candidate tree: 5ffed3bc25cb537aafd3bb905ed9df08a7143d69
  • Production delta: +68/-68/net 0, one existing source file
  • Replacement: 1,424 source LOC / 60,995 emitted bytes
  • Package: 102 files / 155,330 packed / 654,008 unpacked bytes
  • No dependency, lockfile, package-version, graph/index/schema, CLI, or MCP change
  • No npm publication, stable/latest change, GitHub Release, Registry metadata, tag, or main
  • [P0][Quality]: Gate no-fallback retrieval against 0.32, beta.4, pinned Graphify, and control #631 remains open; this PR does not claim the final comparator or zero-fallback qualification

Verification

  • Node 22 coverage: 83 files / 957 tests; all thresholds pass
  • Node 20: 83 files / 957 tests, typecheck, build, build:eval, isolation pass
  • Exact frozen GoValidate prompt, done, five controls, and recovery: ready 7/7 with identical 9-file / 12-excerpt / 20-hop evidence
  • 516-question differential: zero unexpected planner differences
  • Frozen issue [P0][Retrieval]: Plan obligations and return strict answer-ready workflow dossiers #630 benchmark: 14/14 ready; 100-sample warm p95 3.55 ms
  • Packed CLI/application/MCP parity passes
  • Registry validation, release hygiene, audit, eval regression, baseline contract, isolation, and diff hygiene pass

Relates to #631.

Summary by CodeRabbit

  • Bug Fixes

    • Improved package receipt selection for terminal-language corrective releases.
    • Enhanced query planning for finished reports, compound terminals, workflow questions, and recovery scenarios.
    • Improved retrieval coverage for report-generation queries and broad prompts.
  • Documentation

    • Updated beta.6 release records, roadmap, scorecard, and design documentation with publication details and qualification status.
    • Clarified that beta.6 failed manual qualification and that subsequent release promotion remains restricted.
  • Tests

    • Expanded coverage for query planning, package parity checks, governance records, and retrieval obligations.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change refines workflow query planning, records beta.6 publication and qualification outcomes, defines an unpublished terminal-language corrective candidate, and prioritizes that candidate in package measurement and replacement receipt resolution.

Changes

Query planning normalization

Layer / File(s) Summary
Workflow and report query planning
src/domain/query/plan.ts, tests/unit/query-plan.test.ts, tests/unit/retrieve-v2-contract-gaps.test.ts
Internal planning helpers are renamed. Orchestrated-flow intent and finished/done report terminal handling are added. Tests cover workflow obligations, compound terminals, recovery queries, and locator precedence.

Beta.6 corrective governance

Layer / File(s) Summary
Publication records and corrective contract
docs/core-reset/*, docs/designs/2026-07-19-core-reset.md, docs/roadmap.md, tests/unit/core-reset-governance.test.ts
Governance records beta.6 as published with failed installed-package qualification. The terminal-language corrective candidate includes measurements, parity, frozen-graph evidence, source scope, and publication restrictions.
Corrective receipt resolution
.github/scripts/verify-packed-retrieval-parity.mjs, tools/eval/core-reset/verify-isolation.mjs, tests/unit/benchmark-suite-isolation-docs.test.ts
Receipt lookups prefer terminal_language_corrective measurements before existing corrective fallbacks. The parity test checks the new candidate path.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: core-reset

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: normalizing terminal workflow language in query planning.
Description check ✅ Passed The description clearly covers behavior, scope, Core Reset history, issue status, and verification results, despite missing some template headings and checkboxes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/issue-631-terminal-language

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/domain/query/plan.ts`:
- Line 196: Restrict the recovery predicate in the query classification logic to
match only the canonical observed pipeline-orchestration wording, rather than
any “where is/are/was/were … flow|workflow|pipeline orchestrated” variant.
Preserve the existing locator classification precedence for all other query
forms and leave downstream retrieval behavior unchanged.

In `@tests/unit/core-reset-governance.test.ts`:
- Around line 2626-2631: Strengthen the terminal corrective measurement
assertions in the test around TERMINAL_LANGUAGE_BASE: recompute both production
and test diffs, verify the allowed paths and --numstat values match the
manifest’s 68/68/0 measurement and test_sources allowlist, and compute the
binary diff SHA-256 to compare with diff_sha256. Keep the existing
src/domain/query/plan.ts path assertion, but ensure stale or unrecorded changes
cannot satisfy terminal_language_corrective.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: edb8829a-1f2d-40be-a01a-bcc1f803ee4a

📥 Commits

Reviewing files that changed from the base of the PR and between 66b795e and 8c21c68.

📒 Files selected for processing (11)
  • .github/scripts/verify-packed-retrieval-parity.mjs
  • docs/core-reset/removal-manifest.yml
  • docs/core-reset/scorecard.md
  • docs/designs/2026-07-19-core-reset.md
  • docs/roadmap.md
  • src/domain/query/plan.ts
  • tests/unit/benchmark-suite-isolation-docs.test.ts
  • tests/unit/core-reset-governance.test.ts
  • tests/unit/query-plan.test.ts
  • tests/unit/retrieve-v2-contract-gaps.test.ts
  • tools/eval/core-reset/verify-isolation.mjs

Comment thread src/domain/query/plan.ts
Comment thread tests/unit/core-reset-governance.test.ts
@mohanagy

mohanagy commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Exact-head independent-review and merge-gate receipt

  • Target: protected next; current protected base 66b795e76a76c6946b85e5eb878e3f576b4e3dbb, tree ff57246a55e51459836946d6b5b9853d0cdcc372
  • Reviewed head: 8c21c687adce70a483073c5406e0e5b1356cfaea
  • Reviewed tree: 5ffed3bc25cb537aafd3bb905ed9df08a7143d69
  • Sole parent: 66b795e76a76c6946b85e5eb878e3f576b4e3dbb
  • Exact-head CI: all six required jobs passed in https://github.com/mohanagy/madar/actions/runs/30753189853
  • CodeRabbit: status passed. Its two actionable threads were verified against the contract, answered with evidence, and resolved without changing the reviewed head; zero unresolved review threads remain. The walkthrough also reports a non-blocking docstring-coverage warning, not a required repository gate.
  • Independent semantic review: no blocker; 39 adversarial terminal and intent cases had zero unexpected changes, with explicit identifier, active operation, compound terminal, final/complete, and locator controls preserved.
  • Independent test/spec review: no blocker; 145 focused tests passed, the 516-question differential produced only the 96 authorized finished/done normalizations and 9 authorized recovery promotions, and the isolated packed real-GoValidate matrix was ready 7/7 with identical 9-file / 12-excerpt / 20-hop evidence.
  • Independent governance review: no blocker; exact ancestry, source delta/hash, package receipt, protected-target boundary, isolation, parity, and non-publication constraints were verified.

The exact head is clean and mergeable. This receipt claims no npm publication, GitHub Release, Registry metadata, tag, stable/latest change, final #631 comparison, or main change. Issue #631 remains open.

@mohanagy
mohanagy merged commit e84d266 into next Aug 2, 2026
7 checks passed
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