Skip to content

Harden SDK schema-driven input fidelity and package preflight - #499

Merged
unbraind merged 12 commits into
mainfrom
agent/schema-driven-input-fidelity
Jul 10, 2026
Merged

unbraind merged 12 commits into
mainfrom
agent/schema-driven-input-fidelity

Conversation

@unbraind

@unbraind unbraind commented Jul 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • make extension list: true flags preserve values across mixed long and short aliases
  • make template-defined custom item types participate in schema-driven create validation
  • reject malformed dependency shorthand consistently across create and update
  • preserve every repeated --ac value through Commander and normalize it once at the SDK boundary
  • expose reserved item-field names and reject package schemas that collide with core item fields
  • document the public contracts and cover the complete behavior through unit, integration, contract, CLI, and installed-package dogfood tests

Project management

The five related items were claimed, implemented as one coherent SDK/CLI package-authoring bundle, fully evidenced through pm, closed, and released. No unrelated item remains in progress.

Verification

  • pnpm build
  • pnpm typecheck
  • pnpm lint (ESLint, zero-copy jscpd, docstring/import-boundary/token-efficiency gates)
  • node scripts/run-tests.mjs coverage: 5,514 tests, 100% statements, branches, functions, and lines
  • focused linked item tests through pm test --run --progress
  • pnpm docs:check
  • pnpm skills:check
  • pnpm contracts:check
  • pnpm audit --audit-level high
  • pnpm security:scan
  • pnpm changelog:pm && pnpm changelog:pm:check using pm-changelog 2026.7.10
  • packed and installed @unbrained/pm-cli into a fresh temporary project; verified repeated acceptance criteria, malformed-dependency rejection, and public SDK reserved-field linting
  • pm health --check-only --summary --json: healthy, zero warnings
  • pm validate --check-resolution --check-history-drift --json: zero history drift; existing repository resolution-metadata warnings remain unchanged

Observability

Telemetry coverage is healthy with no missing error codes. The Sentry release gate continues to identify PM-CLI-1Y and PM-CLI-1Z, handled spawn errors originating in the external pm-starter package's legacy pm --path ... calls; this change neither introduces nor masks those external-package events.


Summary by cubic

Hardens schema-driven input fidelity and SDK preflight to prevent silent data loss and dangling deps. Repeatable parsers and coercion now preserve argv order across aliases; templates apply custom scalar options safely; --dep shorthands validate early.

  • Bug Fixes
    • Extension flags with list: true accumulate repeated long/short alias values and comma lists using one shared accumulator across visible/hidden aliases; parse occurrence provenance is carried into coercion so interleaved aliases keep exact argv order through CSV flatten; accumulators reset per parse; nullish alias values are ignored; arrays are deduped; scalar aliases canonicalize without duplicate keys (pm-kfq5, SDK/host: extension flags declared as lists don't accumulate repeated values — --repos a --repos b silently keeps only the last #496).
    • Mixed --acceptance-criteria/--acceptance_criteria/--ac accumulate in argv order and are joined with ; once at the SDK boundary; Commander-null/undefined alias keys are ignored; the runtime contract lists distinct repeatable aliases, and templates keep it scalar to avoid double-joining (pm-b84u).
    • Templates apply custom type-option fields via the validated --type-option pipeline; explicit type-option inputs override primitive template defaults; template custom options no longer override canonical create fields; non-scalar custom values are rejected while scalar string/number/boolean are accepted (pm-l6rz, Templates silently drop tags and custom type-option fields on create (built-ins like priority/assignee apply) #497).
    • --dep shorthand is guarded; malformed inputs like related:pm-abcd fail fast with an id=<id>,kind=<kind> hint on both create and update (pm-zazb).
    • SDK exports RESERVED_ITEM_FIELD_NAMES as a non‑mutating ReadonlySet with standard iterator methods; lint/preflight/harness reject blueprint item-field names that collide with core metadata keys (pm-ghf1).

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

Review in cubic

Deliver a broad SDK/CLI package-author safety bundle across template custom fields, repeatable extension and acceptance-criteria flags, dependency graph validation, and reserved item-field preflight. Add public SDK contracts, full regression coverage, documentation, generated contracts/changelog, and pm evidence for pm-kfq5, pm-l6rz, pm-zazb, pm-b84u, and pm-ghf1.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @unbraind, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

/gemini review

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

@unbraind: Sure, kicking off a full review of the PR now.

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates repeatable CLI option handling, validates dependency shorthand before parsing, preserves template custom fields, accumulates extension list aliases, exports reserved item-field names, and rejects reserved blueprint fields during SDK linting.

Changes

CLI and SDK correctness fixes

Layer / File(s) Summary
Repeatable acceptance criteria
src/cli/registration-helpers.ts, src/sdk/cli-contracts/..., src/cli/register-mutation.ts, tests/fixtures/contracts/full.json, tests/unit/cli/...
Create and update accept repeated --ac values, preserve alias and argv ordering, and normalize them into strings joined with ; .
Dependency validation and template mapping
src/sdk/dependency-flag-validation.ts, src/cli/commands/create.ts, src/cli/commands/update.ts, tests/unit/commands/*, docs/COMMANDS.md
Malformed bare dependency values are rejected before normalization, and template custom type options accept scalar defaults before entering the type-option validation pipeline.
Extension list option accumulation
src/cli/extension-command-options.ts, src/cli/register-mutation.ts, tests/unit/extensions/*
Repeated canonical and alias values for list flags are merged into one array, aliases are removed, and repeatable parser state is reset between command parses.
Reserved item-field linting
src/core/extensions/item-fields.ts, src/sdk/compose.ts, src/sdk/index.ts, tests/unit/sdk/sdk-compose.spec.ts, docs/SDK.md
The reserved metadata-field set is exported as an immutable read-only surface, and blueprint linting reports reserved_item_field collisions.
Release and issue metadata
.agents/pm/..., CHANGELOG.md, docs/EXTENSIONS.md
Issue histories and records document implementation and verification cycles, while the changelog and extension documentation describe the corrected CLI and SDK behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • unbraind/pm-cli#419: Repeatable hidden option and alias parsing overlaps with this PR’s register-mutation.ts changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.18% 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 Issues [#496, #497] are addressed: repeatable list flags accumulate correctly, and template create now carries custom fields through validation.
Out of Scope Changes check ✅ Passed The docs, tests, changelog, and issue-history updates are directly tied to the linked fixes and PR objectives.
Title check ✅ Passed The title accurately captures the main theme of hardening SDK input handling and package preflight checks.
Description check ✅ Passed The description matches the changeset and summarizes the SDK, CLI, docs, and test updates.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@unbraind

Copy link
Copy Markdown
Owner Author

Bot feedback disposition (initial pass):

  • CodeRabbit acknowledgement/rate-window note: acknowledged; the active run is processing all 31 changed files, so I am waiting for its substantive findings before judging the head.
  • Sourcery quota review: acknowledged as infrastructure/quota information, not a code finding. GitHub does not expose reactions for this top-level review object, so this explicit reply records its disposition. The mandatory local static-quality, duplication, type, coverage, security, and GitHub gates remain independently enforced.

I will reply inline to every substantive finding and rerun reviewers after any head update.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a comprehensive set of input fidelity and package-author safety improvements across the CLI and SDK. Key changes include accumulating repeated acceptance criteria flags, preserving custom type-option fields in templates, rejecting malformed dependency shorthand values early to prevent dangling graph edges, allowing extension list flags to accumulate repeated occurrences, and validating extension blueprints against reserved item-field name collisions. The reviewer feedback recommends expanding the template-declared custom options filter to support booleans and numbers to prevent silent data loss, and adding defensive type guards when linting item fields to avoid runtime crashes on malformed blueprints.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cli/commands/create.ts Resolved
Comment thread src/sdk/compose.ts Resolved

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements a broad schema-driven input fidelity and package-author safety bundle. Key changes include allowing repeated --ac flags to accumulate (joined by "; "), preventing malformed dependency shorthand from creating dangling graph edges, ensuring templates map custom type-option fields correctly, and adding SDK linting to reject extension fields that shadow reserved metadata keys. The review feedback highlights two important safety improvements: adding nullish coalescing guards to prevent a potential runtime TypeError when iterating over optional typeDefinition.options in create.ts, and filtering out nullish values when merging repeated list flag occurrences in extension-command-options.ts to avoid inserting undefined or null elements into the coerced array.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cli/commands/create.ts Resolved
Comment thread src/cli/extension-command-options.ts Resolved
@greptile-apps

greptile-apps Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR hardens CLI and SDK input handling for schema-driven item creation and package authoring. The main changes are:

  • Repeatable CLI aliases now preserve values and ordering across long, short, and hidden forms.
  • Extension list: true flags now accumulate repeated and comma-separated values consistently.
  • Template-defined custom item options now flow through type-option validation without overriding explicit inputs.
  • Malformed dependency shorthand is rejected early in create and update paths.
  • Reserved item-field names are exported through the SDK and enforced during blueprint lint/preflight.
  • Docs, contract snapshots, metadata, and regression tests were updated for the new contracts.

Confidence Score: 5/5

Safe to merge with minimal risk.

The updated paths are focused on CLI option normalization, SDK preflight, dependency validation, docs, and tests. No verified runtime, schema, or security issues remain in the reviewed changes.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The team ran the CLI smoke test for the dogfood package and verified that acceptance criteria are preserved when using mixed short/long/underscore flags, and that a malformed dependency shorthand is rejected with 'Use a bare item id or id=<id>,kind=<kind>'.
  • The team ran the SDK smoke test and confirmed that RESERVED_ITEM_FIELD_NAMES are exposed as a read-only set-like, and that lintExtensionBlueprint reports a reserved_item_field collision on the core title field.
  • The team verified packaging and installation occurred before the smoke tests, confirming that the package was packed and installed prior to execution.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/cli/extension-command-options.ts Adds ordered occurrence tracking for loose extension list flags and canonicalizes aliases without reordering repeated values.
src/cli/register-mutation.ts Registers repeatable Commander aliases with a shared accumulator that resets between parses.
src/cli/registration-helpers.ts Normalizes repeatable Commander aliases into the SDK scalar boundary while skipping nullish alias artifacts and avoiding shared-array duplication.
src/cli/commands/create.ts Routes template custom scalar options through type-option validation and rejects malformed dependency shorthand during create.
src/cli/commands/update.ts Applies the shared malformed dependency shorthand guard to update dependency additions.
src/core/extensions/item-fields.ts Exports an immutable reserved item-field name facade and reuses it for runtime field collision checks.
src/sdk/compose.ts Adds blueprint lint/preflight findings for item fields that collide with reserved core metadata keys.
src/sdk/dependency-flag-validation.ts Introduces shared validation for rejecting malformed bare dependency shorthand values.
tests/unit/extensions/extension-command.spec.ts Covers extension command list flag accumulation and ordered alias handling.
tests/unit/sdk/sdk-compose.spec.ts Adds SDK compose/lint tests for reserved field collisions and immutable public reserved-name facade.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant CLI as CLI Commander/loose parser
participant Normalizer as Registration helpers / SDK boundary
participant Validator as Schema + dependency validators
participant Runtime as Create/Update/Extension runtime

User->>CLI: Provide repeatable aliases, template options, deps, extension flags
CLI->>CLI: Accumulate repeatable aliases in shared parser state
CLI->>Normalizer: Pass parsed options with ordered occurrences
Normalizer->>Normalizer: Canonicalize aliases and join acceptance criteria once
Normalizer->>Validator: Validate type options, dependency shorthand, reserved fields
Validator-->>User: Usage error for malformed deps or reserved collisions
Validator->>Runtime: Normalized schema-safe options
Runtime->>Runtime: Create/update item or invoke extension command
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant CLI as CLI Commander/loose parser
participant Normalizer as Registration helpers / SDK boundary
participant Validator as Schema + dependency validators
participant Runtime as Create/Update/Extension runtime

User->>CLI: Provide repeatable aliases, template options, deps, extension flags
CLI->>CLI: Accumulate repeatable aliases in shared parser state
CLI->>Normalizer: Pass parsed options with ordered occurrences
Normalizer->>Normalizer: Canonicalize aliases and join acceptance criteria once
Normalizer->>Validator: Validate type options, dependency shorthand, reserved fields
Validator-->>User: Usage error for malformed deps or reserved collisions
Validator->>Runtime: Normalized schema-safe options
Runtime->>Runtime: Create/update item or invoke extension command
Loading

Reviews (20): Last reviewed commit: "fix(cli): preserve extension list alias ..." | Re-trigger Greptile

Regenerate the runtime contract fixture from a clean build so Commander-owned repeatability is represented by distinct --acceptance-criteria and --ac entries. Record the CI correction and verification evidence in pm-b84u.
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown

Greptile Summary

This PR hardens SDK and CLI input handling for schema-driven create/update flows. The main changes are:

  • Repeatable extension and acceptance-criteria flags now preserve repeated values across aliases.
  • Template-defined custom item type fields now flow into create validation.
  • Malformed dependency shorthand is rejected before item ID normalization.
  • Reserved item-field names are exported and checked during SDK/package preflight.
  • Docs, contract fixtures, and unit coverage were updated for the new behavior.

Confidence Score: 4/5

This PR has one contained create-path bug that should be fixed before merging.

Most changes are centralized and covered, but duplicate template/explicit type-option keys currently persist the wrong value.

src/cli/commands/create.ts

T-Rex T-Rex Logs

What T-Rex did

  • Ran a focused Vitest harness to test how template type options override explicit values, and the run reproduced that agentStatus remained ready rather than adopting the explicit running.
  • Validated the CLI dogfood workflow by inspecting environment setup and runtime results, including the environment confirmation and a successful post-run CLI run.
  • Reviewed the focused Vitest regression run, which completed with 293 tests passing across three files.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/cli/commands/create.ts Adds template custom type-option promotion and dependency shorthand validation, but template type options currently override explicit caller type options on key collisions.
src/cli/commands/update.ts Applies shared malformed dependency shorthand validation to update dependency additions.
src/cli/extension-command-options.ts Coalesces mixed long/short extension list flags and coerces repeated comma-list values consistently.
src/cli/registration-helpers.ts Normalizes repeated acceptance criteria through Commander alias contracts.
src/core/extensions/item-fields.ts Exports and enforces reserved item-field names against extension-registered fields.
src/sdk/compose.ts Adds reserved item-field lint findings to extension blueprint/package preflight.
src/sdk/dependency-flag-validation.ts Adds shared validation rejecting malformed bare dependency values containing structured separators.
tests/unit/commands/create-command.spec.ts Adds create coverage for malformed dependencies and template custom type options, but misses explicit/template type-option collision precedence.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant Commander
participant CreateUpdate as create/update commands
participant SDK as SDK validators/contracts
participant Schema as Runtime schema/extensions
participant Store as Item store

User->>Commander: pass repeatable aliases, template, deps, fields
Commander->>CreateUpdate: normalized option payload
CreateUpdate->>SDK: validate dependency shorthand / contract aliases
CreateUpdate->>Schema: resolve item type, template type options, reserved fields
Schema-->>CreateUpdate: validated metadata + type options
CreateUpdate->>Store: write item/history or update item
Store-->>User: result with changed fields/warnings
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant Commander
participant CreateUpdate as create/update commands
participant SDK as SDK validators/contracts
participant Schema as Runtime schema/extensions
participant Store as Item store

User->>Commander: pass repeatable aliases, template, deps, fields
Commander->>CreateUpdate: normalized option payload
CreateUpdate->>SDK: validate dependency shorthand / contract aliases
CreateUpdate->>Schema: resolve item type, template type options, reserved fields
Schema-->>CreateUpdate: validated metadata + type options
CreateUpdate->>Store: write item/history or update item
Store-->>User: result with changed fields/warnings
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/cli/commands/create.ts:1460
**Preserve explicit overrides**
`--template` defaults currently override an explicit `--type-option` for the same key. `parseTypeOptionEntries` is last-wins, and this appends `templateTypeOptions` after `resolvedOptions.typeOption`, so `pm create --template agent --type-option agentStatus=running` stores the template's `agentStatus` instead of the caller's explicit value.

```suggestion
    resolvedOptions.typeOption = [...templateTypeOptions, ...(resolvedOptions.typeOption ?? [])];
```

Reviews (2): Last reviewed commit: "feat(sdk): harden schema-driven input fi..." | Re-trigger Greptile

Regenerate the package-owned changelog after the final tracker evidence and closeout so its ordering reflects the canonical pm end state.
Comment thread src/cli/commands/create.ts Resolved
@unbraind

unbraind commented Jul 10, 2026 •

Copy link
Copy Markdown
Owner Author

Head updated with the fresh-build contract snapshot correction and final package-owned changelog ordering. Re-running all review agents on commit 012d51ca:

@greptileai review

/gemini review

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

@unbraind: Understood — kicking off a full review of the latest head commit (3cf6fca).

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 53 minutes.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

@unbraind: Acknowledged — kicking off a full review on the updated head at commit 012d51ca, covering the fresh-build contract snapshot correction and the package-owned changelog ordering fix.

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 52 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements a comprehensive input fidelity and package-author safety bundle. Key changes include accumulating repeated --ac flags into a single joined string, supporting accumulation of repeated extension list flags, rejecting malformed dependency shorthand to prevent dangling graph edges, mapping template-declared custom type options, and linting against reserved item-field name collisions. The review feedback identifies several critical improvement opportunities: allowing non-string primitives for template-declared custom type options, ensuring alias keys are cleaned up and undefined values are handled defensively in extension option coercion, restoring fallback label logic for loose options, and adding defensive checks to prevent runtime crashes when linting blueprints with malformed item fields.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cli/commands/create.ts Resolved
Comment thread src/cli/extension-command-options.ts Resolved
Comment thread src/cli/extension-command-options.ts Resolved
Comment thread src/sdk/compose.ts Resolved

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

🤖 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/COMMANDS.md`:
- Around line 412-413: Move the explanatory paragraph beginning “Repeat
--ac/--acceptance-criteria” outside the surrounding bash code fence in the
documentation, placing it after the closing fence so it renders as prose rather
than a shell command.

In `@src/cli/commands/create.ts`:
- Around line 1456-1464: Only remove template option keys that were actually
transferred into typeOption. In the templateTypeOptions handling near
resolvedOptions.typeOption, derive the deletion set from options passing the
existing string-value filter, then delete only those keys; preserve non-string
values on resolvedOptions rather than iterating over every
typeDefinition.options entry.

In `@src/core/extensions/item-fields.ts`:
- Around line 11-12: Keep the mutable reserved-name Set private instead of
exporting RESERVED_ITEM_FIELD_NAMES directly, and expose a genuinely
non-mutating facade or membership helper for consumers. Update all references to
use that API, and add a regression test confirming mutation attempts cannot
alter reserved-field checks.
🪄 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 (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: e396ddf1-8828-436e-be60-f5c8330f49dd

📥 Commits

Reviewing files that changed from the base of the PR and between 96f6e6b and 880c223.

📒 Files selected for processing (31)
  • .agents/pm/extensions/.managed-extensions.json
  • .agents/pm/history/pm-b84u.jsonl
  • .agents/pm/history/pm-ghf1.jsonl
  • .agents/pm/history/pm-kfq5.jsonl
  • .agents/pm/history/pm-l6rz.jsonl
  • .agents/pm/history/pm-zazb.jsonl
  • .agents/pm/issues/pm-b84u.toon
  • .agents/pm/issues/pm-ghf1.toon
  • .agents/pm/issues/pm-kfq5.toon
  • .agents/pm/issues/pm-l6rz.toon
  • .agents/pm/issues/pm-zazb.toon
  • CHANGELOG.md
  • docs/COMMANDS.md
  • docs/EXTENSIONS.md
  • docs/SDK.md
  • src/cli/commands/create.ts
  • src/cli/commands/templates.ts
  • src/cli/commands/update.ts
  • src/cli/extension-command-options.ts
  • src/cli/registration-helpers.ts
  • src/core/extensions/item-fields.ts
  • src/sdk/cli-contracts/commander-mutation-options.ts
  • src/sdk/compose.ts
  • src/sdk/dependency-flag-validation.ts
  • src/sdk/index.ts
  • tests/fixtures/contracts/full.json
  • tests/unit/cli/registration-helpers.spec.ts
  • tests/unit/commands/create-command.spec.ts
  • tests/unit/commands/update-command.spec.ts
  • tests/unit/extensions/extension-command.spec.ts
  • tests/unit/sdk/sdk-compose.spec.ts

Comment thread docs/COMMANDS.md Resolved
Comment thread src/cli/commands/create.ts Resolved
Comment thread src/core/extensions/item-fields.ts Resolved
@codecov

codecov Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Preserve explicit type-option precedence over primitive template defaults, guard malformed reserved-field blueprints, and filter nullish list alias values. Add focused regressions, document template precedence, refresh pm evidence, and regenerate the package-owned changelog.
Comment thread src/cli/registration-helpers.ts Resolved
Expose reserved item-field names through a non-mutating ReadonlySet facade, canonicalize scalar aliases without leaking duplicate keys, and fix command-guide rendering. Add full facade and alias regressions, record bot dispositions in pm, and regenerate the final changelog.
@unbraind

Copy link
Copy Markdown
Owner Author

All substantive findings on the previous head have been dispositioned inline, reacted to, and resolved after verification. Final review-fix head: b79b7dc5.

Re-running every review agent because the head changed:

@greptileai review

/gemini review

@coderabbitai full review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements a broad schema-driven input fidelity and package-author safety bundle. Key changes include: allowing repeated --ac flags to accumulate into a single joined string; accumulating repeated extension list flags instead of dropping values; promoting template-declared custom type options into validated typeOption entries; rejecting malformed dependency shorthand before prefix normalization; and linting declarative blueprints to reject reserved item-field name collisions. Feedback on the PR highlights a potential issue where template-declared custom option keys colliding with core CLI options (like title or type) could be deleted from resolvedOptions, causing silent data loss or validation failures. A code suggestion is provided to safeguard core option keys.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cli/commands/create.ts Resolved
Combine scalar and collected values across every Commander acceptance-criteria alias so mixed --acceptance-criteria, --acceptance_criteria, and --ac usage cannot lose data. Add create/update regressions and final pm evidence.
@unbraind

Copy link
Copy Markdown
Owner Author

Greptile P1 on mixed repeatable aliases is fixed, reacted to, replied inline, and resolved on d5595b90. Re-running every reviewer because the head changed:

@greptileai review

/gemini review

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

@unbraind: Understood — kicking off a full review of the updated head commit d5595b90, covering the fix for the mixed repeatable aliases issue flagged by Greptile.

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces broad schema-driven input fidelity and package-author safety improvements across the SDK and CLI, including repeatable acceptance criteria accumulation, malformed dependency shorthand validation, template-declared custom type option mapping, and reserved item-field collision checks in extension blueprints. A critical review comment points out that in readJoinedRepeatedOption, unprovided alias keys initialized as undefined will cause the function to prematurely return undefined and discard valid values, and suggests skipping nullish values to prevent silent data loss.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cli/registration-helpers.ts Resolved
Comment thread src/cli/extension-command-options.ts Resolved
Exclude canonical create-option keys from template custom-option promotion and delete only successfully matched custom primitives. Add a colliding title regression and record final Gemini evidence in pm.
@unbraind

Copy link
Copy Markdown
Owner Author

Disposition for Gemini final-head quota notice #499 (comment): acknowledged. The daily quota prevented another pass; all earlier Gemini findings were fixed, explicitly verified, and the final head is independently green across the complete gate matrix.

@unbraind

Copy link
Copy Markdown
Owner Author

Final disposition for CodeRabbit confirmation #499 (comment): acknowledged and recorded; documentation rendering remains correct on the final head.

@unbraind

Copy link
Copy Markdown
Owner Author

Final disposition for CodeRabbit confirmation #499 (comment): acknowledged and recorded; the immutable reserved-field facade remains verified on the final head.

@unbraind

Copy link
Copy Markdown
Owner Author

Final disposition for CodeRabbit confirmation #499 (comment): acknowledged and recorded; primitive template options and explicit precedence remain verified on the final head.

@unbraind
unbraind merged commit 6d35044 into main Jul 10, 2026
24 checks passed
@unbraind
unbraind deleted the agent/schema-driven-input-fidelity branch July 10, 2026 16:06
unbraind added a commit that referenced this pull request Jul 10, 2026
…ase-health evidence

- GH-498 -> pm-z32q (comments --body alias + unknown-option flag hints), related-linked to pm-g543/pm-gdi7
- pm-801d: S1-S4 decomposition note (rebuild/staleness substrate first) as wave-2 entry proposal
- pm-wenq: resolution-faucet evidence 272->277 after PR #499 closures
- pm-7zs0: first fully-clean release cycle post-recovery
- pm-doxj: pass summary + next-pass leads

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdSrzeajwhyHXopGC7GB5p
@unbraind

unbraind commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Tracked in PM: pm-b84u, pm-ghf1, pm-kfq5, pm-l6rz, pm-zazb.

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

Labels

None yet

Projects

None yet

1 participant