Skip to content

fix: single-source the framework version - #23

Merged
sebyx07 merged 5 commits into
mainfrom
feat/cli-planned-commands
Aug 10, 2026
Merged

sebyx07 merged 5 commits into
mainfrom
feat/cli-planned-commands

Conversation

@sebyx07

@sebyx07 sebyx07 commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Consolidated framework version from 3 scattered sources into a single source of truth:

  • packages/core/src/version.ts exports FRAMEWORK_VERSION — loaded from root package.json at build time
  • packages/cli/src/version-loader.ts reads the root package.json to avoid circular dependency at module initialization
  • CLI's CLI_VERSION now derives from FRAMEWORK_VERSION
  • @ultimat3/mcp (dev-host.ts, wire.ts) now uses FRAMEWORK_VERSION instead of hardcoded '0.0.1'
  • Generated apps (x new) scaffold 14 @ultimat3/* package versions from the framework version, no hardcoding

Test plan

  • bun run verify 16/16 (typecheck, lint, boundaries, filesize, package-shape, errors, unit, contract, live, e2e, budgets, manifest)
  • Commit f0900b5 landed cleanly on current main
  • Pre-commit hook (Biome) passed clean

🤖 Generated with Claude Code


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

Summary by CodeRabbit

  • New Features
    • Added CLI commands for error lookup, job management, declaration inspection, and boundary-fix planning.
    • Expanded test selection with test-type filters, file filters, and sampling.
    • Added structured JSON output and improved suggestions for unknown commands, errors, jobs, and declarations.
    • Added consistent error titles, documentation links, and package-wide error catalog coverage.
  • Bug Fixes
    • Improved authentication, email, database, SMTP, and network troubleshooting guidance with actionable commands and configuration details.
    • Prevented duplicate error registrations and corrected the SEO budget error code.
  • Documentation
    • Updated CLI, verification, error-code, troubleshooting, and upgrade references.

sebyx07 and others added 4 commits August 10, 2026 01:29
Six planned commands built, and the other 13 made honest.

- x actions|queries|entities [list|describe <name>] — the declaration
  registries, one generic implementation over a three-row table
- x jobs ls|show|retry|drain — depth, dead letters, step traces,
  retry --from-step, drain --to; enqueue-then-ack so a crash duplicates
  (deduped by idempotency key) instead of losing a job
- x test <type> — the positional now means one of the six types, decided
  by verify-tests.ts's own table; --filter takes the old free-text job,
  --sample N gives the eval loop a fast partial signal that is not a gate
- x errors explain <CODE> / list — refuses an unregistered code with the
  nearest real one instead of inventing an explanation
- x fix boundary <file> — the command every X_SURFACE_BOUNDARY finding
  already named; prints the minimal cut and generates the shared/ split,
  writes nothing
- the 13 still-planned commands are in the registry and exit
  X_NOT_IMPLEMENTED with a fix naming the closest shipped command;
  X_CLI_UNKNOWN_COMMAND said "you typed something that does not exist",
  which was false

Error contract, without which x errors explain is a broken command:

- 11 packages never registered their titles, so 59 of 169 codes answered
  "not a registered error code". They register now, guarded.
- error-catalog.ts imports every @ultimat3/* package before x errors
  answers, and names under data.unavailable any that would not load
- X_BUDGET_EXCEEDED was owned by both render and seo, registered
  unguarded — load order decided the title, and the loser would have
  thrown X_ERROR_CODE_DUPLICATE at import. seo's is now
  X_SEO_BUDGET_EXCEEDED; policy, ui and seo all guard their registration
- 4 new CLI codes: X_ERROR_CODE_UNKNOWN, X_DECLARATION_UNKNOWN,
  X_JOB_UNKNOWN, X_FIX_TARGET_UNKNOWN

x verify 15/15 green; full suite 3352 pass, failure set byte-identical
to the pre-existing examples/dummy baseline.

Co-Authored-By: Claude <noreply@anthropic.com>
Dispatch fallback for unknown command now throws UnknownCommandError with a suggestion,
replacing bare Error that violated the error contract.

Co-Authored-By: Claude <noreply@anthropic.com>
New `x verify` step `errors` (16 steps now), enforcing what
docs/architecture/04-error-contract.md only described:

- an empty `fix:`, or one saying `check` / `make sure` / `try` /
  `see the docs` with no command, call or file path -> X_ERROR_FIX_INVALID
- a declared X_* code with no row in the error reference ->
  X_ERROR_CODE_UNDOCUMENTED, contributed by this repo as a host check on
  the step, the same seam the tier table uses on `boundaries`

`ts-scan.ts` masks comments and string contents before reading structure,
spans the whole `fix:` expression (ternary, `??`) at bracket depth 0, and
blanks `${…}` so an interpolated `new URL(url).host` cannot launder advice
into an instruction. A runtime-computed `fix` has no literal and is stated
as out of reach rather than silently skipped.

Turning it on found real drift, now fixed: 17 advice-only fix lines across
auth/mail/realtime and the reference app, an empty `?? ''` fallback in
smtp-client, three vague entries in indirect FIXES tables, and 19 shipped
codes with no docs row.

`source-files.ts` is now the one source-file list `filesize` and `errors`
both read.

Co-Authored-By: Claude <noreply@anthropic.com>
- Create `packages/core/src/version.ts` with `FRAMEWORK_VERSION` loaded from root `package.json` at build time
- Export `FRAMEWORK_VERSION` from `@ultimat3/core` so all packages can import from one place
- Update CLI to use `FRAMEWORK_VERSION`: `packages/cli/src/version-loader.ts` reads the root package.json to avoid circular initialization; `CLI_VERSION` now derives from it
- Update `packages/mcp/src/dev-host.ts` and `packages/mcp/src/wire.ts` to use `FRAMEWORK_VERSION` instead of hardcoded `'0.0.1'`
- Update `x new` scaffold template to use the framework version from CLI at generation time — all 14 `@ultimat3/*` package versions in generated `package.json` now use the framework version instead of hardcoded

`bun run verify` 16/16 ✓

Co-Authored-By: Claude <noreply@anthropic.com>
@sebyx07 sebyx07 added the claudetm Created by Claude Task Master label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 92439d71-8cc3-414c-8574-81d2a18ddf35

📥 Commits

Reviewing files that changed from the base of the PR and between f0900b5 and 8005190.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock, !**/bun.lock
📒 Files selected for processing (95)
  • examples/dummy/apps/web/app/posts/errors.ts
  • packages/action/src/errors.ts
  • packages/admin/src/errors.test.ts
  • packages/admin/src/errors.ts
  • packages/ai/src/errors.ts
  • packages/auth/CLAUDE.md
  • packages/auth/src/errors.ts
  • packages/auth/src/index.ts
  • packages/auth/src/oauth-exchange.ts
  • packages/auth/src/oauth-profile.ts
  • packages/auth/src/rate-limit.ts
  • packages/cache/src/errors.test.ts
  • packages/cache/src/errors.ts
  • packages/cli/CLAUDE.md
  • packages/cli/README.md
  • packages/cli/src/app-boundaries.test.ts
  • packages/cli/src/app-boundaries.ts
  • packages/cli/src/boundary-cuts.test.ts
  • packages/cli/src/boundary-cuts.ts
  • packages/cli/src/cmd-errors.ts
  • packages/cli/src/cmd-fix.test.ts
  • packages/cli/src/cmd-fix.ts
  • packages/cli/src/cmd-jobs.test.ts
  • packages/cli/src/cmd-jobs.ts
  • packages/cli/src/cmd-test.test.ts
  • packages/cli/src/cmd-test.ts
  • packages/cli/src/dev-queue.test.ts
  • packages/cli/src/dev-queue.ts
  • packages/cli/src/dev-runtime.ts
  • packages/cli/src/error-catalog.test.ts
  • packages/cli/src/error-catalog.ts
  • packages/cli/src/error-contract.test.ts
  • packages/cli/src/error-contract.ts
  • packages/cli/src/errors.ts
  • packages/cli/src/index.ts
  • packages/cli/src/jobs-drain.test.ts
  • packages/cli/src/jobs-drain.ts
  • packages/cli/src/jobs-json.test.ts
  • packages/cli/src/jobs-json.ts
  • packages/cli/src/jobs-report.test.ts
  • packages/cli/src/jobs-report.ts
  • packages/cli/src/jobs-table.test.ts
  • packages/cli/src/jobs-table.ts
  • packages/cli/src/messages.ts
  • packages/cli/src/test-select.test.ts
  • packages/cli/src/test-select.ts
  • packages/cli/src/test-shards.test.ts
  • packages/cli/src/test-shards.ts
  • packages/cli/src/ts-scan.test.ts
  • packages/cli/src/ts-scan.ts
  • packages/cli/src/version-loader.test.ts
  • packages/cli/src/version-loader.ts
  • packages/cli/src/workspace-checks.test.ts
  • packages/cli/src/workspace-checks.ts
  • packages/core/src/index.ts
  • packages/core/src/version.test.ts
  • packages/core/src/version.ts
  • packages/db/src/errors.ts
  • packages/entity/src/errors.ts
  • packages/http/CLAUDE.md
  • packages/http/src/error-map.test.ts
  • packages/http/src/error-map.ts
  • packages/http/src/errors.test.ts
  • packages/http/src/errors.ts
  • packages/i18n/src/errors.ts
  • packages/jobs/src/errors.test.ts
  • packages/jobs/src/errors.ts
  • packages/mail/src/driver-resend.ts
  • packages/mail/src/driver-smtp.ts
  • packages/mail/src/errors.ts
  • packages/mail/src/smtp-client.ts
  • packages/mail/src/smtp-socket.ts
  • packages/manifest/src/errors.ts
  • packages/mcp/src/errors.ts
  • packages/money/src/errors.ts
  • packages/policy/src/errors.ts
  • packages/pwa/src/errors.test.ts
  • packages/pwa/src/errors.ts
  • packages/query/src/errors.ts
  • packages/realtime/src/errors.test.ts
  • packages/realtime/src/errors.ts
  • packages/realtime/src/pg-auth.ts
  • packages/realtime/src/pg-connection.ts
  • packages/render/src/errors.ts
  • packages/schema/src/errors.ts
  • packages/seo/src/errors.ts
  • packages/storage/CLAUDE.md
  • packages/storage/src/errors.ts
  • packages/testing/src/errors.test.ts
  • packages/testing/src/errors.ts
  • packages/time/src/errors.ts
  • packages/ui/src/errors.ts
  • wiki/CLI-Reference.md
  • wiki/Error-Codes.md
  • wiki/Getting-Started.md
📝 Walkthrough

Walkthrough

The PR adds CLI commands for error inspection, boundary-fix planning, jobs, registries, planned commands, and typed test selection. It adds error-contract verification, package error metadata registration, version propagation, operational diagnostics, and documentation updates.

Changes

CLI verification and error contracts

Layer / File(s) Summary
Error scanning and verification
packages/cli/src/error-contract.ts, packages/cli/src/ts-scan.ts, packages/cli/src/cmd-verify.ts, scripts/verify.ts
x verify now checks actionable fixes and documented X_* codes.
Error catalog and explanations
packages/cli/src/error-catalog.ts, packages/cli/src/cmd-errors.ts, packages/cli/src/errors.ts
The CLI loads package error codes and supports x errors explain and x errors list.
Package error metadata
packages/*/src/errors.ts, packages/*/src/errors.test.ts
Packages export error titles, conditionally register codes, and test registry consistency.

Operational CLI commands

Layer / File(s) Summary
Boundary-fix planning
packages/cli/src/app-boundaries.ts, packages/cli/src/boundary-cuts.ts, packages/cli/src/cmd-fix.ts
x fix boundary resolves targets and returns read-only boundary-cut plans.
Job operations
packages/cli/src/jobs-report.ts, packages/cli/src/cmd-jobs.ts
x jobs lists, inspects, retries, and drains jobs with JSON and dry-run support.
Registry and planned commands
packages/cli/src/cmd-registries.ts, packages/cli/src/cmd-planned.ts, packages/cli/src/registry.ts
The CLI exposes declaration registries and planned commands with runnable replacements.
Typed test selection
packages/cli/src/test-select.ts, packages/cli/src/cmd-test.ts
x test supports test types, filters, deterministic sampling, and selection-aware reproduction data.

Runtime and diagnostics

Layer / File(s) Summary
Queue and version lifecycle
packages/cli/src/dev-runtime.ts, packages/cli/src/version-loader.ts, packages/core/src/version.ts, packages/cli/src/templates/scaffold-repo.ts
Queue cleanup is centralized, and framework versions flow into generated repositories and MCP server metadata.
Diagnostic guidance
packages/auth/src/*, packages/mail/src/*, packages/realtime/src/*, examples/dummy/apps/web/app/posts/errors.ts
Fix messages now include specific hosts, commands, credentials, configuration, and ownership context.
Documentation alignment
docs/architecture/04-error-contract.md, wiki/CLI-Reference.md, wiki/Error-Codes.md, wiki/Upgrading.md
Documentation describes the new verification rules, commands, error codes, and troubleshooting flow.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.16% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: consolidating the framework version into a single source of truth.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-planned-commands

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

@developerz-ai

developerz-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

CI passed (verify step: success). The changes consolidate framework version into a single source of truth — a patch-level fix with no breaking changes.

Ready to merge when you're ready. Feel free to apply a ready-to-merge label.

🤖 Posted by developerz.ai — the maintainer agent, not a human.

@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: 39

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/manifest/src/errors.ts (1)

4-26: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve duplicate error-code failures.

hasErrorCode() converts an error-code ownership collision into an import-order-dependent registration. If another module registers the code first, the canonical title is skipped and x errors explain can show the wrong contract instead of failing with X_ERROR_CODE_DUPLICATE.

  • packages/manifest/src/errors.ts#L4-L26: Register the complete manifest declaration set without the hasErrorCode() bypass.
  • packages/money/src/errors.ts#L6-L30: Register the complete money declaration set without the hasErrorCode() bypass.
  • packages/render/src/errors.ts#L6-L34: Register the complete render declaration set without the hasErrorCode() bypass.

As per path instructions, “Define once, project everywhere” and package src/errors.ts owns its X_* codes.

🤖 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/manifest/src/errors.ts` around lines 4 - 26, Remove the
hasErrorCode() bypass so each package registers its complete canonical error
declaration set and duplicate ownership still throws X_ERROR_CODE_DUPLICATE:
update packages/manifest/src/errors.ts lines 4-26, packages/money/src/errors.ts
lines 6-30, and packages/render/src/errors.ts lines 6-34. Preserve each
package’s existing error-code and title declarations while making the
registration unconditional.

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 `@packages/auth/src/oauth-exchange.ts`:
- Line 131: Update every listed fix value so it contains exactly one complete,
shell-valid, executable command: packages/auth/src/oauth-exchange.ts (131-131)
and packages/auth/src/oauth-profile.ts (69-69) must use connectivity commands;
examples/dummy/apps/web/app/posts/errors.ts (10-10) must resolve an authorized
post reference; packages/auth/src/rate-limit.ts (100-100) must use a real
password-reset command; packages/mail/src/driver-resend.ts (164-164) must check
the configured endpoint; packages/mail/src/driver-smtp.ts (176-176 and 196-196)
must provide real SMTP route/configuration and log/health-check commands;
packages/realtime/src/pg-auth.ts (104-104 and 122-122) must provide complete
psql or connection diagnostics with valid argument handling; and
packages/realtime/src/pg-connection.ts (276-276) must validate or reload the
PostgreSQL replication rule. Move explanatory prose into cause, docs, or command
output, while preserving the stable fix contract.

In `@packages/cache/src/errors.ts`:
- Around line 21-24: Remove presence checks that suppress ownership conflicts:
in packages/cache/src/errors.ts:21-24, update the CACHE_ERROR_TITLES
registration to register cache-owned codes unconditionally while excluding only
borrowed X_NOT_IMPLEMENTED; in packages/i18n/src/errors.ts:22-26,
packages/jobs/src/errors.ts:31-35, packages/ui/src/errors.ts:15-24, and
packages/seo/src/errors.ts:24-34, register each package’s owned codes
unconditionally, excluding only borrowed core codes where applicable. In
packages/cache/src/errors.test.ts:96-116, add a regression test proving a
foreign pre-registration of a cache-owned code throws the duplicate error rather
than preserving the foreign title.

In `@packages/cli/README.md`:
- Around line 12-23: Add the required “As of 2026-07” qualifier before the
current command-contract claims in the README table, including the command and
step-count descriptions shown in the diff. Preserve the existing command names
and descriptions while clearly dating these load-bearing claims.

In `@packages/cli/src/boundary-cuts.ts`:
- Around line 110-117: Update the repair generation around relocate and
directImporters so each affected importer receives a replacement from the old
module path to the relocated path, rather than publishing only the git mv
command. Ensure Finding.fix contains both the move and all importer edits as a
complete actionable repair, and add a test that applies the planned path changes
and verifies no unresolved imports remain.
- Around line 136-140: Update the eligibility condition around `eligible`,
`surfacesReaching`, and `planSplit` so automatic relocation only applies to
`shared-is-a-leaf`; keep `site-imports-app` as a manual cut. Add an assertion
for the `apps/s1` fixture verifying that the repair does not perform a `git mv`
into `site/`.
- Around line 10-18: Move the rule-to-code mapping ownership to
app-boundaries.ts by exporting a conversion function or mapping there, then
remove the local CODE_OF mapping from boundary-cuts.ts and reuse the exported
symbol when converting checkSurfaceBoundary rules. Preserve the existing
BoundaryRule-to-BoundaryCode values and keep both x verify and x fix on the
shared contract.

In `@packages/cli/src/cmd-errors.ts`:
- Around line 61-67: Move the user-facing summary and usage text from the
errorsCommand spec into messages.ts as message keys, then set spec.summary and
spec.usage by resolving those keys with msg(). Keep the existing command
behavior and text unchanged.

In `@packages/cli/src/cmd-fix.ts`:
- Line 34: Move the user-facing ambiguous-target reason in cmd-fix.ts, plus the
command summary and usage text, into message definitions in
packages/cli/src/messages.ts; update cmd-fix.ts to retrieve all three through
msg() rather than inline literals. Apply the changes at
packages/cli/src/cmd-fix.ts lines 34 and 85-89, preserving the existing
interpolation values and rendered text.

In `@packages/cli/src/cmd-jobs.ts`:
- Around line 104-113: Route all user-facing strings through msg(): in
packages/cli/src/cmd-jobs.ts lines 104-113, add messages.ts entries for the
dead-letter heading and missing-error fallback and use them; in
packages/cli/src/cmd-jobs.ts lines 189-201, move command summaries, usage text,
and flag summaries into messages.ts and reference them via msg(); in
packages/cli/src/jobs-report.ts lines 315-331, replace inline table header
literals with localized messages. Keep Finding.cause and Finding.fix literals
inline as stable machine-readable diagnostics.

In `@packages/cli/src/cmd-registries.ts`:
- Around line 64-128: Move the user-facing registry help text in
packages/cli/src/cmd-registries.ts#L64-L128 into messages.ts: replace the inline
summary and usage literals in ACTIONS and QUERIES (and any affected registry
specs) with message lookups, leaving diagnostic fix literals inline. In
packages/cli/src/cmd-planned.ts#L25-L114, update the planned-command definitions
to store message keys for summaries and usage, then resolve them through msg()
in specFor(); do not change non-help diagnostic text.

In `@packages/cli/src/cmd-test.ts`:
- Around line 209-225: Move the new user-facing command summary, usage text, and
summaries for the workers, worker, filter, and sample flags into the message
catalog in messages.ts. Update the command definition around the test command
configuration to reference the catalog entries instead of inline string
literals, preserving the existing wording.
- Around line 4-5: Extract the shard planning and worker-process coordination
logic from cmd-test.ts into a focused module, leaving command parsing and
command metadata in cmd-test.ts. Update the command flow to use the extracted
module while preserving existing sharding behavior, and keep each file within
the package’s roughly 200-line responsibility target.
- Around line 76-83: Update the command construction around the parts array so
the dynamic filter argument is shell-escaped or quoted before parts.join(' ')
renders it, while preserving the existing flag structure and worker arguments.
Add a regression test covering a filter containing whitespace and verify the
generated fix command remains executable and reproduces the original argument.
- Around line 228-231: Update CommandTest.run to reject more than one positional
argument before calling discovery or readType, returning BadFlagError with an
executable usage fix. Preserve single-positional and zero-positional behavior,
and add a regression test confirming extra positionals do not run a runner.
- Around line 70-83: Preserve the kept sample count throughout shard
reproduction and metadata: store it in RunShardsOptions.sample, pass it through
reproduceFor, and include --sample with that count in generated commands. Render
the stored value in data.sample and the sampled summary so --worker reflects the
selected corpus rather than only its shard. Keep diagnostic cause and fix fields
stable, machine-readable, and executable across the affected paths.

In `@packages/cli/src/dev-runtime.ts`:
- Around line 148-151: Update RunningQueue.stop() to clear the ambient job
driver registered by startJobs() before closing the database, and close the
driver when it owns resources. Preserve the existing database-client cleanup
while ensuring standalone queue shutdown cannot leave a stale driver for
subsequent commands.
- Around line 126-165: Move the RunningQueue interface and startQueue function,
including their database/job startup and cleanup logic, into a dedicated
queue-specific module. Remove these queue lifecycle responsibilities from
dev-runtime.ts, update imports and callers to use the new module, and preserve
the existing startup, failure cleanup, and stop behavior.

In `@packages/cli/src/error-catalog.test.ts`:
- Line 5: Add a rationale comment next to the node:path import used by
error-catalog.test.ts, explaining that join is required because Bun does not
provide a native path API. Keep the existing import and behavior unchanged.

In `@packages/cli/src/error-catalog.ts`:
- Around line 73-78: Update the import handling in the package-loading flow
around the try/catch to continue only for documented optional-host import
failures; re-throw initialization failures such as X_ERROR_CODE_DUPLICATE and
invalid registrations, or surface their structured error details instead of
adding them to unavailable. Preserve the existing loaded/unavailable behavior
for genuinely optional missing packages.

In `@packages/cli/src/error-contract.test.ts`:
- Around line 165-175: Remove the duplicate repository-level documentation
assertion from the describe('this repo') block by deleting the test that calls
checkErrorCodeDocs(root, 'wiki/Error-Codes.md'). Keep the checkErrorFixes
assertion and the package-level checkErrorCodeDocs behavior tests unchanged.

In `@packages/cli/src/error-contract.ts`:
- Line 7: Update checkErrorCodeDocs to remove the node:fs existsSync import and
create a single Bun.file() handle for each documentation path, reusing that
BunFile for both exists() and text() while preserving the current validation
behavior.

In `@packages/cli/src/jobs-report.ts`:
- Around line 51-60: Update parseLimitFlag to parse the trimmed value and
validate the result with Number.isSafeInteger(limit) and limit > 0 before
returning it, rejecting values above Number.MAX_SAFE_INTEGER through the
existing BadFlagError path. Add a test covering a limit greater than
Number.MAX_SAFE_INTEGER.
- Around line 315-324: Update renderJobTable’s runAt formatting to use the
shared date formatter with an explicit timeZone of 'Etc/UTC', or emit the epoch
value if this table must remain machine-oriented; remove the direct
toISOString() call and preserve the existing column output.
- Around line 202-332: Split jobs-report.ts so job operations remain in their
own module while the JSON projection functions (stepTraceToJson, jobTraceToJson,
jobRecordToJson, queueStatsToJson, depthToJson, deadLetterToJson, and
drainFailureToJson) move to a focused projection module and renderJobTable moves
to a focused table-rendering module. Update imports and exports so existing
callers retain the same behavior, and keep each resulting source file under
roughly 200 lines.
- Around line 183-193: Update the transfer flow around target.enqueue and
source.ack to persist the source job’s complete step state into the target
before it can be claimed, using the existing job/step persistence APIs. Ensure
source.ack(record.id) runs only after both the enqueued job and its steps are
durable, and add a drain test covering a suspended job with completed steps.
- Around line 162-177: Update the drain flow around inspectJobList and the
subsequent source.ack calls so source jobs cannot be claimed or executed between
snapshotting and acknowledgement. Stop or pause source consumers for the entire
transfer, or use a driver-level atomic transfer operation that verifies state or
lease ownership before moving each record; preserve dry-run behavior while
ensuring the target cannot receive jobs still owned by an active source worker.

In `@packages/cli/src/source-files.ts`:
- Around line 5-13: Add the example application source layout to SOURCE_GLOBS so
root error-contract scanning includes files such as
examples/dummy/apps/web/app/posts/errors.ts. Ensure the root bun run verify
command checks these example sources without requiring a separate nested
verification command.

In `@packages/cli/src/test-select.test.ts`:
- Line 1: Add a 1–4 line header comment before the imports in
test-select.test.ts explaining that the file isolates test-selection behavior
and why that separation is required. Keep the existing imports and test
implementation unchanged.

In `@packages/cli/src/test-select.ts`:
- Around line 5-6: Replace the Node-specific imports in
packages/cli/src/test-select.ts:5-6 with equivalent Bun-native APIs where
available; otherwise add a nearby comment explaining why statSync and join are
unavoidable. Apply the same approach to the temporary-directory helper imports
in packages/cli/src/cmd-test.test.ts:2-4, documenting each remaining node:
exception when Bun cannot provide equivalent behavior.

In `@packages/cli/src/ts-scan.ts`:
- Around line 28-35: Update endOfLiteral and the maskLiterals handling of
CODE_LITERAL to distinguish regex literals from quoted strings, so quote
characters inside regex patterns do not terminate masking or hide a later fix:
declaration. Add a regression test covering a minimal source containing that
regex and a valid fix: declaration, asserting the fix is returned.

In `@packages/core/src/version.ts`:
- Around line 10-17: Replace runtime workspace-root package.json loading in
packages/core/src/version.ts and packages/cli/src/version-loader.ts with the
same build-generated, validated version literal, preserving the exported version
APIs used by packages/core/src/index.ts and CLI_VERSION. Update the build
process to inject and validate this literal for published packages, then extend
x verify with a packed-install test that imports `@ultimat3/core` and runs x new
from outside a workspace.

In `@packages/jobs/src/errors.test.ts`:
- Around line 20-26: Remove the redundant literal-only test for
X_NOT_IMPLEMENTED in the errors test suite, including its hardcoded coreTitle
and both assertions. Keep the existing test that verifies
JOB_ERROR_TITLES.X_NOT_IMPLEMENTED against the registered core descriptor.

In `@packages/mail/src/smtp-client.ts`:
- Around line 66-71: Update the SMTP error definitions and their associated fix
values in the SMTP client, including the symbols at the greeting, timeout,
pool-size, and starttls/insecure-channel cases, so each fix is an executable
instruction: provide an exact command or precise file-edit instruction that
identifies the relevant SMTP URL, timeout, pool-size, or insecure-channel
setting to change. Preserve the existing diagnostic meaning while removing
prose-only or TypeScript-fragment guidance.

In `@packages/policy/src/errors.ts`:
- Around line 20-25: Register each error code from exactly one owner: in
packages/policy/src/errors.ts lines 20-25, remove the hasErrorCode defensive
registration and register policy-owned titles directly so duplicate detection
remains active; in packages/cli/src/errors.ts lines 51-54, keep
X_NOT_IMPLEMENTED core-owned and remove any CLI declaration or registration; in
packages/pwa/src/errors.ts lines 19-33, remove X_NOT_IMPLEMENTED from
PWA_ERROR_TITLES and guard only borrowed error usage; in
packages/pwa/src/errors.test.ts lines 11-13, test only PWA-owned titles and
verify the borrowed core title through the core registry without duplicating it.

In `@packages/realtime/src/errors.ts`:
- Around line 37-39: Update the initialization loop around REALTIME_ERROR_TITLES
to skip only the core-owned X_NOT_IMPLEMENTED entry, then register all remaining
realtime error declarations through a single registerErrorCodes() call. Remove
the hasErrorCode() guard so foreign ownership collisions are rejected atomically
by registerErrorCodes().

In `@packages/testing/src/errors.test.ts`:
- Line 9: Update the outer TESTING_ERROR_TITLES describe suite to wrap its label
with testName('unit', ...). Leave all inner test declarations unchanged so the
prefix is applied only once.

In `@packages/testing/src/errors.ts`:
- Around line 23-25: Preserve duplicate error-code detection by registering each
package declaration directly through the core registry, allowing collisions to
throw X_ERROR_CODE_DUPLICATE instead of silently reusing an existing title.
Update the loop in packages/testing/src/errors.ts at lines 23-25 and the
corresponding registration in packages/time/src/errors.ts at lines 34-36; remove
the hasErrorCode() guard at both sites.

In `@wiki/Error-Codes.md`:
- Line 193: Update the X_STORAGE_NOT_FOUND fix emitted in the storage error
definitions around the relevant error constant to use the shipped
disk('<disk>').list({ prefix: '<dir>' }) invocation instead of the unregistered
x storage ls command. Remove the corresponding caveat from wiki/Error-Codes.md
while preserving the troubleshooting guidance and avoiding registration of a new
CLI command.

In `@wiki/Getting-Started.md`:
- Line 120: Use a single canonical policy-denial code throughout
Getting-Started.md: update the row containing X_FORBIDDEN and the denial example
around X_POLICY_DENIED to match. Define the code once and project both
references from that canonical value so the documentation cannot drift.

---

Outside diff comments:
In `@packages/manifest/src/errors.ts`:
- Around line 4-26: Remove the hasErrorCode() bypass so each package registers
its complete canonical error declaration set and duplicate ownership still
throws X_ERROR_CODE_DUPLICATE: update packages/manifest/src/errors.ts lines
4-26, packages/money/src/errors.ts lines 6-30, and packages/render/src/errors.ts
lines 6-34. Preserve each package’s existing error-code and title declarations
while making the registration unconditional.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9975aecd-14be-425f-a4bf-01820f10f931

📥 Commits

Reviewing files that changed from the base of the PR and between 9931217 and f0900b5.

📒 Files selected for processing (108)
  • docs/architecture/04-error-contract.md
  • examples/dummy/apps/web/app/posts/errors.ts
  • packages/admin/src/errors.test.ts
  • packages/admin/src/errors.ts
  • packages/admin/src/index.ts
  • packages/auth/src/oauth-exchange.ts
  • packages/auth/src/oauth-profile.ts
  • packages/auth/src/rate-limit.ts
  • packages/cache/src/errors.test.ts
  • packages/cache/src/errors.ts
  • packages/cache/src/index.ts
  • packages/cli/CLAUDE.md
  • packages/cli/README.md
  • packages/cli/src/app-boundaries.test.ts
  • packages/cli/src/app-boundaries.ts
  • packages/cli/src/boundary-cuts.test.ts
  • packages/cli/src/boundary-cuts.ts
  • packages/cli/src/cmd-errors.test.ts
  • packages/cli/src/cmd-errors.ts
  • packages/cli/src/cmd-fix.test.ts
  • packages/cli/src/cmd-fix.ts
  • packages/cli/src/cmd-jobs.test.ts
  • packages/cli/src/cmd-jobs.ts
  • packages/cli/src/cmd-new.ts
  • packages/cli/src/cmd-planned.test.ts
  • packages/cli/src/cmd-planned.ts
  • packages/cli/src/cmd-registries.test.ts
  • packages/cli/src/cmd-registries.ts
  • packages/cli/src/cmd-test.test.ts
  • packages/cli/src/cmd-test.ts
  • packages/cli/src/cmd-verify.test.ts
  • packages/cli/src/cmd-verify.ts
  • packages/cli/src/dev-runtime.ts
  • packages/cli/src/dispatch.ts
  • packages/cli/src/error-catalog.test.ts
  • packages/cli/src/error-catalog.ts
  • packages/cli/src/error-contract.test.ts
  • packages/cli/src/error-contract.ts
  • packages/cli/src/errors.ts
  • packages/cli/src/index.ts
  • packages/cli/src/jobs-report.ts
  • packages/cli/src/mcp-errors.ts
  • packages/cli/src/messages.ts
  • packages/cli/src/registry.ts
  • packages/cli/src/source-files.ts
  • packages/cli/src/templates/scaffold-repo.ts
  • packages/cli/src/test-select.test.ts
  • packages/cli/src/test-select.ts
  • packages/cli/src/ts-scan.test.ts
  • packages/cli/src/ts-scan.ts
  • packages/cli/src/verify-step.ts
  • packages/cli/src/verify-tests.ts
  • packages/cli/src/version-loader.ts
  • packages/cli/src/workspace-checks.ts
  • packages/core/src/index.ts
  • packages/core/src/version.ts
  • packages/i18n/src/errors.test.ts
  • packages/i18n/src/errors.ts
  • packages/i18n/src/index.ts
  • packages/jobs/src/errors.test.ts
  • packages/jobs/src/errors.ts
  • packages/jobs/src/index.ts
  • packages/mail/src/driver-resend.ts
  • packages/mail/src/driver-smtp.ts
  • packages/mail/src/smtp-client.ts
  • packages/mail/src/smtp-socket.ts
  • packages/manifest/src/errors.test.ts
  • packages/manifest/src/errors.ts
  • packages/manifest/src/index.ts
  • packages/mcp/src/dev-host.ts
  • packages/mcp/src/wire.ts
  • packages/money/src/errors.test.ts
  • packages/money/src/errors.ts
  • packages/money/src/index.ts
  • packages/policy/src/errors.ts
  • packages/pwa/src/errors.test.ts
  • packages/pwa/src/errors.ts
  • packages/pwa/src/index.ts
  • packages/realtime/src/errors.test.ts
  • packages/realtime/src/errors.ts
  • packages/realtime/src/index.ts
  • packages/realtime/src/pg-auth.ts
  • packages/realtime/src/pg-connection.ts
  • packages/realtime/src/pg-socket.ts
  • packages/realtime/src/pg-wire.test.ts
  • packages/realtime/src/pg-wire.ts
  • packages/render/src/errors.test.ts
  • packages/render/src/errors.ts
  • packages/render/src/index.ts
  • packages/seo/README.md
  • packages/seo/src/budgets.test.ts
  • packages/seo/src/budgets.ts
  • packages/seo/src/errors.ts
  • packages/testing/src/errors.test.ts
  • packages/testing/src/errors.ts
  • packages/testing/src/index.ts
  • packages/time/src/errors.test.ts
  • packages/time/src/errors.ts
  • packages/time/src/index.ts
  • packages/ui/src/errors.ts
  • scripts/help.ts
  • scripts/verify.test.ts
  • scripts/verify.ts
  • wiki/CLI-Reference.md
  • wiki/Error-Codes.md
  • wiki/Getting-Started.md
  • wiki/Troubleshooting.md
  • wiki/Upgrading.md

Comment thread packages/auth/src/oauth-exchange.ts Outdated
Comment thread packages/cache/src/errors.ts Outdated
Comment thread packages/cli/README.md
Comment thread packages/cli/src/boundary-cuts.ts Outdated
Comment thread packages/cli/src/boundary-cuts.ts
Comment thread packages/realtime/src/errors.ts Outdated
Comment thread packages/testing/src/errors.test.ts Outdated
Comment thread packages/testing/src/errors.ts Outdated
Comment thread wiki/Error-Codes.md Outdated
Comment thread wiki/Getting-Started.md
Error-code ownership (was: silent import-order dependence)
- every packages/*/src/errors.ts registers its OWNED codes unconditionally in
  one registerErrorCodes() call; hasErrorCode() guards removed everywhere.
  Borrowed codes (core's X_NOT_IMPLEMENTED, policy's X_FORBIDDEN, auth's
  X_UNAUTHENTICATED, db's X_DB_DRIFT, action's X_INPUT_INVALID/X_RPC_FAILED)
  are listed as codes without a title and never re-registered — so two owners
  of one code now throw X_ERROR_CODE_DUPLICATE instead of whoever imports first
  silently winning. Six real double-declarations found and given one owner each.
- http's factsOf() reads the error's own resolved title, so a borrowed code
  renders its owner's title instead of repeating the code.

Errors are instructions
- 14 fix: lines rewritten as one executable command (auth, mail, realtime,
  storage, dummy app); explanation moved into cause:.
- x errors no longer reports a package that resolved-and-threw as merely
  "unavailable" — init failures arrive as findings with code, cause and fix.
- ts-scan disambiguates regex literals from strings; a quote inside a regex
  used to blank the rest of a file, hiding every fix: from the gate. Three
  files were silently unscanned, error-contract.ts among them.

Correctness
- x jobs drain leases each job via source.claim() before transferring, copies
  its step state to the target, and only then acks the source; unleased
  candidates are skipped and reported, ok: false.
- x fix boundary publishes the git mv plus every import specifier the move
  invalidates, and never relocates a module that would keep the forbidden edge.
- x test rejects extra positionals, shell-quotes dynamic args in reproduction
  commands, and carries --sample through shards and metadata.
- --limit rejects values above Number.MAX_SAFE_INTEGER.
- dev queue shutdown clears the ambient job driver, not just the db client.
- package-shape refuses a workspace package with no semver version; core and
  cli read their OWN package.json, never the versionless workspace root.

SRP splits: dev-queue.ts, test-shards.ts, jobs-drain/json/table.ts.
Docs: dated cli README claims, one canonical denial code in Getting-Started,
and packages/cli/CLAUDE.md now states what does NOT belong in messages.ts.

bun run verify 16/16 green; bun run test 3425 pass / 0 fail.
Reference-app gate failure set unchanged (verified by stash diff).

Co-Authored-By: Claude <noreply@anthropic.com>
@sebyx07
sebyx07 merged commit 0697711 into main Aug 10, 2026
8 checks passed
@sebyx07
sebyx07 deleted the feat/cli-planned-commands branch August 10, 2026 11:25
@developerz-ai

developerz-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🎉 Released v0.1.1 — thank you for the contribution!

🤖 Posted by developerz.ai — the maintainer agent, not a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudetm Created by Claude Task Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant