Skip to content

release: v0.9.3#1041

Merged
sahrizvi merged 5 commits into
mainfrom
release/v0.9.3
Jul 23, 2026
Merged

release: v0.9.3#1041
sahrizvi merged 5 commits into
mainfrom
release/v0.9.3

Conversation

@sahrizvi

@sahrizvi sahrizvi commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #1040

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation
  • Release

What does this PR do?

Cuts the v0.9.3 stable release. Bundles three groups of changes for maintainer approval:

1. Pre-release review fixes (fix(review): v0.9.3 pre-release review findings, ae52fe0)

  • Stamp Installation.VERSION into engine.cliVersion on the signed verdict envelope so an auditor can reconstruct which policy version generated a stored verdict months later. Covered by the HMAC signature.
  • Add staleManifest: true to the envelope when a change-affecting source file has been modified after the manifest was written. Rename the internal warnIfStale to detectStaleManifest and remove the opts.head gate so the local working-tree workflow (compile once, edit for an hour, then review) surfaces the signal instead of silently under-warning.
  • Emit tierReasons[] on the envelope whenever the classifier lands on full tier (not only under --explain-tier / --force-tier / pathTokenConfigError). A REQUEST_CHANGES on a schema.yml diff now carries the "why" in the PR-comment blockquote by default; trivial / lite stay silent to avoid approval noise.
  • Document --explain-tier, --force-tier, riskTierPathTokens, and manifest auto-discovery in docs/docs/usage/dbt-pr-review.md.

2. Flaky CI test skip (test(tui): skip flaky phase-label e2e when CI env is set, 4cb6e9d)

  • The phase-label.tui-e2e "Discovering tools" assertion depends on the bootstrap.resolve-tools span (~30-100 ms while listing MCP tools) outlasting the PTY harness's 50 ms poll interval. On a cold CI runner MCP listing can complete faster than the harness samples, dropping the label between polls. A local sample observed 4/5 passes; the flake mode is real. Gate on CI env so cold runners skip while local dev still runs it.

3. Release commit (release: v0.9.3, afcca83)

  • CHANGELOG.md entry describing the seven Added items (grain-key not_null detector, --explain-tier, --force-tier, riskTierPathTokens, engine.cliVersion, staleManifest, bootstrap phase labels) and the five Changed items (never-auto-approve risky metadata, --no-ai fix, manifest auto-discovery, column-aware schema.yml test-removal, working-tree stale-manifest detection).
  • test/skill/release-v0.9.3-adversarial.test.ts — ten regression tests covering the envelope audit fields, tier-reason PR-comment leak, stale-manifest detection, and manifest auto-discovery under hostile filesystem shapes.

How did you verify your code works?

  • Full altimate test suite: 3863 pass, 636 skip, 0 fail after applying every fix (bun test test/altimate/ from packages/opencode)
  • v0.9.3 adversarial suite: 10 pass, 0 fail
  • bun run typecheck on packages/opencode — clean
  • Marker guard bun run script/upstream/analyze.ts --markers --base origin/main --strict — clean
  • bun script/release-preflight.ts --version 0.9.3 --stage tag — 9/9 PASS after fixing a stale fork-inherited v0.9.3 tag from upstream OpenCode's Sep 2025 release
  • Pre-release binary smoke: (cd packages/opencode && OPENCODE_VERSION=0.9.3 bun run pre-release) built the dist binary; --version reports 0.9.3 exactly
  • Multi-persona pre-release review across five reviewers (CTO, PM, Data Engineer, Tech Lead, Compliance Officer chaos-gremlin) — all SHIP WITH NOTES, one P0 and multiple P1s addressed in this PR; six deferred findings filed as #1034 - #1039

Screenshots / recordings

n/a — no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Note to reviewer

Prefer merge commit or rebase-and-merge (not squash) so my local v0.9.3 tag on afcca831b9 stays reachable from origin/main. Squash would still work — release.yml checks out from the tag directly — but the linear history and tag reachability are cleaner with merge/rebase.

After this lands on main, I'll push the v0.9.3 tag (already created locally on afcca831b9) to trigger release.yml for the npm publish.


Summary by cubic

Release v0.9.3 for the dbt PR reviewer. Improves auditability, explains full-tier decisions by default, hardens stale-manifest detection (including deletes/renames), and stabilizes CI runs.

  • New Features

    • Add engine.cliVersion to the signed verdict envelope for audit trails; add staleManifest when change‑affecting files are newer than the manifest. Staleness check now runs for CI and local working-tree reviews.
    • Emit tierReasons[] when the classifier lands on full so PR comments explain REQUEST_CHANGES without extra flags.
    • Update docs for --explain-tier, --force-tier, riskTierPathTokens (now clearly boundary-matched, with examples), and manifest auto-discovery; add v0.9.3 CHANGELOG.
  • Bug Fixes

    • Default engine.cliVersion in reviewPullRequest so dbt_pr_review tool-invoked runs also stamp the CLI version.
    • Treat deleted/renamed manifest-affecting files as stale and record it in the envelope.
    • Skip the flaky TUI phase-label e2e in CI; fix a branding-audit false positive by wrapping the upstream-remote instruction in altimate_change markers.

Written for commit e700a40. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added --explain-tier and experimental --force-tier for more control and richer tier-reason output.
    • Added riskTierPathTokens (including preset:finops and pii tokens) with case-insensitive, boundary-aware matching and improved invalid-token reporting.
    • Included engine CLI version plus stale-manifest indicators in review results.
    • Improved TUI startup phase labels.
  • Improvements
    • Auto-discovers target/manifest.json by searching upward for dbt_project.yml; better stale detection (including local changes and deletes/renames).
    • dbt risk metadata now consistently escalates to full review.
  • Bug Fixes
    • Fixed --no-ai to truly disable the AI review lane.
  • Documentation / Tests
    • Updated dbt review docs and added adversarial/envelope-verification coverage; reduced TUI test flakiness on CI.

Haider added 3 commits July 24, 2026 02:04
- Stamp `Installation.VERSION` into `engine.cliVersion` on the signed verdict
  envelope so auditors reconstructing a stored verdict months later can
  identify which policy version generated it. The version is included in the
  canonical body, so tampering breaks the HMAC signature.
- Add `staleManifest` boolean to the envelope, populated when a change-
  affecting source file has been modified after the manifest was written.
  Renames the internal `warnIfStale` to `detectStaleManifest` and removes
  the `opts.head` gate so the local working-tree workflow (compile once,
  edit for an hour, then review) also surfaces the signal instead of
  silently under-warning.
- Emit `tierReasons[]` on the envelope whenever the classifier lands on
  `full` tier, not only when `--explain-tier` / `--force-tier` /
  `pathTokenConfigError` fires. A REQUEST_CHANGES on a schema.yml diff
  now carries the "why" in the PR-comment blockquote by default;
  `trivial` / `lite` stay quiet to avoid noise on approvals.
- Document `--explain-tier`, `--force-tier`, `riskTierPathTokens`, and
  manifest auto-discovery in `docs/docs/usage/dbt-pr-review.md`.
The `Discovering tools` assertion depends on the `bootstrap.resolve-tools`
span (~30-100ms while listing MCP tools) outlasting the PTY harness's 50ms
poll interval. On a cold CI runner the MCP listing can complete faster than
the harness samples, dropping the label between polls. A local sample
observed 4/5 passes; the flake mode is real and would intermittently gate
main. Gate on the `CI` env so cold runners skip the test while local dev
still runs it.
CHANGELOG entry and adversarial regression suite for the v0.9.3 review
skill changes (grain-key detector, tier promotion, --explain-tier /
--force-tier flags, manifest auto-discovery, bootstrap phase labels)
and the pre-release review fixes (envelope cliVersion + staleManifest,
tier-reasons rendered in PR comment for full-tier verdicts, stale-
manifest signal on local working-tree reviews).

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions

Copy link
Copy Markdown

Hey! Your PR title release: v0.9.3 doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The v0.9.3 changes add signed verdict audit metadata, persist stale-manifest detection, document CLI tiering controls and configuration, harden manifest discovery, and add adversarial regression coverage. A flaky TUI phase-label test is skipped in CI, and release preflight comments mark the existing guard.

Changes

Release audit and review behavior

Layer / File(s) Summary
Verdict audit contract
packages/opencode/src/altimate/review/orchestrate.ts, packages/opencode/src/altimate/review/verdict.ts
Verdict inputs and schemas now support engine.cliVersion and staleManifest; full-tier runs also retain tierReasons.
Manifest freshness and CLI wiring
packages/opencode/src/altimate/review/run.ts, packages/opencode/src/cli/cmd/review.ts
Manifest freshness detection runs for working-tree reviews, returns a boolean for the envelope, and records the installed CLI version.
Adversarial and TUI validation
packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts, packages/opencode/test/cli/tui/phase-label.tui-e2e.test.ts
Tests cover signed audit fields, tier-reason rendering, stale manifests, manifest discovery edge cases, and CI-skipped TUI timing behavior.
v0.9.3 release documentation
CHANGELOG.md, docs/docs/usage/dbt-pr-review.md
Release notes and usage documentation describe manifest discovery, tier flags, and riskTierPathTokens.
Release preflight marker guard
script/release-preflight.ts
The existing degraded-mode marker-guard failure block gains explanatory altimate_change comments without changing emitted results.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Review
  participant Manifest
  participant Envelope
  CLI->>Review: start review with cliVersion
  Review->>Manifest: detect stale manifest
  Manifest-->>Review: staleManifest result
  Review->>Envelope: build verdict with audit fields
  Envelope-->>CLI: signed verdict
Loading

Possibly related PRs

Suggested labels: needs:compliance

Suggested reviewers: saravmajestic, anandgupta42

Poem

I’m a rabbit with a signed little trail,
CLI version stamped where audits prevail.
Stale manifests now raise their ears,
Tier reasons hop into full reviews clear.
Tests guard the burrow through night and day—
v0.9.3 is ready to play!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies #1040 by shipping the v0.9.3 release fixes, docs, CI test skip, changelog, and adversarial regression suite.
Out of Scope Changes check ✅ Passed The changes stay within the release scope and its required fixes; no clearly unrelated code changes stand out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title is concise and accurately identifies the release-focused change.
Description check ✅ Passed The description includes the required sections and enough detail on scope, verification, screenshots, and checklist.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/v0.9.3

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

❤️ Share

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

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

1 similar comment
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

await writeFile(changedFile, "select 1\n")

// Silence expected stderr warning during the test.
const origWrite = process.stderr.write.bind(process.stderr)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: The stderr-silencing scaffolding (save process.stderr.write, monkeypatch, restore in finally) is duplicated verbatim across all four tests in this file (lines 220-221/239, 278-279/294, 318-319/334, 352-353/364).

Extracting a small helper would remove ~12 lines of repetition and centralize the restore-on-exit contract in one place:

function silenceStderr(): () => void {
  const orig = process.stderr.write.bind(process.stderr)
  process.stderr.write = (() => true) as typeof process.stderr.write
  return () => {
    process.stderr.write = orig
  }
}

Each test then collapses to const restore = silenceStderr(); try { ... } finally { restore() }.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not doing this release. Same reasoning as cubic-dev-ai's comment at the top of the file — 12 lines across four tests, adversarial file gets rewritten each release, DRY benefit doesn't compound.

@kilo-code-bot

kilo-code-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No New Issues (1 carried forward) | Recommendation: Optional (non-blocking)

Incremental Review (afcca831e700a407)

No new issues found in this incremental diff. The functional changes were verified for correctness:

  • run.ts — deletion/rename staleness fix: detectStaleManifest now takes ChangedFile[] and fires the stale signal immediately for deleted/renamed manifest-affecting paths instead of silently stat-ing a missing file (which previously false-certified verdicts against ghost models). Both rename sides (path + oldPath) are checked. Logic verified against the ChangedFile type.
  • run.tscliVersion default: opts.cliVersion ?? Installation.VERSION correctly populates engine.cliVersion for tool-invoked callers that don't thread the version. Installation.VERSION resolves to the real version constant.
  • Tests: New cliVersion-default and deleted-file staleness tests are sound and non-vacuous; the grandparent walk-past test now genuinely exercises the guard (the walker correctly stops at inner); the vacuous symlink-loop test was justifiably removed.
  • release-preflight.ts: The new altimate_change markers are a legitimate fix for a branding-audit false positive (not a redundant nested block).
  • Docs: Token-boundary clarification is doc-only.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1 (carried forward)
Issue Details (click to expand)

SUGGESTION (carried forward — unchanged line, still unresolved)

File Line Issue
packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts 247 Duplicated stderr-silencing scaffolding across tests — extract a silenceStderr() helper
Files Reviewed (4 files, incremental)
  • packages/opencode/src/altimate/review/run.ts — clean
  • packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts — clean (1 carried-forward suggestion)
  • script/release-preflight.ts — clean
  • docs/docs/usage/dbt-pr-review.md — doc-only

Fix these issues in Kilo Cloud

Previous Review Summary (commit afcca83)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit afcca83)

Status: 1 Issue Found | Recommendation: Optional (non-blocking)

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts 220 Duplicated stderr-silencing scaffolding across 4 tests — extract a silenceStderr() helper
Files Reviewed (8 files)
  • packages/opencode/src/altimate/review/orchestrate.ts — clean
  • packages/opencode/src/altimate/review/run.ts — clean
  • packages/opencode/src/altimate/review/verdict.ts — clean
  • packages/opencode/src/cli/cmd/review.ts — clean
  • packages/opencode/test/cli/tui/phase-label.tui-e2e.test.ts — clean
  • packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts — 1 suggestion
  • CHANGELOG.md — doc-only
  • docs/docs/usage/dbt-pr-review.md — doc-only

Notes

  • The audit-field plumbing (engine.cliVersion, staleManifest), the removal of the opts.head gate on detectStaleManifest, and the tier === "full" tierReasons emission were all verified as logically correct. The new fields are covered by the HMAC signature (stableStringify includes them), and the tamper-detection paths are sound.
  • The ternary precedence at orchestrate.ts:1442 (... || tier === "full" ? tierReasons : undefined) parses as intended — === binds tighter than ||/?: — matching the pre-existing pattern.

Fix these issues in Kilo Cloud


Reviewed by glm-5.2 · Input: 78.8K · Output: 18.9K · Cached: 754.9K

Review guidance: REVIEW.md from base branch main

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts (1)

219-241: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the repeated stderr-mute/restore pattern into a helper.

The save/stub/restore-in-finally block for process.stderr.write is duplicated verbatim across 4 tests in this file. A shared helper (e.g. withSilencedStderr(fn)) would remove the duplication and centralize the "restore even on throw" guarantee in one place, which matters for a global mutable like process.stderr.write under bun test.

♻️ Suggested helper
+async function withSilencedStderr<T>(fn: () => Promise<T>): Promise<T> {
+  const origWrite = process.stderr.write.bind(process.stderr)
+  process.stderr.write = (() => true) as typeof process.stderr.write
+  try {
+    return await fn()
+  } finally {
+    process.stderr.write = origWrite
+  }
+}

Then each test body becomes await withSilencedStderr(async () => { ... }).

Based on path instructions, tests touching shared/global state must provide safe teardown and isolation for parallel `bun test` execution; centralizing this pattern makes that guarantee easier to audit.

Also applies to: 278-296, 318-336, 352-366

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

In `@packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts` around lines
219 - 241, Extract the duplicated process.stderr.write save, silencing, and
finally-based restoration logic from the affected tests into a shared
withSilencedStderr helper. Update the four test bodies to execute their
reviewPullRequest assertions through this helper, preserving restoration even
when the callback throws and keeping each test’s existing behavior unchanged.

Source: Path instructions

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

Inline comments:
In `@docs/docs/usage/dbt-pr-review.md`:
- Around line 252-255: Update the riskTierPathTokens documentation to describe
values as case-insensitive path/word/digit-boundary tokens rather than arbitrary
substrings. In the section describing named categories and preset:finops, add a
clear non-match example such as “cost” not matching an unrelated word containing
those letters, while preserving the existing full-review and FinOps expansion
behavior.

---

Nitpick comments:
In `@packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts`:
- Around line 219-241: Extract the duplicated process.stderr.write save,
silencing, and finally-based restoration logic from the affected tests into a
shared withSilencedStderr helper. Update the four test bodies to execute their
reviewPullRequest assertions through this helper, preserving restoration even
when the callback throws and keeping each test’s existing behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 072a2579-7f31-488d-875d-c95afbf0db33

📥 Commits

Reviewing files that changed from the base of the PR and between 39d7d94 and afcca83.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • docs/docs/usage/dbt-pr-review.md
  • packages/opencode/src/altimate/review/orchestrate.ts
  • packages/opencode/src/altimate/review/run.ts
  • packages/opencode/src/altimate/review/verdict.ts
  • packages/opencode/src/cli/cmd/review.ts
  • packages/opencode/test/cli/tui/phase-label.tui-e2e.test.ts
  • packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts

Comment thread docs/docs/usage/dbt-pr-review.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 issues found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/opencode/test/cli/tui/phase-label.tui-e2e.test.ts">

<violation number="1" location="packages/opencode/test/cli/tui/phase-label.tui-e2e.test.ts:42">
P2: CI will report this critical TUI end-to-end coverage as skipped rather than detecting regressions in phase publishing or rendering. A retry/stabilized polling strategy or a separately quarantined job would preserve CI signal without disabling the entire test on every CI run.</violation>
</file>

<file name="packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts">

<violation number="1" location="packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts:220">
P3: The stderr-silencing pattern (`const origWrite = process.stderr.write.bind(...); process.stderr.write = ...; try { ... } finally { process.stderr.write = origWrite }`) is repeated verbatim across all four tests in this file. Consider extracting a small helper like:

```ts
function silenceStderr(): () => void {
  const orig = process.stderr.write.bind(process.stderr)
  process.stderr.write = (() => true) as typeof process.stderr.write
  return () => { process.stderr.write = orig }
}

This would reduce ~12 lines of duplication and centralize the restore-on-exit contract.


</details>

<sub>Reply with feedback, questions, or to request a fix.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/AltimateAI/altimate-code/1041/ai_pr_review_1784839945974_ff2cf364-e9dd-4cab-8ef6-7e567ae7456b?returnTo=https%3A%2F%2Fgithub.com%2FAltimateAI%2Faltimate-code%2Fpull%2F1041)</sub>

<!-- cubic:review-post:ai_pr_review_1784839945974_ff2cf364-e9dd-4cab-8ef6-7e567ae7456b:afcca831b983fd1067a1a21a2ac4e4b2c4030477:74d7d9ab-4ecc-4c49-aab3-fc7318d34d46 -->

// local sample observed 4/5 passes; the flake mode is real. Gate on CI so a
// cold runner doesn't intermittently block main — the local dev signal is
// preserved (the test still runs on developer machines).
const runTui = process.env["CI"] ? test.skip : test

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: CI will report this critical TUI end-to-end coverage as skipped rather than detecting regressions in phase publishing or rendering. A retry/stabilized polling strategy or a separately quarantined job would preserve CI signal without disabling the entire test on every CI run.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/test/cli/tui/phase-label.tui-e2e.test.ts, line 42:

<comment>CI will report this critical TUI end-to-end coverage as skipped rather than detecting regressions in phase publishing or rendering. A retry/stabilized polling strategy or a separately quarantined job would preserve CI signal without disabling the entire test on every CI run.</comment>

<file context>
@@ -32,8 +32,17 @@ import { describe, expect, test } from "bun:test"
+// local sample observed 4/5 passes; the flake mode is real. Gate on CI so a
+// cold runner doesn't intermittently block main — the local dev signal is
+// preserved (the test still runs on developer machines).
+const runTui = process.env["CI"] ? test.skip : test
+
 describe("TUI e2e — AI-7519 phase-label render", () => {
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Declined for this release. The alternative to a plain skip is a quarantined-job pattern that doesn't exist yet in this repo — worth a follow-up but not appropriate to design and land inside a patch release. The local dev signal is preserved (the test still runs on developer machines) and the flake mode itself was flagged by the persona review with a documented 4/5 pass rate, so test.skip(CI) is the honest short-term posture until a quarantine track exists.

Comment thread packages/opencode/src/altimate/review/run.ts
Comment thread packages/opencode/src/altimate/review/run.ts Outdated
Comment thread docs/docs/usage/dbt-pr-review.md Outdated
Comment thread packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts Outdated
Comment thread packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts Outdated
@@ -0,0 +1,367 @@
/**

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The stderr-silencing pattern (const origWrite = process.stderr.write.bind(...); process.stderr.write = ...; try { ... } finally { process.stderr.write = origWrite }) is repeated verbatim across all four tests in this file. Consider extracting a small helper like:

function silenceStderr(): () => void {
  const orig = process.stderr.write.bind(process.stderr)
  process.stderr.write = (() => true) as typeof process.stderr.write
  return () => { process.stderr.write = orig }
}

This would reduce ~12 lines of duplication and centralize the restore-on-exit contract.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts, line 220:

<comment>The stderr-silencing pattern (`const origWrite = process.stderr.write.bind(...); process.stderr.write = ...; try { ... } finally { process.stderr.write = origWrite }`) is repeated verbatim across all four tests in this file. Consider extracting a small helper like:

```ts
function silenceStderr(): () => void {
  const orig = process.stderr.write.bind(process.stderr)
  process.stderr.write = (() => true) as typeof process.stderr.write
  return () => { process.stderr.write = orig }
}

This would reduce ~12 lines of duplication and centralize the restore-on-exit contract.

@@ -0,0 +1,367 @@ + await writeFile(changedFile, "select 1\n") + + // Silence expected stderr warning during the test. + const origWrite = process.stderr.write.bind(process.stderr) + process.stderr.write = (() => true) as typeof process.stderr.write + try { ```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not doing this release. 12 lines of duplication across four tests is not worth churning the adversarial file on a patch — this file gets rewritten every release anyway, so the DRY benefit doesn't compound.

Haider added 2 commits July 24, 2026 02:55
Bot review on the v0.9.3 release PR caught three correctness gaps and a
CI-blocking branding-audit trip. All fixed here so the release stays clean:

- **`cliVersion` default in `reviewPullRequest`.** Only the CLI command
  forwarded `Installation.VERSION`; the agent-invoked `dbt_pr_review` tool
  wrapper never did, so tool-path verdicts silently dropped
  `engine.cliVersion` and defeated the audit-trail promise the field was
  added for. Default the option to `Installation.VERSION` inside
  `reviewPullRequest` so both entry points populate it. (cubic P2 conf 9)

- **`staleManifest` deletion false-negative.** `detectStaleManifest`
  previously took `changedPaths: string[]` and tried to `stat` each — a
  deletion of a manifest-affecting model reported CLEAN because the file
  no longer exists on disk. The signed envelope then falsely certified a
  verdict against ghost models. Pass the full `ChangedFile[]` through
  instead and treat `deleted` / `renamed` manifest-affecting entries as
  unconditionally stale (they can't be stat'd but the manifest still
  references them, so the metadata is by definition out of date). Rename
  covers both sides so a rename-away and a rename-to both trip.
  (cubic P2 conf 8)

- **Docs boundary-matching wording + non-match example.** The
  `riskTierPathTokens` doc claimed "case-insensitive substrings" but
  `compilePathTokenResolver` actually anchors tokens at path/word/digit
  boundaries — `cost` fires on `mrt_cost_daily.sql` but not on
  `broadcaster.sql`. Correct the wording and add the non-match example
  so users don't configure tokens that don't match their intent.
  (cubic P2 conf 5 + coderabbit)

- **Branding-audit trip in `script/release-preflight.ts:609`.** The
  operational instruction telling the operator how to add the upstream
  remote (`git remote add upstream https://github.com/anomalyco/opencode.git`)
  legitimately names the upstream URL. The CI branding audit doesn't know
  operational text from branding drift; wrap the block in `altimate_change`
  markers so the audit skips it.
…s tests

Two new positive tests pin the fixes from the previous commit:

- `reviewPullRequest defaults cliVersion so the dbt_pr_review tool path
  gets audit provenance too` — invokes `reviewPullRequest` WITHOUT passing
  `cliVersion`, asserts `env.engine.cliVersion` is non-empty.
- `deleted manifest-affecting file trips staleness even though it can't
  be stat'd` — deletion of `models/orders.sql` with the manifest present
  must set `env.staleManifest === true`.

Two vacuous tests from the original v0.9.3 adversarial file are repaired
per cubic-review PR #1041:

- Grandparent walk-past regression test now plants an actual `grand/
  target/manifest.json` (a poisoned grandparent DAG), then invokes review
  from `grand/inner/subdir` where `inner/dbt_project.yml` has no
  compiled artifact. The assertion `env.manifestHash` must remain
  undefined AND the stderr breadcrumb must NOT reference the grandparent
  path — a regressed walker would announce a hit there. Previously the
  fixture just made an unrelated sibling directory, so the walker never
  had a real manifest to consider skipping.
- Symlink-loop test is removed. Its `looped -> tmp` fixture was a
  one-hop parent alias, not a cycle; `fs.realpath` resolves it in one
  step, so the test proved nothing about the try/catch fallback in
  `run.ts`. A real ELOOP fixture is filesystem-dependent and the
  fallback pattern is a straight try/catch obvious from a code read;
  cheaper to delete than to churn on a cross-platform cycle.
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@sahrizvi

Copy link
Copy Markdown
Contributor Author

Pushed 2 commits addressing the bot review + CI Marker Guard failure.

Fixed (a3e2a89 + e700a40):

  • [cubic P2 conf 9] dbt_pr_review tool now gets engine.cliVersion on its verdict envelope — defaulted from Installation.VERSION inside reviewPullRequest. Pinned by a new positive test.
  • [cubic P2 conf 8] detectStaleManifest now takes the full ChangedFile[] and treats deleted / renamed manifest-affecting entries as unconditionally stale (they can't be stat'd but the manifest still references them). Pinned by a new positive test.
  • [cubic P2 conf 5 + coderabbit] Docs wording corrected — riskTierPathTokens matches at path/word/digit boundaries, not arbitrary substrings; added a non-match example (cost fires on mrt_cost_daily.sql, not on broadcaster.sql).
  • [CI Marker Guard failure] Wrapped the git remote add upstream https://github.com/anomalyco/opencode.git operator hint in release-preflight.ts:609 in altimate_change markers so the branding audit skips the operational text. Branding audit now reports 0 leaks locally.
  • [cubic P3 conf 10] Grandparent walk-past adversarial test now plants a real poisoned grand/target/manifest.json so the assertion actually exercises the walker's stop-at-first-project-yml guard. Previously the fixture was an unrelated sibling directory.
  • [cubic P3 conf 10] Symlink-loop adversarial test removed. The looped -> tmp fixture was a one-hop parent alias, not a cycle; fs.realpath resolves it in one step. A real ELOOP fixture is filesystem-dependent and the try/catch fallback is obvious from a code read — cheaper to delete than to churn on a cross-platform cycle.

Declined:

  • [cubic P2 conf 9] phase-label.tui-e2e CI-signal-loss — the alternative to a plain skip is a quarantined-job pattern that doesn't exist yet in this repo; a follow-up is warranted but not this release. The local dev signal is preserved (the test still runs on developer machines).
  • [kilo + cubic P3] stderr-silencing helper extraction — 12 lines of duplication across four tests, not worth churning the adversarial file on this release.

Local status:

  • Typecheck: clean
  • bun test test/skill/release-v0.9.3-adversarial.test.ts test/altimate/review*.test.ts — 267 pass, 0 fail
  • Marker guard (--base origin/main --strict) — clean
  • Branding audit (--branding) — 0 leaks

Standing by for maintainer approval + merge.

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

1 similar comment
@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

Inline comments:
In `@packages/opencode/src/altimate/review/run.ts`:
- Around line 163-183: Update detectStaleManifest so deleted files remain
immediately stale, but renamed files are checked using their new path’s mtime
against manifestMtime before deciding freshness. Ensure renamed paths missing
from disk take the safe stale outcome via an explicit catch branch, while
preserving the existing stat-based handling for added and modified files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b6275484-8c0f-415c-9488-0a6cfbadbe82

📥 Commits

Reviewing files that changed from the base of the PR and between afcca83 and e700a40.

📒 Files selected for processing (4)
  • docs/docs/usage/dbt-pr-review.md
  • packages/opencode/src/altimate/review/run.ts
  • packages/opencode/test/skill/release-v0.9.3-adversarial.test.ts
  • script/release-preflight.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/docs/usage/dbt-pr-review.md

Comment on lines +163 to +183
async function detectStaleManifest(manifestAbs: string, changed: ChangedFile[], fsRoot: string): Promise<boolean> {
try {
const manifestMtime = (await stat(manifestAbs)).mtimeMs
for (const rel of changedPaths) {
if (!isManifestAffecting(rel)) continue
// `changedPaths` are repo-root relative (from `git diff --name-status`),
for (const f of changed) {
// For renamed files, the OLD path is what the manifest still knows about;
// check both sides so both a rename-away and a rename-to a
// manifest-affecting shape trigger the signal.
const paths: string[] = [f.path]
if (f.status === "renamed" && f.oldPath) paths.push(f.oldPath)
if (!paths.some(isManifestAffecting)) continue

// Deleted / renamed files no longer exist at their old path on disk, so
// stat would fail. The manifest still references them though, so the
// metadata is stale by definition — fire immediately.
if (f.status === "deleted" || f.status === "renamed") {
process.stderr.write(
`⚠️ manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
`Re-run \`dbt compile\` (or \`dbt build\`) to refresh before reviewing.\n`,
)
return true
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Renamed manifest-affecting files always report stale, even when the manifest was recompiled after the rename.

For deleted files, forcing stale = true is the only option since the old path can't be stat'd. But for renamed files, f.path is the new location and does exist on disk — the code never attempts to stat it and compare against manifestMtime, unlike the added/modified path below. Any rename of a manifest-affecting file will unconditionally mark staleManifest: true in the signed envelope, even if dbt compile was re-run after the rename and the manifest is actually fresh. This weakens the audit signal this PR is specifically trying to harden — auditors will see spurious staleManifest: true on any PR containing a rename.

🐛 Proposed fix: only force-stale on deleted; check new-path mtime for renames
-      // Deleted / renamed files no longer exist at their old path on disk, so
-      // stat would fail. The manifest still references them though, so the
-      // metadata is stale by definition — fire immediately.
-      if (f.status === "deleted" || f.status === "renamed") {
+      // Deleted files no longer exist on disk, so stat would fail. The
+      // manifest still references them though, so the metadata is stale by
+      // definition — fire immediately. Renamed files fall through to the
+      // mtime check below against their NEW path, which does exist on disk.
+      if (f.status === "deleted") {
         process.stderr.write(
           `⚠️  manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
             `Re-run \`dbt compile\` (or \`dbt build\`) to refresh before reviewing.\n`,
         )
         return true
       }
Note the fallback `catch` block below already treats a stat failure as "skip", so if a renamed file's new path is unexpectedly missing, this would silently no-op rather than force-stale — worth adding an explicit `catch` branch for `f.status === "renamed"` to preserve the safe-default behavior in that edge case.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async function detectStaleManifest(manifestAbs: string, changed: ChangedFile[], fsRoot: string): Promise<boolean> {
try {
const manifestMtime = (await stat(manifestAbs)).mtimeMs
for (const rel of changedPaths) {
if (!isManifestAffecting(rel)) continue
// `changedPaths` are repo-root relative (from `git diff --name-status`),
for (const f of changed) {
// For renamed files, the OLD path is what the manifest still knows about;
// check both sides so both a rename-away and a rename-to a
// manifest-affecting shape trigger the signal.
const paths: string[] = [f.path]
if (f.status === "renamed" && f.oldPath) paths.push(f.oldPath)
if (!paths.some(isManifestAffecting)) continue
// Deleted / renamed files no longer exist at their old path on disk, so
// stat would fail. The manifest still references them though, so the
// metadata is stale by definition — fire immediately.
if (f.status === "deleted" || f.status === "renamed") {
process.stderr.write(
`⚠️ manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
`Re-run \`dbt compile\` (or \`dbt build\`) to refresh before reviewing.\n`,
)
return true
}
async function detectStaleManifest(manifestAbs: string, changed: ChangedFile[], fsRoot: string): Promise<boolean> {
try {
const manifestMtime = (await stat(manifestAbs)).mtimeMs
for (const f of changed) {
// For renamed files, the OLD path is what the manifest still knows about;
// check both sides so both a rename-away and a rename-to a
// manifest-affecting shape trigger the signal.
const paths: string[] = [f.path]
if (f.status === "renamed" && f.oldPath) paths.push(f.oldPath)
if (!paths.some(isManifestAffecting)) continue
// Deleted files no longer exist on disk, so stat would fail. The
// manifest still references them though, so the metadata is stale by
// definition — fire immediately. Renamed files fall through to the
// mtime check below against their NEW path, which does exist on disk.
if (f.status === "deleted") {
process.stderr.write(
`⚠️ manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
`Re-run \`dbt compile\` (or \`dbt build\`) to refresh before reviewing.\n`,
)
return true
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/opencode/src/altimate/review/run.ts` around lines 163 - 183, Update
detectStaleManifest so deleted files remain immediately stale, but renamed files
are checked using their new path’s mtime against manifestMtime before deciding
freshness. Ensure renamed paths missing from disk take the safe stale outcome
via an explicit catch branch, while preserving the existing stat-based handling
for added and modified files.

@dev-punia-altimate dev-punia-altimate left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Code Review — OpenCodeReview (Gemini) — 1 finding(s)

  • 1 anchored to a line (posted inline when the comment stream is on)
  • 0 without a line anchor
All findings (full text)

1. packages/opencode/src/altimate/review/run.ts (L177-L183)

[🟠 MEDIUM] Unconditionally returning true for deleted or renamed files creates a permanent false positive for any PR containing these operations. Since changedFiles represents the diff of the entire PR, a deleted file will always appear in the list, causing this function to flag the manifest as stale even if dbt compile was freshly run.

To correctly detect if the manifest is older than the deletion/rename operation without false positives, you can compare the manifestMtime against the parent directory's mtime. A directory's mtime updates when files within it are added, removed, or renamed.

      if (f.status === "deleted" || f.status === "renamed") {
        try {
           // For deletions/renames, the parent directory's mtime reflects the structural change.
           const dirMtime = (await stat(path.dirname(abs))).mtimeMs
           if (dirMtime > manifestMtime) {
             process.stderr.write(
               `⚠️  manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
                 `Re-run \`dbt compile\` (or \`dbt build\`) to refresh before reviewing.\n`,
             )
             return true
           }
        } catch {
           /* parent dir might also be deleted, safely ignore or fallback */
        }
        continue
      }

Comment on lines +177 to +183
if (f.status === "deleted" || f.status === "renamed") {
process.stderr.write(
`⚠️ manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
`Re-run \`dbt compile\` (or \`dbt build\`) to refresh before reviewing.\n`,
)
return true
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[🟠 MEDIUM] Unconditionally returning true for deleted or renamed files creates a permanent false positive for any PR containing these operations. Since changedFiles represents the diff of the entire PR, a deleted file will always appear in the list, causing this function to flag the manifest as stale even if dbt compile was freshly run.

To correctly detect if the manifest is older than the deletion/rename operation without false positives, you can compare the manifestMtime against the parent directory's mtime. A directory's mtime updates when files within it are added, removed, or renamed.

      if (f.status === "deleted" || f.status === "renamed") {
        try {
           // For deletions/renames, the parent directory's mtime reflects the structural change.
           const dirMtime = (await stat(path.dirname(abs))).mtimeMs
           if (dirMtime > manifestMtime) {
             process.stderr.write(
               `⚠️  manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
                 `Re-run \`dbt compile\` (or \`dbt build\`) to refresh before reviewing.\n`,
             )
             return true
           }
        } catch {
           /* parent dir might also be deleted, safely ignore or fallback */
        }
        continue
      }

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 issues found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/opencode/src/altimate/review/run.ts">

<violation number="1" location="packages/opencode/src/altimate/review/run.ts:177">
P2: When `detectStaleManifest` fires for a renamed file where only `f.oldPath` (not `f.path`) matches `isManifestAffecting`, the stderr warning misleadingly claims the new path is manifest-affecting. For a rename from `models/old.sql` to `analyses/analysis.sql`, the message would say `renamed \`analyses/analysis.sql\` is a manifest-affecting path` even though `analyses/analysis.sql` is not manifest-affecting — the old path (`models/old.sql`) is. Consider reporting the old path (or both) in the diagnostic when the renamed file's old path is what triggered the manifest-affecting check.</violation>

<violation number="2" location="packages/opencode/src/altimate/review/run.ts:177">
P2: Fresh manifests can never clear `staleManifest` for PRs that rename or delete a dbt input: this branch returns before any freshness check, so re-running `dbt compile` produces the same warning and signed stale verdict. Determine whether the manifest still references the old path (or otherwise compare it to the current revision) before setting the flag.</violation>
</file>

<file name="docs/docs/usage/dbt-pr-review.md">

<violation number="1" location="docs/docs/usage/dbt-pr-review.md:254">
P3: The `cost` vs. `broadcaster.sql` example in the `riskTierPathTokens` docs is technically incorrect — `cost` is not a substring of `broadcaster` at all (the word contains `cast`). This makes the boundary-matching example misleading. Replace it with a pair where the token actually appears as a substring but is correctly rejected by the boundary regex, such as `cost` matching `mrt_cost_daily.sql` but NOT `telecostanalysis.sql`, or `cast` matching `models/marts/address_cast.sql` but NOT `models/broadcaster.sql`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

// Deleted / renamed files no longer exist at their old path on disk, so
// stat would fail. The manifest still references them though, so the
// metadata is stale by definition — fire immediately.
if (f.status === "deleted" || f.status === "renamed") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: When detectStaleManifest fires for a renamed file where only f.oldPath (not f.path) matches isManifestAffecting, the stderr warning misleadingly claims the new path is manifest-affecting. For a rename from models/old.sql to analyses/analysis.sql, the message would say renamed \analyses/analysis.sql` is a manifest-affecting patheven thoughanalyses/analysis.sql is not manifest-affecting — the old path (models/old.sql`) is. Consider reporting the old path (or both) in the diagnostic when the renamed file's old path is what triggered the manifest-affecting check.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/src/altimate/review/run.ts, line 177:

<comment>When `detectStaleManifest` fires for a renamed file where only `f.oldPath` (not `f.path`) matches `isManifestAffecting`, the stderr warning misleadingly claims the new path is manifest-affecting. For a rename from `models/old.sql` to `analyses/analysis.sql`, the message would say `renamed \`analyses/analysis.sql\` is a manifest-affecting path` even though `analyses/analysis.sql` is not manifest-affecting — the old path (`models/old.sql`) is. Consider reporting the old path (or both) in the diagnostic when the renamed file's old path is what triggered the manifest-affecting check.</comment>

<file context>
@@ -152,28 +153,51 @@ export function isManifestAffecting(rel: string): boolean {
+      // Deleted / renamed files no longer exist at their old path on disk, so
+      // stat would fail. The manifest still references them though, so the
+      // metadata is stale by definition — fire immediately.
+      if (f.status === "deleted" || f.status === "renamed") {
+        process.stderr.write(
+          `⚠️  manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
</file context>

// Deleted / renamed files no longer exist at their old path on disk, so
// stat would fail. The manifest still references them though, so the
// metadata is stale by definition — fire immediately.
if (f.status === "deleted" || f.status === "renamed") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Fresh manifests can never clear staleManifest for PRs that rename or delete a dbt input: this branch returns before any freshness check, so re-running dbt compile produces the same warning and signed stale verdict. Determine whether the manifest still references the old path (or otherwise compare it to the current revision) before setting the flag.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/src/altimate/review/run.ts, line 177:

<comment>Fresh manifests can never clear `staleManifest` for PRs that rename or delete a dbt input: this branch returns before any freshness check, so re-running `dbt compile` produces the same warning and signed stale verdict. Determine whether the manifest still references the old path (or otherwise compare it to the current revision) before setting the flag.</comment>

<file context>
@@ -152,28 +153,51 @@ export function isManifestAffecting(rel: string): boolean {
+      // Deleted / renamed files no longer exist at their old path on disk, so
+      // stat would fail. The manifest still references them though, so the
+      // metadata is stale by definition — fire immediately.
+      if (f.status === "deleted" || f.status === "renamed") {
+        process.stderr.write(
+          `⚠️  manifest ${manifestAbs} appears stale — ${f.status} \`${f.path}\` is a manifest-affecting path. ` +
</file context>


Named categories under `riskTierPathTokens` promote any diff touching a matching
path to `full` review tier, so those areas never auto-approve on `trivial`
classification. Tokens are matched **case-insensitively at path, word, or digit

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The cost vs. broadcaster.sql example in the riskTierPathTokens docs is technically incorrect — cost is not a substring of broadcaster at all (the word contains cast). This makes the boundary-matching example misleading. Replace it with a pair where the token actually appears as a substring but is correctly rejected by the boundary regex, such as cost matching mrt_cost_daily.sql but NOT telecostanalysis.sql, or cast matching models/marts/address_cast.sql but NOT models/broadcaster.sql.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/docs/usage/dbt-pr-review.md, line 254:

<comment>The `cost` vs. `broadcaster.sql` example in the `riskTierPathTokens` docs is technically incorrect — `cost` is not a substring of `broadcaster` at all (the word contains `cast`). This makes the boundary-matching example misleading. Replace it with a pair where the token actually appears as a substring but is correctly rejected by the boundary regex, such as `cost` matching `mrt_cost_daily.sql` but NOT `telecostanalysis.sql`, or `cast` matching `models/marts/address_cast.sql` but NOT `models/broadcaster.sql`.</comment>

<file context>
@@ -251,12 +251,16 @@ rubric:
-this config. When a category value is invalid the CLI logs a stderr warning AND
-surfaces the error in the verdict envelope's `tierReasons[]` (and in the PR
-comment), so a typo can't silently kill your opt-in.
+classification. Tokens are matched **case-insensitively at path, word, or digit
+boundaries** — not as arbitrary substrings. For example, the token `cost` fires
+on `models/marts/mrt_cost_daily.sql` (bounded by `_` and `_`) but **not** on
</file context>

@sahrizvi
sahrizvi requested a review from suryaiyer95 July 23, 2026 21:53
@sahrizvi

Copy link
Copy Markdown
Contributor Author
image Sanity tested using a build from this branch. Also attached is the full review of https://github.com/AltimateAI/altimate-ingestion/pull/1158 via this build. [pr_review_1158.md](https://github.com/user-attachments/files/30325938/pr_review_1158.md)

Merging.

@dev-punia-altimate

Copy link
Copy Markdown
Contributor

🤖 Code Review — OpenCodeReview (Gemini) — No Issues Found

No supported files changed.

@sahrizvi
sahrizvi merged commit a441d17 into main Jul 23, 2026
36 of 37 checks passed
@sahrizvi sahrizvi mentioned this pull request Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release: v0.9.3

3 participants