Skip to content

SDK lifecycle provenance and context-rich CLI primitives - #801

Merged
unbraind merged 2 commits into
mainfrom
sdk-lifecycle-context-fidelity
Jul 29, 2026
Merged

unbraind merged 2 commits into
mainfrom
sdk-lifecycle-context-fidelity

Conversation

@unbraind

@unbraind unbraind commented Jul 29, 2026 •

Copy link
Copy Markdown
Owner

Outcome

This wide SDK/CLI bundle advances project management = context management across lifecycle provenance, storage, contracts, agent-facing context, mutation safety, dependency hygiene, and release generation.

Delivered

  • adds durable completed_at lifecycle timestamps plus SDK provenance and history-evidence backfill planning
  • preserves completion timestamps across create, update, close, copy, storage, MCP, CLI, structured mutations, public contracts, workspace memory, and release notes
  • exposes blocker IDs in compact context so agents retain actionable dependency provenance
  • makes activity relative ranges intuitive (7d / 1w mean look back), adds composable case-insensitive tag filters with unknown-tag diagnostics, and aligns --allow-missing-parent across CLI/SDK/MCP
  • makes mutation-guard configuration discoverable through typed SDK metadata
  • updates compatible Node types and duplication tooling, burns an obsolete ESLint suppression, and keeps incompatible major upgrades on their canonical PM lineages
  • updates the project-managed generator to released pm-changelog@2026.7.29; upstream support shipped in Prefer actual completion time for release-window bucketing pm-changelog#107

PM lineage

Verification

  • pnpm test:coverage — 6,497 tests, 100% statements / branches / functions / lines
  • pnpm lint, pnpm typecheck, pnpm contracts:check, pnpm quality:docs-skills, pnpm quality:context-eval
  • pnpm security:scan, pnpm audit --prod, pnpm dogfood:package-first, pnpm smoke:external-packages, pnpm smoke:npx
  • isolated packed consumer verified binary containment and npm/npx/bunx behavior plus all new CLI/SDK primitives
  • pm validate --check-resolution --check-history-drift — zero history drift across 2,183 items (291 pre-existing historical resolution warnings)
  • pm health --check-only — telemetry enabled, redacted, draining, and successfully flushed
  • GitHub dependency, code-scanning, and secret-scanning alert inventories are empty

Summary by cubic

Adds lifecycle-aware completion provenance and richer context primitives to the SDK and CLI to improve reporting accuracy and agent actionability. Reports, release notes, and automation now prefer actual completion time and expose blockers inline, while query UX and governance flags are more consistent.

  • New Features

    • Lifecycle provenance: add completed_at separate from closed_at; stamped on close/create-closed, preserved on copy; pm close/pm close-many/pm update accept --completed-at (ISO or relative). SDK adds resolveCompletionTimestamp and evidence-only planCompletedAtBackfill; release notes prefer completed_at; force re-close preserves completion unless overridden.
    • Context: low_level rows now include blocked and blocker_ids so agents see actionable blockers without a second command.
    • Query UX: activity --from accepts bare relative windows like 7d/1w; list --tag is repeatable and CSV-aware, case-insensitive, and warns on unknown tags.
    • Governance and config: update gains --allow-missing-parent (parity with create). Config help/results surface mutation-guard settings with canonical dashed keys and typed metadata (canonical_key, choices, min/max).
    • Workspace memory: exposes completion_time_sources counts to disclose actual-completion vs legacy fallbacks.
    • Contracts/docs updated across CLI/SDK/MCP; tests cover new flags and projections.
  • Dependencies

    • Bump @types/node and jscpd to latest compatible patches; keep incompatible majors deferred.
    • Update project-managed generator to pm-changelog@2026.7.29.
    • Tighten static quality gate and remove an obsolete ESLint suppression.

Written for commit 575065c. Summary will update on new commits.

Review in cubic

Summary by Sourcery

Track actual completion timestamps across the SDK and CLI, enrich context and list queries with blocker and tag metadata, and tighten governance and configuration visibility, while keeping dependencies and quality gates up to date.

New Features:

  • Introduce a dedicated completed_at lifecycle timestamp distinct from closed_at, with CLI and SDK support for setting, correcting, and propagating it across items and reports.
  • Expose blocked state and unresolved blocker IDs directly in context low-level focus rows and markdown output so agents can act on dependency provenance in a single view.
  • Allow relative-only activity windows like 7d/1w, and support composable, case-insensitive list tag filters with CSV and repeatable flag inputs plus unknown-tag diagnostics.
  • Add a shared allow-missing-parent escape hatch for update mutations under strict parent-reference validation, aligned across CLI, SDK, and MCP contracts.
  • Surface typed mutation-guard configuration metadata, including canonical kebab-case keys, summaries, choices, and numeric bounds, through config listing APIs and docs.
  • Extend workspace memory snapshots and selection results with completion-time source counts that disclose how often actual versus fallback timestamps are used.

Bug Fixes:

  • Ensure reopened items clear both closed_at and completed_at timestamps, and prevent completion corrections on non-terminal items.
  • Fix activity queries that previously returned empty results for bare relative from windows by treating them as backward-looking ranges.
  • Align list tag filtering behavior with tag mutation formats and warn when filters reference tags that are not present in the corpus.
  • Make MCP action option hoisting table-driven so unknown actions no longer receive unintended hoisting behavior.

Enhancements:

  • Refactor SDK lifecycle utilities into a dedicated module for resolving completion timestamps and planning evidence-backed backfills from history.
  • Improve CLI and SDK contracts for close and update actions with new completed-at and allow-missing-parent flags, and exclude these from bulk update-many where not supported.
  • Project completion-aware timestamps into release note generation and workspace memory to prefer actual completion time over legacy close or update times.
  • Clarify configuration CLI help and configuration docs to highlight mutation-guard policies and their preferred kebab-case spellings.
  • Hoist common MCP options via a centralized mapping to keep action schemas consistent and easier to extend.

Build:

  • Tighten the static quality gate by reducing the allowed ESLint suppression count and updating the release automation contracts accordingly.
  • Update development dependencies such as @types/node and jscpd to the latest compatible versions, and refresh the managed changelog generator version.

Deliver a cohesive SDK and CLI context-management bundle: completion provenance, lifecycle timestamps, blocker-aware context, relative activity ranges, composable tag filters, missing-parent parity, discoverable mutation guards, dependency refreshes, and stricter quality ratchets.\n\nRegenerate public contracts and changelog output, retain exact 100% coverage, and record the implementation and verification evidence across the canonical PM lineage.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review\n\n@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds completion timestamps and evidence-backed lifecycle reporting, expands CLI contracts, exposes dependency blockers and multi-tag filtering, improves configuration metadata discovery, and records related issue, changelog, dependency, and quality-gate updates.

Changes

Completion and CLI behavior

Layer / File(s) Summary
Completion timestamp lifecycle
src/cli/commands/close.ts, src/cli/commands/update.ts, src/sdk/lifecycle-completion.ts, src/sdk/workspace-memory.ts, src/types.ts, tests/unit/...
Adds completed_at storage, explicit --completed-at correction, timestamp fallback resolution, evidence-backed backfill planning, workspace source counts, validation, and regression coverage.
Context, list, and activity projections
src/cli/commands/context.ts, src/sdk/query/list.ts, src/cli/commands/activity.ts, src/sdk/runtime-input.ts, tests/unit/..., tests/integration/...
Adds blocker provenance to context rows, repeatable/comma-separated tag filters with unknown-tag warnings, unsigned relative activity bounds, and table-driven option hoisting.
CLI and SDK contract surfaces
src/sdk/cli-contracts/*, sdk/public-surface.json, tests/fixtures/contracts/full.json
Updates public command, tool, schema, typed-action, and generated contract surfaces for completion and parent-reference options.
Configuration metadata discoverability
src/sdk/config.ts, src/cli/register-setup.ts, docs/CONFIGURATION.md, tests/unit/commands/config-key-aliases-search.spec.ts
Adds canonical keys, summaries, choices, and numeric bounds to nested configuration listings and documents mutation-guard settings.
Issue evidence and release maintenance
.agents/pm/*, CHANGELOG.md, package.json, scripts/release/static-quality-gate.mts, eslint-suppressions.json, scripts/generate-release-notes.mjs
Records issue completion evidence, refreshes compatible development dependencies, lowers the suppression budget, updates release timestamp precedence, and adds changelog entries.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant UpdateCommand
  participant ItemMetadata
  participant SDK
  participant ReleaseNotes
  CLI->>UpdateCommand: pass --completed-at
  UpdateCommand->>ItemMetadata: write completed_at
  SDK->>ItemMetadata: resolve completion timestamp
  SDK->>ReleaseNotes: provide completion timestamp for bucketing
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.56% 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.
Title check ✅ Passed The title accurately reflects the main theme of lifecycle provenance and richer CLI/SDK context primitives.
Description check ✅ Passed The description is clearly aligned with the changeset and summarizes the bundled SDK, CLI, contracts, and dependency updates.
✨ Finishing Touches 💡 1
📝 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.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

@unbraind: I’ll perform a complete re-review of PR #801, including the full diff and its integration points.

✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 59 minutes.

@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

@codspeed

codspeed Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 2.19%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 10 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ createQueryFingerprint 534.1 µs 522.7 µs +2.19%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing sdk-lifecycle-context-fidelity (575065c) with main (c90adb1)

Open in CodSpeed

@sourcery-ai

sourcery-ai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds lifecycle-aware completion timestamps and provenance utilities, surfaces blocker state and IDs in context views, improves list tag filtering and activity range UX, exposes mutation-guard config metadata, aligns parent-reference escape hatches across CLI/SDK/MCP, and refreshes a small set of dev dependencies and quality gates.

Sequence diagram for completion-aware lifecycle timestamps

sequenceDiagram
  actor User
  participant pm_close as runClose
  participant pm_update as runUpdate
  participant applyStatus as applyStatusAndCompletionMutations
  participant Metadata as ItemMetadata
  participant resolver as resolveCompletionTimestamp
  participant Memory as buildWorkspaceMemorySnapshot
  participant Release as itemChangedInReleaseWindow

  User->>pm_close: runClose(options.completedAt)
  pm_close->>Metadata: mutateCloseMetadata(closedAt, completedAt)
  Note right of Metadata: Sets closed_at and completed_at

  User->>pm_update: runUpdate(--completed-at)
  pm_update->>applyStatus: applyStatusAndCompletionMutations
  applyStatus->>Metadata: metadata.completed_at = resolveIsoOrRelative(...)

  Metadata-->>resolver: resolveCompletionTimestamp(item)
  resolver-->>Memory: timestamp, source, fallback
  Memory->>Memory: buildWorkspaceMemorySnapshot

  Metadata-->>Release: itemChangedInReleaseWindow
  Release->>Release: prefer completed_at then closed_at then updated_at
Loading

Flow diagram for blocker-aware context focus projection

flowchart TD
  A[resolveContextFocusGroups
listedItemMetadata,
allItems,
fullCorpus,
blockedIds] --> B[fullCorpusById
Map]
  A --> C[projectFocusItem]
  C --> D[toContextFocusItem]
  D --> E[ContextFocusItem]
  C --> F{blockedIds
has item.id?}
  F -- no --> E
  F -- yes --> G[resolveItemBlockers]
  G --> H[blocker_ids =
 unresolved blockers]
  H --> E
  E --> I[formatFocusLine
includes blocked and
blocker_ids tokens]
Loading

File-Level Changes

Change Details Files
Track actual completion separately from close time and wire it through CLI, SDK, item format, and release tooling.
  • Introduce completed_at on ItemMetadata with validation, normalization, and inclusion in metadata key order and builtin fields.
  • Stamp both closed_at and completed_at on close/create-closed, clear both when reopening, and support governed corrections via pm update --completed-at on terminal items only.
  • Route completed_at through CLI contracts (flags, commander option registrations, tool schemas), structured mutations read-only set, and ensure pm copy strips lifecycle timestamps.
  • Add lifecycle-completion SDK module with resolveCompletionTimestamp and planCompletedAtBackfill, update workspace-memory and release notes generator to prefer completion-aware timestamps, and export the new APIs with tests and docs.
src/types.ts
src/core/item/item-format.ts
src/core/schema/fields-file.ts
src/core/shared/constants.ts
src/cli/commands/close.ts
src/cli/commands/create.ts
src/cli/commands/update.ts
src/cli/commands/copy.ts
src/cli/commands/activity.ts
src/sdk/lifecycle-completion.ts
src/sdk/workspace-memory.ts
scripts/generate-release-notes.mjs
src/sdk/index.ts
src/sdk/structured-mutations.ts
docs/COMMANDS.md
docs/SDK.md
tests/unit/commands/close-command.spec.ts
tests/unit/commands/update-command.spec.ts
tests/unit/sdk/workspace-memory.spec.ts
tests/unit/core/item/item-format-validation.spec.ts
tests/unit/sdk/lifecycle-completion.spec.ts
tests/integration/release-automation-contract.spec.ts
tests/integration/release-readiness-runtime.spec.ts
Expose blockers and blocked state directly in context focus rows to make low-level context actionable.
  • Extend ContextFocusItem with blocked and blocker_ids fields and include them in focus projection sets and formatting.
  • Propagate full corpus into resolveContextFocusGroups, derive blocked rows by resolving unresolved dependency blockers, and project blocked/blocker_ids into high-level, low-level, and blocked fallback rows.
  • Update context markdown rendering expectations and add tests for lifecycle-only blocking, unresolved blockers, and skipped resolved blockers.
src/cli/commands/context.ts
tests/unit/commands/context-command.spec.ts
Improve list tag filtering semantics and diagnostics while keeping CLI behavior compatible.
  • Change list filter set to accept multiple tags via normalized, lowercase, de-duplicated CSV parsing and update matching to accept any of the requested tags case-insensitively.
  • Normalize repeated --tag flags into a comma-separated string in registration helpers and adjust commander registration to treat --tag as repeatable/CSV-aware.
  • Emit unknown_tags warnings when requested tags are absent from any item tags and extend tests to cover CSV, repeated tags, and unknown-tag diagnostics.
src/sdk/query/list.ts
src/cli/register-list-query.ts
src/cli/registration-helpers.ts
tests/unit/commands/list-command.spec.ts
Align parent-reference governance and mutation-guard discoverability across CLI and SDK.
  • Add allowMissingParent flag to update command options, commander contracts, CLI flag contracts, and tool option contracts; plumb it through runUpdate and bulk-typed action inputs while explicitly excluding it from update-many.
  • Map parent_reference validation policy through a two-mode table so allowMissingParent downgrades strict_error to warn while preserving warn/off behavior.
  • Extend config nested-setting results with canonical_key, summary, choices, min/max metadata; document mutation_guard settings in CONFIGURATION.md and config CLI help, and add tests that assert typed metadata for mutation guard policies.
src/cli/commands/update.ts
src/sdk/cli-contracts/commander-mutation-options.ts
src/sdk/cli-contracts/tool-option-contracts.ts
src/sdk/cli-contracts/tool-schema.ts
src/sdk/cli-contracts/typed-action-inputs.ts
src/sdk/config.ts
docs/CONFIGURATION.md
src/cli/register-setup.ts
tests/unit/commands/update-command.spec.ts
tests/unit/commands/config-key-aliases-search.spec.ts
Generalize MCP option hoisting and keep tool contracts consistent.
  • Introduce HOISTED_ACTION_OPTION_KEYS map and refactor optionsWithAuthor to iterate configured hoisted keys per action, including new options like allowMissingParent and completedAt for update/close.
  • Ensure unknown MCP actions receive no hoisting and add handshake tests for unknown-action and default behavior.
src/sdk/runtime-input.ts
tests/integration/mcp-handshake.spec.ts
Tighten quality gates and refresh small dev dependency set while keeping contracts aligned.
  • Reduce MAX_ESLINT_SUPPRESSIONS and bump @types/node and jscpd versions, updating quality:static scripts and release automation tests accordingly.
  • Refresh pm-changelog-managed generator artifacts and PM issues/history files, ensuring public-surface and contracts fixtures stay in sync.
scripts/release/static-quality-gate.mts
package.json
pnpm-lock.yaml
CHANGELOG.md
sdk/public-surface.json
.agents/pm/issues/*.toon
.agents/pm/history/*.jsonl
.agents/pm/chores/pm-77bmeu.toon
.agents/pm/history/pm-77bmeu.jsonl
tests/integration/release-automation-contract.spec.ts
tests/integration/release-readiness-runtime.spec.ts
tests/fixtures/contracts/full.json
.agents/pm/extensions/.managed-extensions.json

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@greptile-apps

greptile-apps Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

Adds lifecycle completed_at provenance and richer SDK/CLI context primitives across mutations, queries, contracts, and reporting.

  • Stamps and preserves completed_at on close/create-closed/update reopen paths; supports --completed-at and history-backed backfill planning
  • Context low-level rows expose blocked/blocker_ids; activity bare relative --from windows look backward; list tags are multi-value and case-insensitive with unknown-tag warnings
  • Update gains --allow-missing-parent; config inventory surfaces typed mutation-guard metadata; workspace memory and release notes prefer completion time
  • Compatible dependency patches, tighter ESLint suppression ratchet, and pm-changelog@2026.7.29

Confidence Score: 5/5

No prior Greptile findings remain and no follow-up-eligible incomplete or unsafe fixes were identified, so the PR appears safe to merge from this review scope.

No blocking failure remains under follow-up scope; previous Greptile threads were unavailable or empty and no incomplete or unsafe prior-thread fix was found in the current HEAD.

Important Files Changed

Filename Overview
src/sdk/lifecycle-completion.ts New completion-timestamp resolution and evidence-only backfill planning from history terminal transitions.
src/cli/commands/update.ts Status close/reopen clears or sets completed_at; --completed-at correction; allow-missing-parent parent policy override.
src/cli/commands/close.ts Close stamps completed_at (optional override) without clobbering existing completion when not requested.
src/cli/commands/context.ts Focus projection adds blocked flag and unresolved blocker_ids from full corpus.
src/sdk/query/list.ts Multi-tag OR filters, case-insensitive match, unknown_tags warnings.
src/sdk/runtime-input.ts Table-driven MCP option hoisting includes update/close completedAt and allowMissingParent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  closeOrUpdate[close / update to terminal] --> stampCompletedAt[stamp completed_at]
  stampCompletedAt --> itemDoc[item metadata + history]
  itemDoc --> resolveTs[resolveCompletionTimestamp]
  resolveTs --> reports[workspace memory / release notes]
  deps[unresolved blockers] --> contextFocus[context focus rows]
  contextFocus --> agents[blocker_ids in compact context]
Loading

Reviews (2): Last reviewed commit: "fix(lifecycle): preserve completion evid..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 29, 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!

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

Caution

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

⚠️ Outside diff range comments (1)
src/cli/commands/update.ts (1)

1876-1900: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Strip completedAt from the pre-update close helper recursion.

otherFieldKeys intentionally leaves completedAt for runClose, but when another field is present the recursive preUpdate still spreads context.options without clearing it. That recursive call clears status, reaches mutateUpdateDocument, and applies the terminal-only completedAt check while the item is still non-terminal.

🐛 Proposed fix
     const preUpdate = await runUpdate(
       context.id,
       {
         ...context.options,
         status: undefined,
         closeReason: undefined,
         message: undefined,
+        completedAt: undefined,
       },
       context.global,
     );
🤖 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 `@src/cli/commands/update.ts` around lines 1876 - 1900, Update the pre-update
call in the surrounding close helper to clear completedAt alongside status,
closeReason, and message before spreading context.options into runUpdate. Keep
completedAt available for the subsequent runClose path, while ensuring the
recursive preUpdate does not apply it during non-terminal updates.
🤖 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 @.agents/pm/history/pm-77bmeu.jsonl:
- Around line 8-17: Restore or add a sandbox-safe full-suite coverage command
through the PM CLI, run it, and append its final evidence before the close and
release events without rewriting the append-only history. Update
.agents/pm/history/pm-77bmeu.jsonl lines 8-17 with the linked test and test-run
evidence, then synchronize .agents/pm/chores/pm-77bmeu.toon lines 34-38 so
tests[] and test_runs[] substantiate actual_result and remain reproducible after
pm close and pm release.

In @.agents/pm/issues/pm-bwnclq.toon:
- Line 19: Update the PM item’s expected_result metadata through the pm CLI,
replacing “immutable fact” with “governed completion value” while preserving the
explicit legacy fallback requirement. Regenerate the .toon projection from the
canonical PM item, and do not edit the projection file directly.

In `@sdk/public-surface.json`:
- Around line 226-258: Consolidate the consecutive 2026.7.28 breaking-change
entries in the generated ledger so the PmUpdateManyActionOptions signatures are
included in the existing changes array with the other signatures sharing the
same reason and package version. Update the generator or grouping logic that
produces these entries, rather than manually editing sdk/public-surface.json,
while preserving all listed signatures and metadata.

In `@src/cli/commands/close.ts`:
- Around line 667-673: Update mutateCloseMetadata() in both metadata-update
branches so completed_at is assigned and included in changedFields only when
options.completedAt is provided or the existing completed_at field is absent;
otherwise preserve the stored timestamp during force re-closes. Mirror the
explicit completion guard used in update.ts while leaving status and closed_at
behavior unchanged.

In `@src/cli/register-mutation.ts`:
- Around line 2536-2539: Add the `--completed-at <value>` option to the
`close-many` command alongside its existing options, then pass the parsed value
through `runCloseManyAction` into each underlying `runClose` invocation so bulk
closures preserve the actual completion timestamp.

In `@src/sdk/lifecycle-completion.ts`:
- Around line 76-104: Update planCompletedAtBackfill and its
hasTerminalTransition detection to require evidence that the status immediately
before the detected terminal transition was non-terminal. Derive the predecessor
from the earlier entry state when available, and skip terminal-to-terminal
rewrites so completed_at is not backfilled from their timestamps; preserve
existing handling for genuine non-terminal-to-terminal transitions.

In `@src/sdk/query/list.ts`:
- Line 1960: Update the successful indexed-page path in tryLoadIndexedListPage
to validate options.tag against tags on the items returned by
queryItemMetadataIndex, using runtime.typeRegistry.type_to_folder as needed.
Invoke appendUnknownTagWarning with the indexed results before constructing the
response so unknown_tags warnings are included in both compact and verbose
result paths, while preserving existing warnings behavior.

---

Outside diff comments:
In `@src/cli/commands/update.ts`:
- Around line 1876-1900: Update the pre-update call in the surrounding close
helper to clear completedAt alongside status, closeReason, and message before
spreading context.options into runUpdate. Keep completedAt available for the
subsequent runClose path, while ensuring the recursive preUpdate does not apply
it during non-terminal updates.
🪄 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 Plus

Run ID: 30587d22-774c-49e7-86bf-efcde2210628

📥 Commits

Reviewing files that changed from the base of the PR and between c90adb1 and 98c762a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (64)
  • .agents/pm/chores/pm-77bmeu.toon
  • .agents/pm/extensions/.managed-extensions.json
  • .agents/pm/history/pm-5ecnar.jsonl
  • .agents/pm/history/pm-77bmeu.jsonl
  • .agents/pm/history/pm-b0twiy.jsonl
  • .agents/pm/history/pm-b1zsk9.jsonl
  • .agents/pm/history/pm-bwnclq.jsonl
  • .agents/pm/history/pm-cragzs.jsonl
  • .agents/pm/history/pm-r2suqb.jsonl
  • .agents/pm/issues/pm-5ecnar.toon
  • .agents/pm/issues/pm-b0twiy.toon
  • .agents/pm/issues/pm-b1zsk9.toon
  • .agents/pm/issues/pm-bwnclq.toon
  • .agents/pm/issues/pm-cragzs.toon
  • .agents/pm/issues/pm-r2suqb.toon
  • CHANGELOG.md
  • docs/COMMANDS.md
  • docs/CONFIGURATION.md
  • docs/SDK.md
  • eslint-suppressions.json
  • package.json
  • scripts/generate-release-notes.mjs
  • scripts/release/static-quality-gate.mts
  • sdk/public-surface.json
  • src/cli/commands/activity.ts
  • src/cli/commands/close.ts
  • src/cli/commands/context.ts
  • src/cli/commands/copy.ts
  • src/cli/commands/create.ts
  • src/cli/commands/update.ts
  • src/cli/register-list-query.ts
  • src/cli/register-mutation.ts
  • src/cli/register-setup.ts
  • src/cli/registration-helpers.ts
  • src/core/item/item-format.ts
  • src/core/schema/fields-file.ts
  • src/core/shared/constants.ts
  • src/sdk/cli-contracts/commander-mutation-options.ts
  • src/sdk/cli-contracts/flag-contracts.ts
  • src/sdk/cli-contracts/tool-option-contracts.ts
  • src/sdk/cli-contracts/tool-parameter-tables.ts
  • src/sdk/cli-contracts/tool-schema.ts
  • src/sdk/cli-contracts/typed-action-inputs.ts
  • src/sdk/config.ts
  • src/sdk/index.ts
  • src/sdk/lifecycle-completion.ts
  • src/sdk/query/list.ts
  • src/sdk/runtime-input.ts
  • src/sdk/structured-mutations.ts
  • src/sdk/workspace-memory.ts
  • src/types.ts
  • tests/fixtures/contracts/full.json
  • tests/integration/mcp-handshake.spec.ts
  • tests/integration/release-automation-contract.spec.ts
  • tests/integration/release-readiness-runtime.spec.ts
  • tests/unit/commands/close-command.spec.ts
  • tests/unit/commands/config-key-aliases-search.spec.ts
  • tests/unit/commands/context-command.spec.ts
  • tests/unit/commands/history-activity-command.spec.ts
  • tests/unit/commands/list-command.spec.ts
  • tests/unit/commands/update-command.spec.ts
  • tests/unit/core/item/item-format-validation.spec.ts
  • tests/unit/sdk/lifecycle-completion.spec.ts
  • tests/unit/sdk/workspace-memory.spec.ts
💤 Files with no reviewable changes (1)
  • eslint-suppressions.json

Comment thread .agents/pm/history/pm-77bmeu.jsonl Resolved
Comment thread .agents/pm/issues/pm-bwnclq.toon Resolved
Comment thread sdk/public-surface.json Resolved
Comment thread src/cli/commands/close.ts Resolved
Comment thread src/cli/register-mutation.ts Resolved
Comment thread src/sdk/lifecycle-completion.ts Resolved
Comment thread src/sdk/query/list.ts Resolved
@unbraind

Copy link
Copy Markdown
Owner Author

Gemini sunset notice acknowledged: no review evidence was available from that integration, so it was treated as non-actionable rather than as a successful review.

@unbraind

Copy link
Copy Markdown
Owner Author

CodeRabbit rate-limit notice acknowledged: the subsequent full review completed successfully and its seven inline findings have each received a usefulness reaction, an inline disposition, and thread resolution.

@unbraind

Copy link
Copy Markdown
Owner Author

CodeRabbit invocation acknowledgement noted; the completed review was evaluated against exact head rather than treating the start acknowledgement as review completion.

@unbraind

Copy link
Copy Markdown
Owner Author

CodSpeed report acknowledged as useful: the measured 2.43% improvement is consistent with the bundle’s context-efficiency goal, with no performance regression to remediate.

@unbraind

Copy link
Copy Markdown
Owner Author

Sourcery reviewer guide acknowledged as useful orientation. Its separate weekly-limit review produced no actionable source finding and is recorded as unavailable rather than green review evidence.

@unbraind

Copy link
Copy Markdown
Owner Author

Greptile summary acknowledged as useful and accurate. Its completed exact-head review reported no blocking findings; the lifecycle, context, filtering, configuration, and quality scope matches the delivered bundle.

@unbraind

Copy link
Copy Markdown
Owner Author

Codecov result acknowledged as useful: all modified coverable lines are covered and the final local full-suite rerun confirms 100% statements, branches, functions, and lines across 6,497 tests.

@unbraind

Copy link
Copy Markdown
Owner Author

Sourcery rate-limit review disposition: non-actionable because no code assessment was produced. No source change is attributed to it; other exact-head reviewers and all repository gates remain authoritative.

@unbraind

Copy link
Copy Markdown
Owner Author

CodeRabbit review disposition: useful overall. Four lifecycle findings were accepted and fixed, two suggestions were verified as intentional/non-applicable, and the PM-evidence concern was answered with the sandbox-safety rationale. Every inline comment is reacted to, answered, and resolved.

Apply exact-head review feedback by preserving governed completion timestamps on force re-close, forwarding completed-at through close-many CLI/SDK/MCP contracts, and requiring genuine transition history for backfill.\n\nClarify the canonical PM contract, regenerate public surfaces and changelog output, and verify the review follow-up at exact 100/100/100/100 coverage.
@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review\n\n@coderabbitai full review\n\nReview follow-up head: 575065c. Four accepted lifecycle findings are implemented; two non-applicable findings have inline evidence. Please review the complete updated diff.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

@unbraind I’ll perform a complete re-review of the updated PR #801 diff at head 575065c88, including the lifecycle fixes and their cross-surface integrations.

✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 20 minutes.

@unbraind

Copy link
Copy Markdown
Owner Author

Second-round CodeRabbit invocation acknowledged as useful. The seven automated rate-limit replies and their empty review envelopes were each down-voted as transport-only noise; they add no finding and do not change the already-recorded per-thread dispositions. All seven review threads remain resolved, and the updated exact head completed the full check/review watcher with no new actionable thread.

@unbraind

unbraind commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Tracked in PM: pm-5ecnar, pm-77bmeu, pm-b0twiy, pm-b1zsk9, pm-bwnclq, pm-cragzs, pm-r2suqb.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant