♻️ Migrate operational review documents from Show to built-in <If> - #406

Merged
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration
Aug 9, 2026
Merged

♻️ Migrate operational review documents from Show to built-in <If>#406
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration

Conversation

@taras

@tarastaras commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes#219.

Why

The review library shipped its own Show.md conditional before the engine had
one. <If> is now a native structural directive, so the seven operational
review documents that still invoked Show duplicated engine behavior and let
the review system drift from the language its own specification documents.

The release-order blocker recorded in the original issue is gone:
.github/workflows/review.yml prepares and builds the checked-out revision and
runs ./dist/xmd, so no release or workflow change is involved.

What changes

Before:

<Showwhen={props.pr.stats.totalChanges > 20}>
...
</Show>

After:

<Ifcondition={props.pr.stats.totalChanges > 20}>
...
</If>

Thirteen blocks across seven documents, renamed in place. Bodies, indentation,
line wrapping and surrounding blank lines are unchanged, and
.reviews/components/Show.md is deleted. Finding.md keeps its public when
prop; only its internal element becomes <If condition={props.when}>.

Every migrated condition already evaluates to a boolean and none passed
Show's optional fallback, so no <Else> branch is introduced and #258's
possible truthiness change stays independent of this PR.

How it works

<If> name → expansion engine (before filesystem resolution) → selected branch only

<If> is native, so it is handled by expansion and never resolved from
componentDirs. That is the property the new tests exercise directly: they run
the real operational sources with no If.md or Show.md anywhere in the stub
filesystem.

Review guide

Start with:scripts/tests/review-infrastructure.test.ts

Then review:

  1. The seven .reviews/ documents — a pure tag/prop rename.
  2. retires the Show component from the review library — the static guard.
  3. The five operational tests that execute the real documents.
  4. packages/core/tests/unused-in-diff.test.ts — fixture removal plus an exact
    output assertion.
  5. specs/code-review-agent-spec.md §5.10.

Look carefully at: the exact trimmed-equality assertions. They intentionally
lock the blank lines the migrated tags surround, including the five blank lines
OxlintSummary's two suppressed blocks leave behind.

What must stay true

  • Show is gone from the review library — enforced by deletion and checked by
    retires the Show component from the review library, which walks
    .reviews/**/*.md for an opening or closing Show element, rejects a
    Show.md path, and scans the focused test and the code-review spec. The guard
    asserts the walk found Finding.md first, so it cannot pass vacuously.
  • The structural name wins before filesystem component resolution — checked by
    every operational test, none of which supplies an If or Show component.
  • An unselected branch does no provider work — checked by
    skips the ExtraneousCodePolicy sample below the review threshold.
  • The scan stays scoped. packages/core/tests/expression-props.test.ts uses
    Show as an arbitrary component name and is deliberately untouched.

How to verify it

  • retires the Show component from the review library fails if any .reviews/
    document, the focused test, or the spec still carries Show.
  • renders Finding's selected icon and message and suppresses its false case
    proves exact branch output (🔴 Broken contract.) and an exactly empty false
    case; it fails on a whitespace change inside the migrated block.
  • renders OxlintSummary's clean section and its unavailable warning and
    renders RepoCleanupPolicy's clean section without running either branch
    prove the clean-section and warning paths byte-exactly.
  • suppresses ReleaseSpecWarning for ordinary files and warns on release changes proves both directions of its release-config condition.
  • expands UnusedInDiff and CommentReview to nothing without an If component
    proves CommentReview's typed data component executes (it fetches the PR's
    comments) while both captures and both trailing branches stay empty.
  • skips the ExtraneousCodePolicy sample below the review threshold installs a
    counting Sample provider: 20 changes make zero calls and render the clean
    section, 21 changes make exactly one call and surface the provider result. The
    selected control is what keeps the zero-call case from being vacuous.
  • renders the disclosure with symbol, location, count and reason in
    unused-in-diff.test.ts is now exact trimmed equality over the whole
    disclosure, so summary/table whitespace is locked.

Each new regression was mutation-checked: reverting Finding.md to <Show>
(with Show.md restored), reverting the spec example, widening the
ExtraneousCodePolicy threshold to >= 20, padding Finding's rendered line,
and removing a blank line in UnusedInDiff's table each fail the intended test
and nothing else.

Scope

Included

  • The thirteen-block rename in seven operational documents and the deletion of
    Show.md.
  • Focused regressions in the two suites that own this boundary.
  • §5.10 of the code-review-agent specification.

Intentionally unchanged

  • <If> implementation, syntax, validation, and truthiness semantics (Coerce the <If> condition with JS truthiness #258).
  • specs/executable-mdx-spec.md, which already specifies native <If>/<Else>,
    filesystem precedence, and selected-branch non-execution.
  • .github/workflows/review.yml and every other workflow.
  • packages/core/tests/expression-props.test.ts, where Show is an arbitrary
    component-resolution fixture rather than a review-library claim.
  • UnusedInDiff's selected-disclosure and suppression coverage stays in its own
    suite, because it crosses eval, <Each>, and filesystem fixture boundaries;
    the infrastructure matrix only uses its empty case.

Generated or mechanical changes

  • The seven .reviews/ documents contain no intended behavior change. The only
    cosmetic consequence is in OxlintSummary.md, whose wrapped condition keeps
    its authored continuation indentation and therefore no longer aligns under the
    longer condition={ prefix.

Verification

All required local checks are green on db78a89:

deno task lint 0 errors, formatting clean
deno task check no errors
deno task check:jsr Success Dry run complete
deno task test <3 suites> 11 passed (77 steps), 0 failed
pnpm exec tsx --tsconfig tsconfig.node.json --test <2 suites> 23 pass, 0 fail
bun test <2 suites> 23 pass, 0 fail
git diff --check clean

verify:clean and the full per-runtime suites were not run: this change touches
no dependency state, build purity, test discovery, shared setup, or runtime
adapter. CI owns the exhaustive corpus.

Risks and limitations

  • Local review integration evidence: not run.deno task review:local
    requires a reachable Ollama at localhost:11434 serving
    qwen3:30b-a3b plus GITHUB_TOKEN; neither is available in this
    environment. This PR's own review workflow builds the checked-out source and
    runs ./dist/xmd, so its marked review comment is the end-to-end evidence and
    is a merge blocker if it fails, errors, or posts nothing substantive.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

The review library shipped its own `Show.md` conditional before the engine
had one. `<If>` is now a native structural directive, so the seven operational
documents that still invoked `Show` duplicated engine behavior and let the
review system drift from the documented language.
Rename the thirteen conditional blocks in place — `when` becomes `condition`,
bodies and whitespace are unchanged — and delete `.reviews/components/Show.md`.
None of the conditions had a fallback and every one already evaluates to a
boolean, so no `<Else>` branch is introduced and issue #258's possible
truthiness change stays independent.
Deleting the component and scanning for its tag proves retirement but not
behavior, so the review-infrastructure suite now executes the real sources of
all seven documents with no `If.md` or `Show.md` in the stub filesystem: the
structural name has to win before filesystem component resolution. Compact
outputs and every suppressed case are asserted by exact trimmed equality, which
locks the summary, table, and section whitespace the tags surround.
`ExtraneousCodePolicy.md` carries the provider contract — a counting `Sample`
records zero calls below the review threshold and exactly one above it, so the
empty case is non-execution rather than a probe that never wired up.
@github-actions

Copy link
Copy Markdown

PR #406: ♻️ Migrate operational review documents from Show to built-in

11 files, +339 / -64

Scope

🟡 403 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras

taras commented Aug 9, 2026

Copy link
Copy Markdown
OwnerAuthor

Integration evidence

PR review workflow (required evidence). Run
31308999146,
revision db78a89. It ran deno task setup, deno task build, and
./dist/xmd run .reviews/ReviewPR.md, so the review was produced by this PR's
own engine and its own migrated documents. The posted <!-- xmd-review -->
comment is substantive and contains no ERROR marker.

Two of its sections are direct end-to-end proof of the migration:

  • ### Static Analysis is OxlintSummary.md with all three <If> blocks
    false, rendering only ReviewSection's clean text.
  • ### Correctness is ExtraneousCodePolicy.md with its <If>selected
    (403 changes > 20): the branch reached <Sample>, the provider ran, and the
    model returned No extraneous code patterns detected.

So the same document supplies both directions of the migrated condition in CI —
suppressed locally in the focused regression, selected here against a real
provider.

Local review (deno task review:local): not run..reviews/ReviewPR.local.md
needs Ollama serving qwen3:30b-a3b at localhost:11434 plus GITHUB_TOKEN;
neither was available in the implementation environment. Recorded as a missing
prerequisite, not a test failure.

CI: all checks pass — green, lint, jsr, site, smoke, review,
test-deno, test-node, test-bun, deploy. composability skips by design
(it runs on main only).

@taras
taras marked this pull request as ready for review August 9, 2026 10:55
@taras
taras merged commit 35060af into mainAug 9, 2026
11 checks passed
@taras
taras deleted the agent/issue-219-if-migration branch August 9, 2026 10:55
Sign up for freeto 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.

Migrate operational review documents from Show to built-in <If>

1 participant

@taras
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all \u003cpre\u003e\u003ccode\u003e blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks"); } } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); } })(); (function(){ try { var __m = "github.com"; var __re = new RegExp('^' + "github\\.com" + '
Skip to content

♻️ Migrate operational review documents from Show to built-in <If> - #406

Merged
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration
Aug 9, 2026
Merged

♻️ Migrate operational review documents from Show to built-in <If>#406
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration

Conversation

@taras

@tarastaras commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes#219.

Why

The review library shipped its own Show.md conditional before the engine had
one. <If> is now a native structural directive, so the seven operational
review documents that still invoked Show duplicated engine behavior and let
the review system drift from the language its own specification documents.

The release-order blocker recorded in the original issue is gone:
.github/workflows/review.yml prepares and builds the checked-out revision and
runs ./dist/xmd, so no release or workflow change is involved.

What changes

Before:

<Showwhen={props.pr.stats.totalChanges > 20}>
...
</Show>

After:

<Ifcondition={props.pr.stats.totalChanges > 20}>
...
</If>

Thirteen blocks across seven documents, renamed in place. Bodies, indentation,
line wrapping and surrounding blank lines are unchanged, and
.reviews/components/Show.md is deleted. Finding.md keeps its public when
prop; only its internal element becomes <If condition={props.when}>.

Every migrated condition already evaluates to a boolean and none passed
Show's optional fallback, so no <Else> branch is introduced and #258's
possible truthiness change stays independent of this PR.

How it works

<If> name → expansion engine (before filesystem resolution) → selected branch only

<If> is native, so it is handled by expansion and never resolved from
componentDirs. That is the property the new tests exercise directly: they run
the real operational sources with no If.md or Show.md anywhere in the stub
filesystem.

Review guide

Start with:scripts/tests/review-infrastructure.test.ts

Then review:

  1. The seven .reviews/ documents — a pure tag/prop rename.
  2. retires the Show component from the review library — the static guard.
  3. The five operational tests that execute the real documents.
  4. packages/core/tests/unused-in-diff.test.ts — fixture removal plus an exact
    output assertion.
  5. specs/code-review-agent-spec.md §5.10.

Look carefully at: the exact trimmed-equality assertions. They intentionally
lock the blank lines the migrated tags surround, including the five blank lines
OxlintSummary's two suppressed blocks leave behind.

What must stay true

  • Show is gone from the review library — enforced by deletion and checked by
    retires the Show component from the review library, which walks
    .reviews/**/*.md for an opening or closing Show element, rejects a
    Show.md path, and scans the focused test and the code-review spec. The guard
    asserts the walk found Finding.md first, so it cannot pass vacuously.
  • The structural name wins before filesystem component resolution — checked by
    every operational test, none of which supplies an If or Show component.
  • An unselected branch does no provider work — checked by
    skips the ExtraneousCodePolicy sample below the review threshold.
  • The scan stays scoped. packages/core/tests/expression-props.test.ts uses
    Show as an arbitrary component name and is deliberately untouched.

How to verify it

  • retires the Show component from the review library fails if any .reviews/
    document, the focused test, or the spec still carries Show.
  • renders Finding's selected icon and message and suppresses its false case
    proves exact branch output (🔴 Broken contract.) and an exactly empty false
    case; it fails on a whitespace change inside the migrated block.
  • renders OxlintSummary's clean section and its unavailable warning and
    renders RepoCleanupPolicy's clean section without running either branch
    prove the clean-section and warning paths byte-exactly.
  • suppresses ReleaseSpecWarning for ordinary files and warns on release changes proves both directions of its release-config condition.
  • expands UnusedInDiff and CommentReview to nothing without an If component
    proves CommentReview's typed data component executes (it fetches the PR's
    comments) while both captures and both trailing branches stay empty.
  • skips the ExtraneousCodePolicy sample below the review threshold installs a
    counting Sample provider: 20 changes make zero calls and render the clean
    section, 21 changes make exactly one call and surface the provider result. The
    selected control is what keeps the zero-call case from being vacuous.
  • renders the disclosure with symbol, location, count and reason in
    unused-in-diff.test.ts is now exact trimmed equality over the whole
    disclosure, so summary/table whitespace is locked.

Each new regression was mutation-checked: reverting Finding.md to <Show>
(with Show.md restored), reverting the spec example, widening the
ExtraneousCodePolicy threshold to >= 20, padding Finding's rendered line,
and removing a blank line in UnusedInDiff's table each fail the intended test
and nothing else.

Scope

Included

  • The thirteen-block rename in seven operational documents and the deletion of
    Show.md.
  • Focused regressions in the two suites that own this boundary.
  • §5.10 of the code-review-agent specification.

Intentionally unchanged

  • <If> implementation, syntax, validation, and truthiness semantics (Coerce the <If> condition with JS truthiness #258).
  • specs/executable-mdx-spec.md, which already specifies native <If>/<Else>,
    filesystem precedence, and selected-branch non-execution.
  • .github/workflows/review.yml and every other workflow.
  • packages/core/tests/expression-props.test.ts, where Show is an arbitrary
    component-resolution fixture rather than a review-library claim.
  • UnusedInDiff's selected-disclosure and suppression coverage stays in its own
    suite, because it crosses eval, <Each>, and filesystem fixture boundaries;
    the infrastructure matrix only uses its empty case.

Generated or mechanical changes

  • The seven .reviews/ documents contain no intended behavior change. The only
    cosmetic consequence is in OxlintSummary.md, whose wrapped condition keeps
    its authored continuation indentation and therefore no longer aligns under the
    longer condition={ prefix.

Verification

All required local checks are green on db78a89:

deno task lint 0 errors, formatting clean
deno task check no errors
deno task check:jsr Success Dry run complete
deno task test <3 suites> 11 passed (77 steps), 0 failed
pnpm exec tsx --tsconfig tsconfig.node.json --test <2 suites> 23 pass, 0 fail
bun test <2 suites> 23 pass, 0 fail
git diff --check clean

verify:clean and the full per-runtime suites were not run: this change touches
no dependency state, build purity, test discovery, shared setup, or runtime
adapter. CI owns the exhaustive corpus.

Risks and limitations

  • Local review integration evidence: not run.deno task review:local
    requires a reachable Ollama at localhost:11434 serving
    qwen3:30b-a3b plus GITHUB_TOKEN; neither is available in this
    environment. This PR's own review workflow builds the checked-out source and
    runs ./dist/xmd, so its marked review comment is the end-to-end evidence and
    is a merge blocker if it fails, errors, or posts nothing substantive.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

The review library shipped its own `Show.md` conditional before the engine
had one. `<If>` is now a native structural directive, so the seven operational
documents that still invoked `Show` duplicated engine behavior and let the
review system drift from the documented language.
Rename the thirteen conditional blocks in place — `when` becomes `condition`,
bodies and whitespace are unchanged — and delete `.reviews/components/Show.md`.
None of the conditions had a fallback and every one already evaluates to a
boolean, so no `<Else>` branch is introduced and issue #258's possible
truthiness change stays independent.
Deleting the component and scanning for its tag proves retirement but not
behavior, so the review-infrastructure suite now executes the real sources of
all seven documents with no `If.md` or `Show.md` in the stub filesystem: the
structural name has to win before filesystem component resolution. Compact
outputs and every suppressed case are asserted by exact trimmed equality, which
locks the summary, table, and section whitespace the tags surround.
`ExtraneousCodePolicy.md` carries the provider contract — a counting `Sample`
records zero calls below the review threshold and exactly one above it, so the
empty case is non-execution rather than a probe that never wired up.
@github-actions

Copy link
Copy Markdown

PR #406: ♻️ Migrate operational review documents from Show to built-in

11 files, +339 / -64

Scope

🟡 403 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras

taras commented Aug 9, 2026

Copy link
Copy Markdown
OwnerAuthor

Integration evidence

PR review workflow (required evidence). Run
31308999146,
revision db78a89. It ran deno task setup, deno task build, and
./dist/xmd run .reviews/ReviewPR.md, so the review was produced by this PR's
own engine and its own migrated documents. The posted <!-- xmd-review -->
comment is substantive and contains no ERROR marker.

Two of its sections are direct end-to-end proof of the migration:

  • ### Static Analysis is OxlintSummary.md with all three <If> blocks
    false, rendering only ReviewSection's clean text.
  • ### Correctness is ExtraneousCodePolicy.md with its <If>selected
    (403 changes > 20): the branch reached <Sample>, the provider ran, and the
    model returned No extraneous code patterns detected.

So the same document supplies both directions of the migrated condition in CI —
suppressed locally in the focused regression, selected here against a real
provider.

Local review (deno task review:local): not run..reviews/ReviewPR.local.md
needs Ollama serving qwen3:30b-a3b at localhost:11434 plus GITHUB_TOKEN;
neither was available in the implementation environment. Recorded as a missing
prerequisite, not a test failure.

CI: all checks pass — green, lint, jsr, site, smoke, review,
test-deno, test-node, test-bun, deploy. composability skips by design
(it runs on main only).

@taras
taras marked this pull request as ready for review August 9, 2026 10:55
@taras
taras merged commit 35060af into mainAug 9, 2026
11 checks passed
@taras
taras deleted the agent/issue-219-if-migration branch August 9, 2026 10:55
Sign up for freeto 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.

Migrate operational review documents from Show to built-in <If>

1 participant

@taras
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

♻️ Migrate operational review documents from Show to built-in <If> - #406

Merged
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration
Aug 9, 2026
Merged

♻️ Migrate operational review documents from Show to built-in <If>#406
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration

Conversation

@taras

@tarastaras commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes#219.

Why

The review library shipped its own Show.md conditional before the engine had
one. <If> is now a native structural directive, so the seven operational
review documents that still invoked Show duplicated engine behavior and let
the review system drift from the language its own specification documents.

The release-order blocker recorded in the original issue is gone:
.github/workflows/review.yml prepares and builds the checked-out revision and
runs ./dist/xmd, so no release or workflow change is involved.

What changes

Before:

<Showwhen={props.pr.stats.totalChanges > 20}>
...
</Show>

After:

<Ifcondition={props.pr.stats.totalChanges > 20}>
...
</If>

Thirteen blocks across seven documents, renamed in place. Bodies, indentation,
line wrapping and surrounding blank lines are unchanged, and
.reviews/components/Show.md is deleted. Finding.md keeps its public when
prop; only its internal element becomes <If condition={props.when}>.

Every migrated condition already evaluates to a boolean and none passed
Show's optional fallback, so no <Else> branch is introduced and #258's
possible truthiness change stays independent of this PR.

How it works

<If> name → expansion engine (before filesystem resolution) → selected branch only

<If> is native, so it is handled by expansion and never resolved from
componentDirs. That is the property the new tests exercise directly: they run
the real operational sources with no If.md or Show.md anywhere in the stub
filesystem.

Review guide

Start with:scripts/tests/review-infrastructure.test.ts

Then review:

  1. The seven .reviews/ documents — a pure tag/prop rename.
  2. retires the Show component from the review library — the static guard.
  3. The five operational tests that execute the real documents.
  4. packages/core/tests/unused-in-diff.test.ts — fixture removal plus an exact
    output assertion.
  5. specs/code-review-agent-spec.md §5.10.

Look carefully at: the exact trimmed-equality assertions. They intentionally
lock the blank lines the migrated tags surround, including the five blank lines
OxlintSummary's two suppressed blocks leave behind.

What must stay true

  • Show is gone from the review library — enforced by deletion and checked by
    retires the Show component from the review library, which walks
    .reviews/**/*.md for an opening or closing Show element, rejects a
    Show.md path, and scans the focused test and the code-review spec. The guard
    asserts the walk found Finding.md first, so it cannot pass vacuously.
  • The structural name wins before filesystem component resolution — checked by
    every operational test, none of which supplies an If or Show component.
  • An unselected branch does no provider work — checked by
    skips the ExtraneousCodePolicy sample below the review threshold.
  • The scan stays scoped. packages/core/tests/expression-props.test.ts uses
    Show as an arbitrary component name and is deliberately untouched.

How to verify it

  • retires the Show component from the review library fails if any .reviews/
    document, the focused test, or the spec still carries Show.
  • renders Finding's selected icon and message and suppresses its false case
    proves exact branch output (🔴 Broken contract.) and an exactly empty false
    case; it fails on a whitespace change inside the migrated block.
  • renders OxlintSummary's clean section and its unavailable warning and
    renders RepoCleanupPolicy's clean section without running either branch
    prove the clean-section and warning paths byte-exactly.
  • suppresses ReleaseSpecWarning for ordinary files and warns on release changes proves both directions of its release-config condition.
  • expands UnusedInDiff and CommentReview to nothing without an If component
    proves CommentReview's typed data component executes (it fetches the PR's
    comments) while both captures and both trailing branches stay empty.
  • skips the ExtraneousCodePolicy sample below the review threshold installs a
    counting Sample provider: 20 changes make zero calls and render the clean
    section, 21 changes make exactly one call and surface the provider result. The
    selected control is what keeps the zero-call case from being vacuous.
  • renders the disclosure with symbol, location, count and reason in
    unused-in-diff.test.ts is now exact trimmed equality over the whole
    disclosure, so summary/table whitespace is locked.

Each new regression was mutation-checked: reverting Finding.md to <Show>
(with Show.md restored), reverting the spec example, widening the
ExtraneousCodePolicy threshold to >= 20, padding Finding's rendered line,
and removing a blank line in UnusedInDiff's table each fail the intended test
and nothing else.

Scope

Included

  • The thirteen-block rename in seven operational documents and the deletion of
    Show.md.
  • Focused regressions in the two suites that own this boundary.
  • §5.10 of the code-review-agent specification.

Intentionally unchanged

  • <If> implementation, syntax, validation, and truthiness semantics (Coerce the <If> condition with JS truthiness #258).
  • specs/executable-mdx-spec.md, which already specifies native <If>/<Else>,
    filesystem precedence, and selected-branch non-execution.
  • .github/workflows/review.yml and every other workflow.
  • packages/core/tests/expression-props.test.ts, where Show is an arbitrary
    component-resolution fixture rather than a review-library claim.
  • UnusedInDiff's selected-disclosure and suppression coverage stays in its own
    suite, because it crosses eval, <Each>, and filesystem fixture boundaries;
    the infrastructure matrix only uses its empty case.

Generated or mechanical changes

  • The seven .reviews/ documents contain no intended behavior change. The only
    cosmetic consequence is in OxlintSummary.md, whose wrapped condition keeps
    its authored continuation indentation and therefore no longer aligns under the
    longer condition={ prefix.

Verification

All required local checks are green on db78a89:

deno task lint 0 errors, formatting clean
deno task check no errors
deno task check:jsr Success Dry run complete
deno task test <3 suites> 11 passed (77 steps), 0 failed
pnpm exec tsx --tsconfig tsconfig.node.json --test <2 suites> 23 pass, 0 fail
bun test <2 suites> 23 pass, 0 fail
git diff --check clean

verify:clean and the full per-runtime suites were not run: this change touches
no dependency state, build purity, test discovery, shared setup, or runtime
adapter. CI owns the exhaustive corpus.

Risks and limitations

  • Local review integration evidence: not run.deno task review:local
    requires a reachable Ollama at localhost:11434 serving
    qwen3:30b-a3b plus GITHUB_TOKEN; neither is available in this
    environment. This PR's own review workflow builds the checked-out source and
    runs ./dist/xmd, so its marked review comment is the end-to-end evidence and
    is a merge blocker if it fails, errors, or posts nothing substantive.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

The review library shipped its own `Show.md` conditional before the engine
had one. `<If>` is now a native structural directive, so the seven operational
documents that still invoked `Show` duplicated engine behavior and let the
review system drift from the documented language.
Rename the thirteen conditional blocks in place — `when` becomes `condition`,
bodies and whitespace are unchanged — and delete `.reviews/components/Show.md`.
None of the conditions had a fallback and every one already evaluates to a
boolean, so no `<Else>` branch is introduced and issue #258's possible
truthiness change stays independent.
Deleting the component and scanning for its tag proves retirement but not
behavior, so the review-infrastructure suite now executes the real sources of
all seven documents with no `If.md` or `Show.md` in the stub filesystem: the
structural name has to win before filesystem component resolution. Compact
outputs and every suppressed case are asserted by exact trimmed equality, which
locks the summary, table, and section whitespace the tags surround.
`ExtraneousCodePolicy.md` carries the provider contract — a counting `Sample`
records zero calls below the review threshold and exactly one above it, so the
empty case is non-execution rather than a probe that never wired up.
@github-actions

Copy link
Copy Markdown

PR #406: ♻️ Migrate operational review documents from Show to built-in

11 files, +339 / -64

Scope

🟡 403 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras

taras commented Aug 9, 2026

Copy link
Copy Markdown
OwnerAuthor

Integration evidence

PR review workflow (required evidence). Run
31308999146,
revision db78a89. It ran deno task setup, deno task build, and
./dist/xmd run .reviews/ReviewPR.md, so the review was produced by this PR's
own engine and its own migrated documents. The posted <!-- xmd-review -->
comment is substantive and contains no ERROR marker.

Two of its sections are direct end-to-end proof of the migration:

  • ### Static Analysis is OxlintSummary.md with all three <If> blocks
    false, rendering only ReviewSection's clean text.
  • ### Correctness is ExtraneousCodePolicy.md with its <If>selected
    (403 changes > 20): the branch reached <Sample>, the provider ran, and the
    model returned No extraneous code patterns detected.

So the same document supplies both directions of the migrated condition in CI —
suppressed locally in the focused regression, selected here against a real
provider.

Local review (deno task review:local): not run..reviews/ReviewPR.local.md
needs Ollama serving qwen3:30b-a3b at localhost:11434 plus GITHUB_TOKEN;
neither was available in the implementation environment. Recorded as a missing
prerequisite, not a test failure.

CI: all checks pass — green, lint, jsr, site, smoke, review,
test-deno, test-node, test-bun, deploy. composability skips by design
(it runs on main only).

@taras
taras marked this pull request as ready for review August 9, 2026 10:55
@taras
taras merged commit 35060af into mainAug 9, 2026
11 checks passed
@taras
taras deleted the agent/issue-219-if-migration branch August 9, 2026 10:55
Sign up for freeto 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.

Migrate operational review documents from Show to built-in <If>

1 participant

@taras
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length \u003e 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

♻️ Migrate operational review documents from Show to built-in <If> - #406

Merged
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration
Aug 9, 2026
Merged

♻️ Migrate operational review documents from Show to built-in <If>#406
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration

Conversation

@taras

@tarastaras commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes#219.

Why

The review library shipped its own Show.md conditional before the engine had
one. <If> is now a native structural directive, so the seven operational
review documents that still invoked Show duplicated engine behavior and let
the review system drift from the language its own specification documents.

The release-order blocker recorded in the original issue is gone:
.github/workflows/review.yml prepares and builds the checked-out revision and
runs ./dist/xmd, so no release or workflow change is involved.

What changes

Before:

<Showwhen={props.pr.stats.totalChanges > 20}>
...
</Show>

After:

<Ifcondition={props.pr.stats.totalChanges > 20}>
...
</If>

Thirteen blocks across seven documents, renamed in place. Bodies, indentation,
line wrapping and surrounding blank lines are unchanged, and
.reviews/components/Show.md is deleted. Finding.md keeps its public when
prop; only its internal element becomes <If condition={props.when}>.

Every migrated condition already evaluates to a boolean and none passed
Show's optional fallback, so no <Else> branch is introduced and #258's
possible truthiness change stays independent of this PR.

How it works

<If> name → expansion engine (before filesystem resolution) → selected branch only

<If> is native, so it is handled by expansion and never resolved from
componentDirs. That is the property the new tests exercise directly: they run
the real operational sources with no If.md or Show.md anywhere in the stub
filesystem.

Review guide

Start with:scripts/tests/review-infrastructure.test.ts

Then review:

  1. The seven .reviews/ documents — a pure tag/prop rename.
  2. retires the Show component from the review library — the static guard.
  3. The five operational tests that execute the real documents.
  4. packages/core/tests/unused-in-diff.test.ts — fixture removal plus an exact
    output assertion.
  5. specs/code-review-agent-spec.md §5.10.

Look carefully at: the exact trimmed-equality assertions. They intentionally
lock the blank lines the migrated tags surround, including the five blank lines
OxlintSummary's two suppressed blocks leave behind.

What must stay true

  • Show is gone from the review library — enforced by deletion and checked by
    retires the Show component from the review library, which walks
    .reviews/**/*.md for an opening or closing Show element, rejects a
    Show.md path, and scans the focused test and the code-review spec. The guard
    asserts the walk found Finding.md first, so it cannot pass vacuously.
  • The structural name wins before filesystem component resolution — checked by
    every operational test, none of which supplies an If or Show component.
  • An unselected branch does no provider work — checked by
    skips the ExtraneousCodePolicy sample below the review threshold.
  • The scan stays scoped. packages/core/tests/expression-props.test.ts uses
    Show as an arbitrary component name and is deliberately untouched.

How to verify it

  • retires the Show component from the review library fails if any .reviews/
    document, the focused test, or the spec still carries Show.
  • renders Finding's selected icon and message and suppresses its false case
    proves exact branch output (🔴 Broken contract.) and an exactly empty false
    case; it fails on a whitespace change inside the migrated block.
  • renders OxlintSummary's clean section and its unavailable warning and
    renders RepoCleanupPolicy's clean section without running either branch
    prove the clean-section and warning paths byte-exactly.
  • suppresses ReleaseSpecWarning for ordinary files and warns on release changes proves both directions of its release-config condition.
  • expands UnusedInDiff and CommentReview to nothing without an If component
    proves CommentReview's typed data component executes (it fetches the PR's
    comments) while both captures and both trailing branches stay empty.
  • skips the ExtraneousCodePolicy sample below the review threshold installs a
    counting Sample provider: 20 changes make zero calls and render the clean
    section, 21 changes make exactly one call and surface the provider result. The
    selected control is what keeps the zero-call case from being vacuous.
  • renders the disclosure with symbol, location, count and reason in
    unused-in-diff.test.ts is now exact trimmed equality over the whole
    disclosure, so summary/table whitespace is locked.

Each new regression was mutation-checked: reverting Finding.md to <Show>
(with Show.md restored), reverting the spec example, widening the
ExtraneousCodePolicy threshold to >= 20, padding Finding's rendered line,
and removing a blank line in UnusedInDiff's table each fail the intended test
and nothing else.

Scope

Included

  • The thirteen-block rename in seven operational documents and the deletion of
    Show.md.
  • Focused regressions in the two suites that own this boundary.
  • §5.10 of the code-review-agent specification.

Intentionally unchanged

  • <If> implementation, syntax, validation, and truthiness semantics (Coerce the <If> condition with JS truthiness #258).
  • specs/executable-mdx-spec.md, which already specifies native <If>/<Else>,
    filesystem precedence, and selected-branch non-execution.
  • .github/workflows/review.yml and every other workflow.
  • packages/core/tests/expression-props.test.ts, where Show is an arbitrary
    component-resolution fixture rather than a review-library claim.
  • UnusedInDiff's selected-disclosure and suppression coverage stays in its own
    suite, because it crosses eval, <Each>, and filesystem fixture boundaries;
    the infrastructure matrix only uses its empty case.

Generated or mechanical changes

  • The seven .reviews/ documents contain no intended behavior change. The only
    cosmetic consequence is in OxlintSummary.md, whose wrapped condition keeps
    its authored continuation indentation and therefore no longer aligns under the
    longer condition={ prefix.

Verification

All required local checks are green on db78a89:

deno task lint 0 errors, formatting clean
deno task check no errors
deno task check:jsr Success Dry run complete
deno task test <3 suites> 11 passed (77 steps), 0 failed
pnpm exec tsx --tsconfig tsconfig.node.json --test <2 suites> 23 pass, 0 fail
bun test <2 suites> 23 pass, 0 fail
git diff --check clean

verify:clean and the full per-runtime suites were not run: this change touches
no dependency state, build purity, test discovery, shared setup, or runtime
adapter. CI owns the exhaustive corpus.

Risks and limitations

  • Local review integration evidence: not run.deno task review:local
    requires a reachable Ollama at localhost:11434 serving
    qwen3:30b-a3b plus GITHUB_TOKEN; neither is available in this
    environment. This PR's own review workflow builds the checked-out source and
    runs ./dist/xmd, so its marked review comment is the end-to-end evidence and
    is a merge blocker if it fails, errors, or posts nothing substantive.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

The review library shipped its own `Show.md` conditional before the engine
had one. `<If>` is now a native structural directive, so the seven operational
documents that still invoked `Show` duplicated engine behavior and let the
review system drift from the documented language.
Rename the thirteen conditional blocks in place — `when` becomes `condition`,
bodies and whitespace are unchanged — and delete `.reviews/components/Show.md`.
None of the conditions had a fallback and every one already evaluates to a
boolean, so no `<Else>` branch is introduced and issue #258's possible
truthiness change stays independent.
Deleting the component and scanning for its tag proves retirement but not
behavior, so the review-infrastructure suite now executes the real sources of
all seven documents with no `If.md` or `Show.md` in the stub filesystem: the
structural name has to win before filesystem component resolution. Compact
outputs and every suppressed case are asserted by exact trimmed equality, which
locks the summary, table, and section whitespace the tags surround.
`ExtraneousCodePolicy.md` carries the provider contract — a counting `Sample`
records zero calls below the review threshold and exactly one above it, so the
empty case is non-execution rather than a probe that never wired up.
@github-actions

Copy link
Copy Markdown

PR #406: ♻️ Migrate operational review documents from Show to built-in

11 files, +339 / -64

Scope

🟡 403 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras

taras commented Aug 9, 2026

Copy link
Copy Markdown
OwnerAuthor

Integration evidence

PR review workflow (required evidence). Run
31308999146,
revision db78a89. It ran deno task setup, deno task build, and
./dist/xmd run .reviews/ReviewPR.md, so the review was produced by this PR's
own engine and its own migrated documents. The posted <!-- xmd-review -->
comment is substantive and contains no ERROR marker.

Two of its sections are direct end-to-end proof of the migration:

  • ### Static Analysis is OxlintSummary.md with all three <If> blocks
    false, rendering only ReviewSection's clean text.
  • ### Correctness is ExtraneousCodePolicy.md with its <If>selected
    (403 changes > 20): the branch reached <Sample>, the provider ran, and the
    model returned No extraneous code patterns detected.

So the same document supplies both directions of the migrated condition in CI —
suppressed locally in the focused regression, selected here against a real
provider.

Local review (deno task review:local): not run..reviews/ReviewPR.local.md
needs Ollama serving qwen3:30b-a3b at localhost:11434 plus GITHUB_TOKEN;
neither was available in the implementation environment. Recorded as a missing
prerequisite, not a test failure.

CI: all checks pass — green, lint, jsr, site, smoke, review,
test-deno, test-node, test-bun, deploy. composability skips by design
(it runs on main only).

@taras
taras marked this pull request as ready for review August 9, 2026 10:55
@taras
taras merged commit 35060af into mainAug 9, 2026
11 checks passed
@taras
taras deleted the agent/issue-219-if-migration branch August 9, 2026 10:55
Sign up for freeto 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.

Migrate operational review documents from Show to built-in <If>

1 participant

@taras
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

♻️ Migrate operational review documents from Show to built-in <If> - #406

Merged
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration
Aug 9, 2026
Merged

♻️ Migrate operational review documents from Show to built-in <If>#406
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration

Conversation

@taras

@tarastaras commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes#219.

Why

The review library shipped its own Show.md conditional before the engine had
one. <If> is now a native structural directive, so the seven operational
review documents that still invoked Show duplicated engine behavior and let
the review system drift from the language its own specification documents.

The release-order blocker recorded in the original issue is gone:
.github/workflows/review.yml prepares and builds the checked-out revision and
runs ./dist/xmd, so no release or workflow change is involved.

What changes

Before:

<Showwhen={props.pr.stats.totalChanges > 20}>
...
</Show>

After:

<Ifcondition={props.pr.stats.totalChanges > 20}>
...
</If>

Thirteen blocks across seven documents, renamed in place. Bodies, indentation,
line wrapping and surrounding blank lines are unchanged, and
.reviews/components/Show.md is deleted. Finding.md keeps its public when
prop; only its internal element becomes <If condition={props.when}>.

Every migrated condition already evaluates to a boolean and none passed
Show's optional fallback, so no <Else> branch is introduced and #258's
possible truthiness change stays independent of this PR.

How it works

<If> name → expansion engine (before filesystem resolution) → selected branch only

<If> is native, so it is handled by expansion and never resolved from
componentDirs. That is the property the new tests exercise directly: they run
the real operational sources with no If.md or Show.md anywhere in the stub
filesystem.

Review guide

Start with:scripts/tests/review-infrastructure.test.ts

Then review:

  1. The seven .reviews/ documents — a pure tag/prop rename.
  2. retires the Show component from the review library — the static guard.
  3. The five operational tests that execute the real documents.
  4. packages/core/tests/unused-in-diff.test.ts — fixture removal plus an exact
    output assertion.
  5. specs/code-review-agent-spec.md §5.10.

Look carefully at: the exact trimmed-equality assertions. They intentionally
lock the blank lines the migrated tags surround, including the five blank lines
OxlintSummary's two suppressed blocks leave behind.

What must stay true

  • Show is gone from the review library — enforced by deletion and checked by
    retires the Show component from the review library, which walks
    .reviews/**/*.md for an opening or closing Show element, rejects a
    Show.md path, and scans the focused test and the code-review spec. The guard
    asserts the walk found Finding.md first, so it cannot pass vacuously.
  • The structural name wins before filesystem component resolution — checked by
    every operational test, none of which supplies an If or Show component.
  • An unselected branch does no provider work — checked by
    skips the ExtraneousCodePolicy sample below the review threshold.
  • The scan stays scoped. packages/core/tests/expression-props.test.ts uses
    Show as an arbitrary component name and is deliberately untouched.

How to verify it

  • retires the Show component from the review library fails if any .reviews/
    document, the focused test, or the spec still carries Show.
  • renders Finding's selected icon and message and suppresses its false case
    proves exact branch output (🔴 Broken contract.) and an exactly empty false
    case; it fails on a whitespace change inside the migrated block.
  • renders OxlintSummary's clean section and its unavailable warning and
    renders RepoCleanupPolicy's clean section without running either branch
    prove the clean-section and warning paths byte-exactly.
  • suppresses ReleaseSpecWarning for ordinary files and warns on release changes proves both directions of its release-config condition.
  • expands UnusedInDiff and CommentReview to nothing without an If component
    proves CommentReview's typed data component executes (it fetches the PR's
    comments) while both captures and both trailing branches stay empty.
  • skips the ExtraneousCodePolicy sample below the review threshold installs a
    counting Sample provider: 20 changes make zero calls and render the clean
    section, 21 changes make exactly one call and surface the provider result. The
    selected control is what keeps the zero-call case from being vacuous.
  • renders the disclosure with symbol, location, count and reason in
    unused-in-diff.test.ts is now exact trimmed equality over the whole
    disclosure, so summary/table whitespace is locked.

Each new regression was mutation-checked: reverting Finding.md to <Show>
(with Show.md restored), reverting the spec example, widening the
ExtraneousCodePolicy threshold to >= 20, padding Finding's rendered line,
and removing a blank line in UnusedInDiff's table each fail the intended test
and nothing else.

Scope

Included

  • The thirteen-block rename in seven operational documents and the deletion of
    Show.md.
  • Focused regressions in the two suites that own this boundary.
  • §5.10 of the code-review-agent specification.

Intentionally unchanged

  • <If> implementation, syntax, validation, and truthiness semantics (Coerce the <If> condition with JS truthiness #258).
  • specs/executable-mdx-spec.md, which already specifies native <If>/<Else>,
    filesystem precedence, and selected-branch non-execution.
  • .github/workflows/review.yml and every other workflow.
  • packages/core/tests/expression-props.test.ts, where Show is an arbitrary
    component-resolution fixture rather than a review-library claim.
  • UnusedInDiff's selected-disclosure and suppression coverage stays in its own
    suite, because it crosses eval, <Each>, and filesystem fixture boundaries;
    the infrastructure matrix only uses its empty case.

Generated or mechanical changes

  • The seven .reviews/ documents contain no intended behavior change. The only
    cosmetic consequence is in OxlintSummary.md, whose wrapped condition keeps
    its authored continuation indentation and therefore no longer aligns under the
    longer condition={ prefix.

Verification

All required local checks are green on db78a89:

deno task lint 0 errors, formatting clean
deno task check no errors
deno task check:jsr Success Dry run complete
deno task test <3 suites> 11 passed (77 steps), 0 failed
pnpm exec tsx --tsconfig tsconfig.node.json --test <2 suites> 23 pass, 0 fail
bun test <2 suites> 23 pass, 0 fail
git diff --check clean

verify:clean and the full per-runtime suites were not run: this change touches
no dependency state, build purity, test discovery, shared setup, or runtime
adapter. CI owns the exhaustive corpus.

Risks and limitations

  • Local review integration evidence: not run.deno task review:local
    requires a reachable Ollama at localhost:11434 serving
    qwen3:30b-a3b plus GITHUB_TOKEN; neither is available in this
    environment. This PR's own review workflow builds the checked-out source and
    runs ./dist/xmd, so its marked review comment is the end-to-end evidence and
    is a merge blocker if it fails, errors, or posts nothing substantive.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

The review library shipped its own `Show.md` conditional before the engine
had one. `<If>` is now a native structural directive, so the seven operational
documents that still invoked `Show` duplicated engine behavior and let the
review system drift from the documented language.
Rename the thirteen conditional blocks in place — `when` becomes `condition`,
bodies and whitespace are unchanged — and delete `.reviews/components/Show.md`.
None of the conditions had a fallback and every one already evaluates to a
boolean, so no `<Else>` branch is introduced and issue #258's possible
truthiness change stays independent.
Deleting the component and scanning for its tag proves retirement but not
behavior, so the review-infrastructure suite now executes the real sources of
all seven documents with no `If.md` or `Show.md` in the stub filesystem: the
structural name has to win before filesystem component resolution. Compact
outputs and every suppressed case are asserted by exact trimmed equality, which
locks the summary, table, and section whitespace the tags surround.
`ExtraneousCodePolicy.md` carries the provider contract — a counting `Sample`
records zero calls below the review threshold and exactly one above it, so the
empty case is non-execution rather than a probe that never wired up.
@github-actions

Copy link
Copy Markdown

PR #406: ♻️ Migrate operational review documents from Show to built-in

11 files, +339 / -64

Scope

🟡 403 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras

taras commented Aug 9, 2026

Copy link
Copy Markdown
OwnerAuthor

Integration evidence

PR review workflow (required evidence). Run
31308999146,
revision db78a89. It ran deno task setup, deno task build, and
./dist/xmd run .reviews/ReviewPR.md, so the review was produced by this PR's
own engine and its own migrated documents. The posted <!-- xmd-review -->
comment is substantive and contains no ERROR marker.

Two of its sections are direct end-to-end proof of the migration:

  • ### Static Analysis is OxlintSummary.md with all three <If> blocks
    false, rendering only ReviewSection's clean text.
  • ### Correctness is ExtraneousCodePolicy.md with its <If>selected
    (403 changes > 20): the branch reached <Sample>, the provider ran, and the
    model returned No extraneous code patterns detected.

So the same document supplies both directions of the migrated condition in CI —
suppressed locally in the focused regression, selected here against a real
provider.

Local review (deno task review:local): not run..reviews/ReviewPR.local.md
needs Ollama serving qwen3:30b-a3b at localhost:11434 plus GITHUB_TOKEN;
neither was available in the implementation environment. Recorded as a missing
prerequisite, not a test failure.

CI: all checks pass — green, lint, jsr, site, smoke, review,
test-deno, test-node, test-bun, deploy. composability skips by design
(it runs on main only).

@taras
taras marked this pull request as ready for review August 9, 2026 10:55
@taras
taras merged commit 35060af into mainAug 9, 2026
11 checks passed
@taras
taras deleted the agent/issue-219-if-migration branch August 9, 2026 10:55
Sign up for freeto 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.

Migrate operational review documents from Show to built-in <If>

1 participant

@taras
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

♻️ Migrate operational review documents from Show to built-in <If> - #406

Merged
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration
Aug 9, 2026
Merged

♻️ Migrate operational review documents from Show to built-in <If>#406
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration

Conversation

@taras

@tarastaras commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes#219.

Why

The review library shipped its own Show.md conditional before the engine had
one. <If> is now a native structural directive, so the seven operational
review documents that still invoked Show duplicated engine behavior and let
the review system drift from the language its own specification documents.

The release-order blocker recorded in the original issue is gone:
.github/workflows/review.yml prepares and builds the checked-out revision and
runs ./dist/xmd, so no release or workflow change is involved.

What changes

Before:

<Showwhen={props.pr.stats.totalChanges > 20}>
...
</Show>

After:

<Ifcondition={props.pr.stats.totalChanges > 20}>
...
</If>

Thirteen blocks across seven documents, renamed in place. Bodies, indentation,
line wrapping and surrounding blank lines are unchanged, and
.reviews/components/Show.md is deleted. Finding.md keeps its public when
prop; only its internal element becomes <If condition={props.when}>.

Every migrated condition already evaluates to a boolean and none passed
Show's optional fallback, so no <Else> branch is introduced and #258's
possible truthiness change stays independent of this PR.

How it works

<If> name → expansion engine (before filesystem resolution) → selected branch only

<If> is native, so it is handled by expansion and never resolved from
componentDirs. That is the property the new tests exercise directly: they run
the real operational sources with no If.md or Show.md anywhere in the stub
filesystem.

Review guide

Start with:scripts/tests/review-infrastructure.test.ts

Then review:

  1. The seven .reviews/ documents — a pure tag/prop rename.
  2. retires the Show component from the review library — the static guard.
  3. The five operational tests that execute the real documents.
  4. packages/core/tests/unused-in-diff.test.ts — fixture removal plus an exact
    output assertion.
  5. specs/code-review-agent-spec.md §5.10.

Look carefully at: the exact trimmed-equality assertions. They intentionally
lock the blank lines the migrated tags surround, including the five blank lines
OxlintSummary's two suppressed blocks leave behind.

What must stay true

  • Show is gone from the review library — enforced by deletion and checked by
    retires the Show component from the review library, which walks
    .reviews/**/*.md for an opening or closing Show element, rejects a
    Show.md path, and scans the focused test and the code-review spec. The guard
    asserts the walk found Finding.md first, so it cannot pass vacuously.
  • The structural name wins before filesystem component resolution — checked by
    every operational test, none of which supplies an If or Show component.
  • An unselected branch does no provider work — checked by
    skips the ExtraneousCodePolicy sample below the review threshold.
  • The scan stays scoped. packages/core/tests/expression-props.test.ts uses
    Show as an arbitrary component name and is deliberately untouched.

How to verify it

  • retires the Show component from the review library fails if any .reviews/
    document, the focused test, or the spec still carries Show.
  • renders Finding's selected icon and message and suppresses its false case
    proves exact branch output (🔴 Broken contract.) and an exactly empty false
    case; it fails on a whitespace change inside the migrated block.
  • renders OxlintSummary's clean section and its unavailable warning and
    renders RepoCleanupPolicy's clean section without running either branch
    prove the clean-section and warning paths byte-exactly.
  • suppresses ReleaseSpecWarning for ordinary files and warns on release changes proves both directions of its release-config condition.
  • expands UnusedInDiff and CommentReview to nothing without an If component
    proves CommentReview's typed data component executes (it fetches the PR's
    comments) while both captures and both trailing branches stay empty.
  • skips the ExtraneousCodePolicy sample below the review threshold installs a
    counting Sample provider: 20 changes make zero calls and render the clean
    section, 21 changes make exactly one call and surface the provider result. The
    selected control is what keeps the zero-call case from being vacuous.
  • renders the disclosure with symbol, location, count and reason in
    unused-in-diff.test.ts is now exact trimmed equality over the whole
    disclosure, so summary/table whitespace is locked.

Each new regression was mutation-checked: reverting Finding.md to <Show>
(with Show.md restored), reverting the spec example, widening the
ExtraneousCodePolicy threshold to >= 20, padding Finding's rendered line,
and removing a blank line in UnusedInDiff's table each fail the intended test
and nothing else.

Scope

Included

  • The thirteen-block rename in seven operational documents and the deletion of
    Show.md.
  • Focused regressions in the two suites that own this boundary.
  • §5.10 of the code-review-agent specification.

Intentionally unchanged

  • <If> implementation, syntax, validation, and truthiness semantics (Coerce the <If> condition with JS truthiness #258).
  • specs/executable-mdx-spec.md, which already specifies native <If>/<Else>,
    filesystem precedence, and selected-branch non-execution.
  • .github/workflows/review.yml and every other workflow.
  • packages/core/tests/expression-props.test.ts, where Show is an arbitrary
    component-resolution fixture rather than a review-library claim.
  • UnusedInDiff's selected-disclosure and suppression coverage stays in its own
    suite, because it crosses eval, <Each>, and filesystem fixture boundaries;
    the infrastructure matrix only uses its empty case.

Generated or mechanical changes

  • The seven .reviews/ documents contain no intended behavior change. The only
    cosmetic consequence is in OxlintSummary.md, whose wrapped condition keeps
    its authored continuation indentation and therefore no longer aligns under the
    longer condition={ prefix.

Verification

All required local checks are green on db78a89:

deno task lint 0 errors, formatting clean
deno task check no errors
deno task check:jsr Success Dry run complete
deno task test <3 suites> 11 passed (77 steps), 0 failed
pnpm exec tsx --tsconfig tsconfig.node.json --test <2 suites> 23 pass, 0 fail
bun test <2 suites> 23 pass, 0 fail
git diff --check clean

verify:clean and the full per-runtime suites were not run: this change touches
no dependency state, build purity, test discovery, shared setup, or runtime
adapter. CI owns the exhaustive corpus.

Risks and limitations

  • Local review integration evidence: not run.deno task review:local
    requires a reachable Ollama at localhost:11434 serving
    qwen3:30b-a3b plus GITHUB_TOKEN; neither is available in this
    environment. This PR's own review workflow builds the checked-out source and
    runs ./dist/xmd, so its marked review comment is the end-to-end evidence and
    is a merge blocker if it fails, errors, or posts nothing substantive.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

The review library shipped its own `Show.md` conditional before the engine
had one. `<If>` is now a native structural directive, so the seven operational
documents that still invoked `Show` duplicated engine behavior and let the
review system drift from the documented language.
Rename the thirteen conditional blocks in place — `when` becomes `condition`,
bodies and whitespace are unchanged — and delete `.reviews/components/Show.md`.
None of the conditions had a fallback and every one already evaluates to a
boolean, so no `<Else>` branch is introduced and issue #258's possible
truthiness change stays independent.
Deleting the component and scanning for its tag proves retirement but not
behavior, so the review-infrastructure suite now executes the real sources of
all seven documents with no `If.md` or `Show.md` in the stub filesystem: the
structural name has to win before filesystem component resolution. Compact
outputs and every suppressed case are asserted by exact trimmed equality, which
locks the summary, table, and section whitespace the tags surround.
`ExtraneousCodePolicy.md` carries the provider contract — a counting `Sample`
records zero calls below the review threshold and exactly one above it, so the
empty case is non-execution rather than a probe that never wired up.
@github-actions

Copy link
Copy Markdown

PR #406: ♻️ Migrate operational review documents from Show to built-in

11 files, +339 / -64

Scope

🟡 403 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras

taras commented Aug 9, 2026

Copy link
Copy Markdown
OwnerAuthor

Integration evidence

PR review workflow (required evidence). Run
31308999146,
revision db78a89. It ran deno task setup, deno task build, and
./dist/xmd run .reviews/ReviewPR.md, so the review was produced by this PR's
own engine and its own migrated documents. The posted <!-- xmd-review -->
comment is substantive and contains no ERROR marker.

Two of its sections are direct end-to-end proof of the migration:

  • ### Static Analysis is OxlintSummary.md with all three <If> blocks
    false, rendering only ReviewSection's clean text.
  • ### Correctness is ExtraneousCodePolicy.md with its <If>selected
    (403 changes > 20): the branch reached <Sample>, the provider ran, and the
    model returned No extraneous code patterns detected.

So the same document supplies both directions of the migrated condition in CI —
suppressed locally in the focused regression, selected here against a real
provider.

Local review (deno task review:local): not run..reviews/ReviewPR.local.md
needs Ollama serving qwen3:30b-a3b at localhost:11434 plus GITHUB_TOKEN;
neither was available in the implementation environment. Recorded as a missing
prerequisite, not a test failure.

CI: all checks pass — green, lint, jsr, site, smoke, review,
test-deno, test-node, test-bun, deploy. composability skips by design
(it runs on main only).

@taras
taras marked this pull request as ready for review August 9, 2026 10:55
@taras
taras merged commit 35060af into mainAug 9, 2026
11 checks passed
@taras
taras deleted the agent/issue-219-if-migration branch August 9, 2026 10:55
Sign up for freeto 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.

Migrate operational review documents from Show to built-in <If>

1 participant

@taras
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

♻️ Migrate operational review documents from Show to built-in <If> - #406

Merged
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration
Aug 9, 2026
Merged

♻️ Migrate operational review documents from Show to built-in <If>#406
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration

Conversation

@taras

@tarastaras commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes#219.

Why

The review library shipped its own Show.md conditional before the engine had
one. <If> is now a native structural directive, so the seven operational
review documents that still invoked Show duplicated engine behavior and let
the review system drift from the language its own specification documents.

The release-order blocker recorded in the original issue is gone:
.github/workflows/review.yml prepares and builds the checked-out revision and
runs ./dist/xmd, so no release or workflow change is involved.

What changes

Before:

<Showwhen={props.pr.stats.totalChanges > 20}>
...
</Show>

After:

<Ifcondition={props.pr.stats.totalChanges > 20}>
...
</If>

Thirteen blocks across seven documents, renamed in place. Bodies, indentation,
line wrapping and surrounding blank lines are unchanged, and
.reviews/components/Show.md is deleted. Finding.md keeps its public when
prop; only its internal element becomes <If condition={props.when}>.

Every migrated condition already evaluates to a boolean and none passed
Show's optional fallback, so no <Else> branch is introduced and #258's
possible truthiness change stays independent of this PR.

How it works

<If> name → expansion engine (before filesystem resolution) → selected branch only

<If> is native, so it is handled by expansion and never resolved from
componentDirs. That is the property the new tests exercise directly: they run
the real operational sources with no If.md or Show.md anywhere in the stub
filesystem.

Review guide

Start with:scripts/tests/review-infrastructure.test.ts

Then review:

  1. The seven .reviews/ documents — a pure tag/prop rename.
  2. retires the Show component from the review library — the static guard.
  3. The five operational tests that execute the real documents.
  4. packages/core/tests/unused-in-diff.test.ts — fixture removal plus an exact
    output assertion.
  5. specs/code-review-agent-spec.md §5.10.

Look carefully at: the exact trimmed-equality assertions. They intentionally
lock the blank lines the migrated tags surround, including the five blank lines
OxlintSummary's two suppressed blocks leave behind.

What must stay true

  • Show is gone from the review library — enforced by deletion and checked by
    retires the Show component from the review library, which walks
    .reviews/**/*.md for an opening or closing Show element, rejects a
    Show.md path, and scans the focused test and the code-review spec. The guard
    asserts the walk found Finding.md first, so it cannot pass vacuously.
  • The structural name wins before filesystem component resolution — checked by
    every operational test, none of which supplies an If or Show component.
  • An unselected branch does no provider work — checked by
    skips the ExtraneousCodePolicy sample below the review threshold.
  • The scan stays scoped. packages/core/tests/expression-props.test.ts uses
    Show as an arbitrary component name and is deliberately untouched.

How to verify it

  • retires the Show component from the review library fails if any .reviews/
    document, the focused test, or the spec still carries Show.
  • renders Finding's selected icon and message and suppresses its false case
    proves exact branch output (🔴 Broken contract.) and an exactly empty false
    case; it fails on a whitespace change inside the migrated block.
  • renders OxlintSummary's clean section and its unavailable warning and
    renders RepoCleanupPolicy's clean section without running either branch
    prove the clean-section and warning paths byte-exactly.
  • suppresses ReleaseSpecWarning for ordinary files and warns on release changes proves both directions of its release-config condition.
  • expands UnusedInDiff and CommentReview to nothing without an If component
    proves CommentReview's typed data component executes (it fetches the PR's
    comments) while both captures and both trailing branches stay empty.
  • skips the ExtraneousCodePolicy sample below the review threshold installs a
    counting Sample provider: 20 changes make zero calls and render the clean
    section, 21 changes make exactly one call and surface the provider result. The
    selected control is what keeps the zero-call case from being vacuous.
  • renders the disclosure with symbol, location, count and reason in
    unused-in-diff.test.ts is now exact trimmed equality over the whole
    disclosure, so summary/table whitespace is locked.

Each new regression was mutation-checked: reverting Finding.md to <Show>
(with Show.md restored), reverting the spec example, widening the
ExtraneousCodePolicy threshold to >= 20, padding Finding's rendered line,
and removing a blank line in UnusedInDiff's table each fail the intended test
and nothing else.

Scope

Included

  • The thirteen-block rename in seven operational documents and the deletion of
    Show.md.
  • Focused regressions in the two suites that own this boundary.
  • §5.10 of the code-review-agent specification.

Intentionally unchanged

  • <If> implementation, syntax, validation, and truthiness semantics (Coerce the <If> condition with JS truthiness #258).
  • specs/executable-mdx-spec.md, which already specifies native <If>/<Else>,
    filesystem precedence, and selected-branch non-execution.
  • .github/workflows/review.yml and every other workflow.
  • packages/core/tests/expression-props.test.ts, where Show is an arbitrary
    component-resolution fixture rather than a review-library claim.
  • UnusedInDiff's selected-disclosure and suppression coverage stays in its own
    suite, because it crosses eval, <Each>, and filesystem fixture boundaries;
    the infrastructure matrix only uses its empty case.

Generated or mechanical changes

  • The seven .reviews/ documents contain no intended behavior change. The only
    cosmetic consequence is in OxlintSummary.md, whose wrapped condition keeps
    its authored continuation indentation and therefore no longer aligns under the
    longer condition={ prefix.

Verification

All required local checks are green on db78a89:

deno task lint 0 errors, formatting clean
deno task check no errors
deno task check:jsr Success Dry run complete
deno task test <3 suites> 11 passed (77 steps), 0 failed
pnpm exec tsx --tsconfig tsconfig.node.json --test <2 suites> 23 pass, 0 fail
bun test <2 suites> 23 pass, 0 fail
git diff --check clean

verify:clean and the full per-runtime suites were not run: this change touches
no dependency state, build purity, test discovery, shared setup, or runtime
adapter. CI owns the exhaustive corpus.

Risks and limitations

  • Local review integration evidence: not run.deno task review:local
    requires a reachable Ollama at localhost:11434 serving
    qwen3:30b-a3b plus GITHUB_TOKEN; neither is available in this
    environment. This PR's own review workflow builds the checked-out source and
    runs ./dist/xmd, so its marked review comment is the end-to-end evidence and
    is a merge blocker if it fails, errors, or posts nothing substantive.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

The review library shipped its own `Show.md` conditional before the engine
had one. `<If>` is now a native structural directive, so the seven operational
documents that still invoked `Show` duplicated engine behavior and let the
review system drift from the documented language.
Rename the thirteen conditional blocks in place — `when` becomes `condition`,
bodies and whitespace are unchanged — and delete `.reviews/components/Show.md`.
None of the conditions had a fallback and every one already evaluates to a
boolean, so no `<Else>` branch is introduced and issue #258's possible
truthiness change stays independent.
Deleting the component and scanning for its tag proves retirement but not
behavior, so the review-infrastructure suite now executes the real sources of
all seven documents with no `If.md` or `Show.md` in the stub filesystem: the
structural name has to win before filesystem component resolution. Compact
outputs and every suppressed case are asserted by exact trimmed equality, which
locks the summary, table, and section whitespace the tags surround.
`ExtraneousCodePolicy.md` carries the provider contract — a counting `Sample`
records zero calls below the review threshold and exactly one above it, so the
empty case is non-execution rather than a probe that never wired up.
@github-actions

Copy link
Copy Markdown

PR #406: ♻️ Migrate operational review documents from Show to built-in

11 files, +339 / -64

Scope

🟡 403 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras

taras commented Aug 9, 2026

Copy link
Copy Markdown
OwnerAuthor

Integration evidence

PR review workflow (required evidence). Run
31308999146,
revision db78a89. It ran deno task setup, deno task build, and
./dist/xmd run .reviews/ReviewPR.md, so the review was produced by this PR's
own engine and its own migrated documents. The posted <!-- xmd-review -->
comment is substantive and contains no ERROR marker.

Two of its sections are direct end-to-end proof of the migration:

  • ### Static Analysis is OxlintSummary.md with all three <If> blocks
    false, rendering only ReviewSection's clean text.
  • ### Correctness is ExtraneousCodePolicy.md with its <If>selected
    (403 changes > 20): the branch reached <Sample>, the provider ran, and the
    model returned No extraneous code patterns detected.

So the same document supplies both directions of the migrated condition in CI —
suppressed locally in the focused regression, selected here against a real
provider.

Local review (deno task review:local): not run..reviews/ReviewPR.local.md
needs Ollama serving qwen3:30b-a3b at localhost:11434 plus GITHUB_TOKEN;
neither was available in the implementation environment. Recorded as a missing
prerequisite, not a test failure.

CI: all checks pass — green, lint, jsr, site, smoke, review,
test-deno, test-node, test-bun, deploy. composability skips by design
(it runs on main only).

@taras
taras marked this pull request as ready for review August 9, 2026 10:55
@taras
taras merged commit 35060af into mainAug 9, 2026
11 checks passed
@taras
taras deleted the agent/issue-219-if-migration branch August 9, 2026 10:55
Sign up for freeto 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.

Migrate operational review documents from Show to built-in <If>

1 participant

@taras
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

♻️ Migrate operational review documents from Show to built-in <If> - #406

Merged
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration
Aug 9, 2026
Merged

♻️ Migrate operational review documents from Show to built-in <If>#406
taras merged 1 commit into
mainfrom
agent/issue-219-if-migration

Conversation

@taras

@tarastaras commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes#219.

Why

The review library shipped its own Show.md conditional before the engine had
one. <If> is now a native structural directive, so the seven operational
review documents that still invoked Show duplicated engine behavior and let
the review system drift from the language its own specification documents.

The release-order blocker recorded in the original issue is gone:
.github/workflows/review.yml prepares and builds the checked-out revision and
runs ./dist/xmd, so no release or workflow change is involved.

What changes

Before:

<Showwhen={props.pr.stats.totalChanges > 20}>
...
</Show>

After:

<Ifcondition={props.pr.stats.totalChanges > 20}>
...
</If>

Thirteen blocks across seven documents, renamed in place. Bodies, indentation,
line wrapping and surrounding blank lines are unchanged, and
.reviews/components/Show.md is deleted. Finding.md keeps its public when
prop; only its internal element becomes <If condition={props.when}>.

Every migrated condition already evaluates to a boolean and none passed
Show's optional fallback, so no <Else> branch is introduced and #258's
possible truthiness change stays independent of this PR.

How it works

<If> name → expansion engine (before filesystem resolution) → selected branch only

<If> is native, so it is handled by expansion and never resolved from
componentDirs. That is the property the new tests exercise directly: they run
the real operational sources with no If.md or Show.md anywhere in the stub
filesystem.

Review guide

Start with:scripts/tests/review-infrastructure.test.ts

Then review:

  1. The seven .reviews/ documents — a pure tag/prop rename.
  2. retires the Show component from the review library — the static guard.
  3. The five operational tests that execute the real documents.
  4. packages/core/tests/unused-in-diff.test.ts — fixture removal plus an exact
    output assertion.
  5. specs/code-review-agent-spec.md §5.10.

Look carefully at: the exact trimmed-equality assertions. They intentionally
lock the blank lines the migrated tags surround, including the five blank lines
OxlintSummary's two suppressed blocks leave behind.

What must stay true

  • Show is gone from the review library — enforced by deletion and checked by
    retires the Show component from the review library, which walks
    .reviews/**/*.md for an opening or closing Show element, rejects a
    Show.md path, and scans the focused test and the code-review spec. The guard
    asserts the walk found Finding.md first, so it cannot pass vacuously.
  • The structural name wins before filesystem component resolution — checked by
    every operational test, none of which supplies an If or Show component.
  • An unselected branch does no provider work — checked by
    skips the ExtraneousCodePolicy sample below the review threshold.
  • The scan stays scoped. packages/core/tests/expression-props.test.ts uses
    Show as an arbitrary component name and is deliberately untouched.

How to verify it

  • retires the Show component from the review library fails if any .reviews/
    document, the focused test, or the spec still carries Show.
  • renders Finding's selected icon and message and suppresses its false case
    proves exact branch output (🔴 Broken contract.) and an exactly empty false
    case; it fails on a whitespace change inside the migrated block.
  • renders OxlintSummary's clean section and its unavailable warning and
    renders RepoCleanupPolicy's clean section without running either branch
    prove the clean-section and warning paths byte-exactly.
  • suppresses ReleaseSpecWarning for ordinary files and warns on release changes proves both directions of its release-config condition.
  • expands UnusedInDiff and CommentReview to nothing without an If component
    proves CommentReview's typed data component executes (it fetches the PR's
    comments) while both captures and both trailing branches stay empty.
  • skips the ExtraneousCodePolicy sample below the review threshold installs a
    counting Sample provider: 20 changes make zero calls and render the clean
    section, 21 changes make exactly one call and surface the provider result. The
    selected control is what keeps the zero-call case from being vacuous.
  • renders the disclosure with symbol, location, count and reason in
    unused-in-diff.test.ts is now exact trimmed equality over the whole
    disclosure, so summary/table whitespace is locked.

Each new regression was mutation-checked: reverting Finding.md to <Show>
(with Show.md restored), reverting the spec example, widening the
ExtraneousCodePolicy threshold to >= 20, padding Finding's rendered line,
and removing a blank line in UnusedInDiff's table each fail the intended test
and nothing else.

Scope

Included

  • The thirteen-block rename in seven operational documents and the deletion of
    Show.md.
  • Focused regressions in the two suites that own this boundary.
  • §5.10 of the code-review-agent specification.

Intentionally unchanged

  • <If> implementation, syntax, validation, and truthiness semantics (Coerce the <If> condition with JS truthiness #258).
  • specs/executable-mdx-spec.md, which already specifies native <If>/<Else>,
    filesystem precedence, and selected-branch non-execution.
  • .github/workflows/review.yml and every other workflow.
  • packages/core/tests/expression-props.test.ts, where Show is an arbitrary
    component-resolution fixture rather than a review-library claim.
  • UnusedInDiff's selected-disclosure and suppression coverage stays in its own
    suite, because it crosses eval, <Each>, and filesystem fixture boundaries;
    the infrastructure matrix only uses its empty case.

Generated or mechanical changes

  • The seven .reviews/ documents contain no intended behavior change. The only
    cosmetic consequence is in OxlintSummary.md, whose wrapped condition keeps
    its authored continuation indentation and therefore no longer aligns under the
    longer condition={ prefix.

Verification

All required local checks are green on db78a89:

deno task lint 0 errors, formatting clean
deno task check no errors
deno task check:jsr Success Dry run complete
deno task test <3 suites> 11 passed (77 steps), 0 failed
pnpm exec tsx --tsconfig tsconfig.node.json --test <2 suites> 23 pass, 0 fail
bun test <2 suites> 23 pass, 0 fail
git diff --check clean

verify:clean and the full per-runtime suites were not run: this change touches
no dependency state, build purity, test discovery, shared setup, or runtime
adapter. CI owns the exhaustive corpus.

Risks and limitations

  • Local review integration evidence: not run.deno task review:local
    requires a reachable Ollama at localhost:11434 serving
    qwen3:30b-a3b plus GITHUB_TOKEN; neither is available in this
    environment. This PR's own review workflow builds the checked-out source and
    runs ./dist/xmd, so its marked review comment is the end-to-end evidence and
    is a merge blocker if it fails, errors, or posts nothing substantive.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

The review library shipped its own `Show.md` conditional before the engine
had one. `<If>` is now a native structural directive, so the seven operational
documents that still invoked `Show` duplicated engine behavior and let the
review system drift from the documented language.
Rename the thirteen conditional blocks in place — `when` becomes `condition`,
bodies and whitespace are unchanged — and delete `.reviews/components/Show.md`.
None of the conditions had a fallback and every one already evaluates to a
boolean, so no `<Else>` branch is introduced and issue #258's possible
truthiness change stays independent.
Deleting the component and scanning for its tag proves retirement but not
behavior, so the review-infrastructure suite now executes the real sources of
all seven documents with no `If.md` or `Show.md` in the stub filesystem: the
structural name has to win before filesystem component resolution. Compact
outputs and every suppressed case are asserted by exact trimmed equality, which
locks the summary, table, and section whitespace the tags surround.
`ExtraneousCodePolicy.md` carries the provider contract — a counting `Sample`
records zero calls below the review threshold and exactly one above it, so the
empty case is non-execution rather than a probe that never wired up.
@github-actions

Copy link
Copy Markdown

PR #406: ♻️ Migrate operational review documents from Show to built-in

11 files, +339 / -64

Scope

🟡 403 lines changed. PRs under 400 receive more thorough review.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

@taras

taras commented Aug 9, 2026

Copy link
Copy Markdown
OwnerAuthor

Integration evidence

PR review workflow (required evidence). Run
31308999146,
revision db78a89. It ran deno task setup, deno task build, and
./dist/xmd run .reviews/ReviewPR.md, so the review was produced by this PR's
own engine and its own migrated documents. The posted <!-- xmd-review -->
comment is substantive and contains no ERROR marker.

Two of its sections are direct end-to-end proof of the migration:

  • ### Static Analysis is OxlintSummary.md with all three <If> blocks
    false, rendering only ReviewSection's clean text.
  • ### Correctness is ExtraneousCodePolicy.md with its <If>selected
    (403 changes > 20): the branch reached <Sample>, the provider ran, and the
    model returned No extraneous code patterns detected.

So the same document supplies both directions of the migrated condition in CI —
suppressed locally in the focused regression, selected here against a real
provider.

Local review (deno task review:local): not run..reviews/ReviewPR.local.md
needs Ollama serving qwen3:30b-a3b at localhost:11434 plus GITHUB_TOKEN;
neither was available in the implementation environment. Recorded as a missing
prerequisite, not a test failure.

CI: all checks pass — green, lint, jsr, site, smoke, review,
test-deno, test-node, test-bun, deploy. composability skips by design
(it runs on main only).

@taras
taras marked this pull request as ready for review August 9, 2026 10:55
@taras
taras merged commit 35060af into mainAug 9, 2026
11 checks passed
@taras
taras deleted the agent/issue-219-if-migration branch August 9, 2026 10:55
Sign up for freeto 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.

Migrate operational review documents from Show to built-in <If>

1 participant

@taras