Skip to content

Align shell completion runtime parity and changelog reliability - #76

Merged
unbraind merged 2 commits into
mainfrom
fix/completion-runtime-parity-changelog-reliability
May 27, 2026
Merged

unbraind merged 2 commits into
mainfrom
fix/completion-runtime-parity-changelog-reliability

Conversation

@unbraind

Copy link
Copy Markdown
Owner

Summary

  • Forward runtime completion config (statuses and command_flags) to zsh and fish so all shells now honor the same runtime schema field/status surfaces as bash.
  • Add regression coverage for runtime flag rendering parity and sorted/dashed runtime field normalization in completion unit + CLI-level tests.
  • Regenerate CHANGELOG.md with latest pm-changelog and record detailed pm-59gj evidence (files/tests/findings/manual dogfood + release gate results).

Test plan

  • node scripts/run-tests.mjs test -- tests/unit/completion-command.spec.ts
  • node scripts/run-tests.mjs test -- tests/integration/release-readiness-runtime.spec.ts
  • pnpm changelog:pm:check
  • pnpm outdated --format json && pnpm audit --prod --json && pnpm audit --json
  • node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort
  • node scripts/release/run-gates.mjs --telemetry-mode best-effort
  • Manual temp-directory dogfood with isolated PM_PATH/PM_GLOBAL_PATH for init/install/create/update/close/completion/contracts/changelog flow

Forwarding runtime status and schema field flags to every shell keeps agent completions consistent with runtime contracts, while regenerating CHANGELOG.md with the latest pm-changelog and recording full pm evidence restores deterministic release reliability.

@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

@coderabbitai

coderabbitai Bot commented May 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@unbraind, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 10 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: fdc6d635-d40d-489b-94aa-62d0637b9af2

📥 Commits

Reviewing files that changed from the base of the PR and between 15620cd and fc19398.

📒 Files selected for processing (4)
  • .agents/pm/features/pm-59gj.toon
  • .agents/pm/history/pm-59gj.jsonl
  • src/cli/commands/completion.ts
  • tests/unit/completion-command.spec.ts
📝 Walkthrough

Walkthrough

This PR implements runtime-driven completion parity across bash, zsh, and fish shells by adding support for runtime-provided schema field flags and configurable status choices. Helper functions normalize flag names and render shell-specific completion specs, while generateZshScript and generateFishScript are updated to accept runtime config and inject completion entries. Tests validate the new behavior across all three shells.

Changes

Runtime Completion Parity Implementation

Layer / File(s) Summary
Runtime flag normalization and completion spec helpers
src/cli/commands/completion.ts
Added internal helper functions to normalize runtime flag names by trimming, deduplicating, enforcing -- prefixes, converting underscores to dashes, and sorting; and to render shell-specific completion spec fragments for zsh and fish when runtime.command_flags are provided.
Zsh script generation with runtime completion support
src/cli/commands/completion.ts
Updated generateZshScript to accept a runtime: CompletionRuntimeConfig parameter, compute dynamic status choices from runtime.statuses, pre-render runtime-field completion specs, and inject those specs into zsh _arguments groups across list, aggregate, dedupe-audit, create, update, update-many, normalize, calendar, context, search, and comments-audit commands. Replaced hardcoded status option lists with computed statusChoices.
Fish script generation with runtime completion support
src/cli/commands/completion.ts
Updated generateFishScript to accept runtime: CompletionRuntimeConfig, compute status choices from runtime.statuses, pre-render and inject runtime-field completion spec fragments for list, aggregate, dedupe-audit, update, update-many, normalize, search, calendar, context, and comments-audit. Replaced hardcoded status completions with computed statusChoices.
Runtime parameter forwarding and test coverage
src/cli/commands/completion.ts, tests/unit/completion-command.spec.ts
Updated runCompletion to pass the runtime object to both generateZshScript and generateFishScript. Added test cases validating runtime-driven completion flags across zsh and fish shells, including status filters and runtime schema field flag entries with proper ordering, and extended existing runtime field tests to verify zsh and fish output formatting.

Work Tracking and Documentation

Layer / File(s) Summary
Feature tracker and execution history
.agents/pm/features/pm-59gj.toon, .agents/pm/history/pm-59gj.jsonl
Updated feature record pm-59gj from open to in_progress, added assignee, and recorded completion runtime parity implementation evidence including runCompletion runtime-status/command-flag forwarding, shell-specific completion updates, unit regression test addition, changelog regeneration, and verification via telemetry/Sentry gates. Execution history records assignee claim, status transition, metadata for regression coverage and test command suite, and evidence notes confirming implementation, changelog, dependency/security checks, and end-to-end gate success.
Manifest and changelog updates
.agents/pm/extensions/.managed-extensions.json, CHANGELOG.md
Updated managed extensions manifest timestamp and added CHANGELOG.md entries documenting esbuild bundling for sub-200ms CLI startup, extension hardening and security improvements, and CI/CD performance enhancements via in-process CLI runner and matrix deduplication.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed The title clearly summarizes the main changes: aligning shell completion runtime parity (forwarding runtime config to zsh/fish) and changelog reliability (regenerating CHANGELOG.md with latest tools).
Description check ✅ Passed The description directly relates to the changeset by explaining the runtime config forwarding, test coverage additions, changelog regeneration, and detailing the comprehensive test plan executed.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@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 @.agents/pm/extensions/.managed-extensions.json:
- Line 3: Do not edit the managed extensions manifest in-place: revert the
direct change to the "updated_at" JSON field in the managed extensions manifest
and restore the committed file to its previous state, then perform the update
via the pm system workflow (use the pm workflow/CLI that updates managed
extensions) so the manifest is changed by the system of record rather than by a
manual commit. Ensure no other edits remain in the manifest commit and confirm
the pm workflow produces the intended "updated_at" change.

In @.agents/pm/features/pm-59gj.toon:
- Line 5: Revert the direct edit that changed the tracker record status (the
"status: in_progress" entry for tracker id pm-59gj) and restore the
system-of-record version; do not modify records under the pm-managed tracker
directory directly—instead update this tracker via the pm workflow/tooling/CLI
(use the pm command or UI to set the status to in_progress) and ensure the other
noted entries (the additional ranges referenced in the review) are corrected
through the same pm workflow rather than manual file edits.

In @.agents/pm/history/pm-59gj.jsonl:
- Around line 77-91: The history JSON was edited directly (ops like comment_add,
files_add, tests_add modifying metadata.comments / metadata.files /
metadata.tests), which violates the system-of-record rule; revert these manual
edits and reapply the same updates through the official pm workflow/CLI so
entries are created by the pm system (use the pm commands or API that produce
claim/update/comment_add/files_add/tests_add events rather than editing the
JSON), ensuring the same metadata keys (metadata.comments, metadata.files,
metadata.tests) and operations (comment_add, files_add, tests_add) are recorded
by pm so the change history remains authoritative and reproducible.
🪄 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: CHILL

Plan: Pro

Run ID: d800ef23-eca4-4e8f-a049-f3b525c01e0b

📥 Commits

Reviewing files that changed from the base of the PR and between 5fdba33 and 15620cd.

📒 Files selected for processing (6)
  • .agents/pm/extensions/.managed-extensions.json
  • .agents/pm/features/pm-59gj.toon
  • .agents/pm/history/pm-59gj.jsonl
  • CHANGELOG.md
  • src/cli/commands/completion.ts
  • tests/unit/completion-command.spec.ts

{
"version": 1,
"updated_at": "2026-05-26T22:27:58.509Z",
"updated_at": "2026-05-27T05:22:31.461Z",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Managed extensions manifest should not be edited in-place.

Update this through the pm system workflow rather than committing direct edits to .agents/pm/extensions/.managed-extensions.json.

As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.

🤖 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 @.agents/pm/extensions/.managed-extensions.json at line 3, Do not edit the
managed extensions manifest in-place: revert the direct change to the
"updated_at" JSON field in the managed extensions manifest and restore the
committed file to its previous state, then perform the update via the pm system
workflow (use the pm workflow/CLI that updates managed extensions) so the
manifest is changed by the system of record rather than by a manual commit.
Ensure no other edits remain in the manifest commit and confirm the pm workflow
produces the intended "updated_at" change.

description: "Build a package-first pm ecosystem around installable project-management packages while using Pi/OpenClaw only as architecture references for npm/git/local package sourcing, manifest contracts, diagnostics, and small-core extensibility."
type: Feature
status: open
status: in_progress

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Do not modify tracker records under .agents/pm directly.

This file is edited directly, but .agents/pm is designated as system-of-record managed data and should be updated via the pm workflow/tooling instead of manual file edits.

As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.

Also applies to: 9-10, 14-14, 48-50, 57-57, 64-64, 71-71, 74-81

🤖 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 @.agents/pm/features/pm-59gj.toon at line 5, Revert the direct edit that
changed the tracker record status (the "status: in_progress" entry for tracker
id pm-59gj) and restore the system-of-record version; do not modify records
under the pm-managed tracker directory directly—instead update this tracker via
the pm workflow/tooling/CLI (use the pm command or UI to set the status to
in_progress) and ensure the other noted entries (the additional ranges
referenced in the review) are corrected through the same pm workflow rather than
manual file edits.

Comment on lines +77 to +91
{"ts":"2026-05-27T05:00:50.688Z","author":"codex-agent-20260527","op":"claim","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:00:50.688Z"},{"op":"add","path":"/metadata/assignee","value":"codex-agent-20260527"}],"before_hash":"353da98e08b8f8c8900463c973eadde9bcc465795df5cc974cfe361d090037f1","after_hash":"a70be10e2a025789bc5ce1d65ef2e1075c86daba9bd20c6fb42443c2ef142c38"}
{"ts":"2026-05-27T05:00:52.317Z","author":"codex-agent-20260527","op":"update","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:00:52.317Z"},{"op":"replace","path":"/metadata/status","value":"in_progress"}],"before_hash":"a70be10e2a025789bc5ce1d65ef2e1075c86daba9bd20c6fb42443c2ef142c38","after_hash":"ce715936a1636e357d45cb484009a72f9877f2acfd3867d381579dedc9a3bee1"}
{"ts":"2026-05-27T05:00:53.100Z","author":"codex-agent-20260527","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/33","value":{"created_at":"2026-05-27T05:00:53.100Z","author":"codex-agent-20260527","text":"Execution start 2026-05-27: bootstrap passed (npm install -g ., pm --version, node -v, pnpm -v, pnpm build). Duplicate check reused pm-59gj after pm context/search/list-open/list-in-progress; no active duplicate item exists for completion runtime parity and changelog reliability continuation. Proceeding with completion runtime parity implementation, changelog check, GitHub/dependency/security validation, and manual temp-directory dogfood evidence."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:00:53.100Z"}],"before_hash":"ce715936a1636e357d45cb484009a72f9877f2acfd3867d381579dedc9a3bee1","after_hash":"3082f1a741e3b7da3cf389db1560518897e902c161cf19d67996a75d89f84dba"}
{"ts":"2026-05-27T05:11:57.699Z","author":"codex-agent-20260527","op":"files_add","patch":[{"op":"replace","path":"/metadata/files/13/note","value":"private bundled package catalog link regression"},{"op":"replace","path":"/metadata/files/13/path","value":"tests/unit/extension-command.spec.ts"},{"op":"replace","path":"/metadata/files/12/note","value":"review fix: package string options are trimmed before runtime use"},{"op":"replace","path":"/metadata/files/12/path","value":"src/sdk/package-runtime-options.ts"},{"op":"replace","path":"/metadata/files/11/note","value":"review fix: blank import authors fall through to PM_AUTHOR/settings"},{"op":"replace","path":"/metadata/files/11/path","value":"src/sdk/package-import-adapters.ts"},{"op":"replace","path":"/metadata/files/10/note","value":"static SDK action list excludes package-owned actions"},{"op":"replace","path":"/metadata/files/10/path","value":"src/sdk/cli-contracts.ts"},{"op":"replace","path":"/metadata/files/9/note","value":"package manifest exposes private package metadata"},{"op":"replace","path":"/metadata/files/9/path","value":"src/core/packages/manifest.ts"},{"op":"replace","path":"/metadata/files/8/note","value":"pruned package-owned command exports from core barrel"},{"op":"replace","path":"/metadata/files/8/path","value":"src/cli/commands/index.ts"},{"op":"replace","path":"/metadata/files/7/note","value":"catalog omits fabricated npm links for private bundled packages"},{"op":"replace","path":"/metadata/files/7/path","value":"src/cli/commands/extension.ts"},{"op":"replace","path":"/metadata/files/6/note","value":"Runtime parity for zsh and fish completion status and schema field flags"},{"op":"replace","path":"/metadata/files/6/path","value":"src/cli/commands/completion.ts"},{"op":"add","path":"/metadata/files/14","value":{"path":"tests/unit/sdk-index.spec.ts","scope":"project","note":"SDK static action boundary regression"}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:11:57.699Z"}],"before_hash":"3082f1a741e3b7da3cf389db1560518897e902c161cf19d67996a75d89f84dba","after_hash":"7e658591685c33c3f88ba5e64a478f198083530b2a1670c42c35960cf5c0f733"}
{"ts":"2026-05-27T05:11:59.620Z","author":"codex-agent-20260527","op":"files_add","patch":[{"op":"replace","path":"/metadata/files/14/note","value":"private bundled package catalog link regression"},{"op":"replace","path":"/metadata/files/14/path","value":"tests/unit/extension-command.spec.ts"},{"op":"replace","path":"/metadata/files/13/note","value":"Regression coverage for runtime completion parity across shells"},{"op":"replace","path":"/metadata/files/13/path","value":"tests/unit/completion-command.spec.ts"},{"op":"add","path":"/metadata/files/15","value":{"path":"tests/unit/sdk-index.spec.ts","scope":"project","note":"SDK static action boundary regression"}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:11:59.620Z"}],"before_hash":"7e658591685c33c3f88ba5e64a478f198083530b2a1670c42c35960cf5c0f733","after_hash":"ab9336fa17ffc029c4c842e9ebe5d1d60be025682ae051fa27413671ca0298f4"}
{"ts":"2026-05-27T05:12:01.733Z","author":"codex-agent-20260527","op":"files_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:12:01.733Z"}],"before_hash":"ab9336fa17ffc029c4c842e9ebe5d1d60be025682ae051fa27413671ca0298f4","after_hash":"dccc7577e3bb10deba634b20ab9e7ac104fb3645ce130c7690db98bcdd1c009d"}
{"ts":"2026-05-27T05:12:03.602Z","author":"codex-agent-20260527","op":"files_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:12:03.602Z"}],"before_hash":"dccc7577e3bb10deba634b20ab9e7ac104fb3645ce130c7690db98bcdd1c009d","after_hash":"1950f3420c2520298cfc40df3637a679e8cddf6184c7544a27bd7711ce1c32ee"}
{"ts":"2026-05-27T05:12:05.932Z","author":"codex-agent-20260527","op":"tests_add","patch":[{"op":"replace","path":"/metadata/tests/0/command","value":"node scripts/run-tests.mjs test -- tests/unit/completion-command.spec.ts"},{"op":"add","path":"/metadata/tests/1","value":{"command":"node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/extension-command.spec.ts tests/unit/package-manifest.spec.ts tests/integration/release-readiness-runtime.spec.ts","scope":"project","timeout_seconds":600}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:12:05.932Z"}],"before_hash":"1950f3420c2520298cfc40df3637a679e8cddf6184c7544a27bd7711ce1c32ee","after_hash":"1902af64d3113d998fe5dfb0e7dd9ca7aea8e0898908ada05cf3f01ee3c1c924"}
{"ts":"2026-05-27T05:12:07.797Z","author":"codex-agent-20260527","op":"tests_add","patch":[{"op":"replace","path":"/metadata/tests/1/command","value":"node scripts/run-tests.mjs test -- tests/unit/completion-command.spec.ts"},{"op":"replace","path":"/metadata/tests/0/timeout_seconds","value":900},{"op":"replace","path":"/metadata/tests/0/command","value":"node scripts/run-tests.mjs test -- tests/integration/release-readiness-runtime.spec.ts"},{"op":"add","path":"/metadata/tests/2","value":{"command":"node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/extension-command.spec.ts tests/unit/package-manifest.spec.ts tests/integration/release-readiness-runtime.spec.ts","scope":"project","timeout_seconds":600}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:12:07.797Z"}],"before_hash":"1902af64d3113d998fe5dfb0e7dd9ca7aea8e0898908ada05cf3f01ee3c1c924","after_hash":"11e2a863f383605f79bc410bfa48bab380d18421e8cf6dd0632e5fb73d5eb159"}
{"ts":"2026-05-27T05:12:09.691Z","author":"codex-agent-20260527","op":"tests_add","patch":[{"op":"add","path":"/metadata/tests/3","value":{"command":"pnpm changelog:pm:check","scope":"project","timeout_seconds":600}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:12:09.691Z"}],"before_hash":"11e2a863f383605f79bc410bfa48bab380d18421e8cf6dd0632e5fb73d5eb159","after_hash":"7f0150a837a4d39f6b241db0517da197a2256097bdb7c2dc17b6b50634433ced"}
{"ts":"2026-05-27T05:12:11.621Z","author":"codex-agent-20260527","op":"tests_add","patch":[{"op":"add","path":"/metadata/tests/4","value":{"command":"pnpm outdated --format json && pnpm audit --prod --json && pnpm audit --json","scope":"project","timeout_seconds":600}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:12:11.621Z"}],"before_hash":"7f0150a837a4d39f6b241db0517da197a2256097bdb7c2dc17b6b50634433ced","after_hash":"858c5c4f84c94588fb658a86808c6c2fe6f9c7b412fd1f30001654c1990e8017"}
{"ts":"2026-05-27T05:12:13.627Z","author":"codex-agent-20260527","op":"tests_add","patch":[{"op":"replace","path":"/metadata/tests/4/command","value":"pnpm changelog:pm:check"},{"op":"replace","path":"/metadata/tests/3/command","value":"node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/extension-command.spec.ts tests/unit/package-manifest.spec.ts tests/integration/release-readiness-runtime.spec.ts"},{"op":"replace","path":"/metadata/tests/2/command","value":"node scripts/run-tests.mjs test -- tests/unit/completion-command.spec.ts"},{"op":"replace","path":"/metadata/tests/1/timeout_seconds","value":900},{"op":"replace","path":"/metadata/tests/1/command","value":"node scripts/run-tests.mjs test -- tests/integration/release-readiness-runtime.spec.ts"},{"op":"replace","path":"/metadata/tests/0/timeout_seconds","value":240},{"op":"replace","path":"/metadata/tests/0/command","value":"node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort"},{"op":"add","path":"/metadata/tests/5","value":{"command":"pnpm outdated --format json && pnpm audit --prod --json && pnpm audit --json","scope":"project","timeout_seconds":600}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:12:13.627Z"}],"before_hash":"858c5c4f84c94588fb658a86808c6c2fe6f9c7b412fd1f30001654c1990e8017","after_hash":"b0fb8e5701108d1311bc2bcc18bd332a0d2590aaaea0710ee7335fa9f35cb79f"}
{"ts":"2026-05-27T05:12:24.791Z","author":"codex-agent-20260527","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/34","value":{"created_at":"2026-05-27T05:12:24.791Z","author":"codex-agent-20260527","text":"Evidence update 2026-05-27: implemented completion runtime parity so runCompletion now forwards runtime status and command_flags to bash/zsh/fish consistently, and zsh/fish now emit runtime schema field completions (for example --customer-segment) and runtime status choices. Added regression coverage in tests/unit/completion-command.spec.ts for runCompletion runtime config propagation and CLI-level zsh/fish runtime flag rendering. Focused verification passed: node scripts/run-tests.mjs test -- tests/unit/completion-command.spec.ts (91 tests) and node scripts/run-tests.mjs test -- tests/integration/release-readiness-runtime.spec.ts (33 tests). Changelog reliability: pnpm changelog:pm regenerated CHANGELOG.md with pm-changelog 2026.5.26 and pnpm changelog:pm:check now reports unchanged/green. GitHub/dependency/security checks revalidated: gh issue list and gh pr list are empty, dependabot alerts empty, security advisories empty, code-scanning endpoint returns no analysis found, pnpm outdated empty, pnpm audit prod/full report 0 vulnerabilities. Manual temp-directory dogfood passed with isolated PM_PATH/PM_GLOBAL_PATH: init, install guide-shell, schema field injection, create/update/close lifecycle, completion zsh/fish runtime flag rendering, contracts list flags output, install pm-changelog, and changelog generate to temp CHANGELOG.md containing the closed item. Telemetry/Sentry gate command ran successfully with fresh data access: telemetry ok finish_error_rate_pct 1.84 and missing error rows 0, while current Sentry threshold check reports critical 0/high 5 (existing unresolved issues, not introduced by this change)."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:12:24.791Z"}],"before_hash":"b0fb8e5701108d1311bc2bcc18bd332a0d2590aaaea0710ee7335fa9f35cb79f","after_hash":"96344f02bbdbbbfc842165849b70a9634bc33a0a740bc8dd8cd798f9bc19a9b2"}
{"ts":"2026-05-27T05:21:43.844Z","author":"codex-agent-20260527","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/35","value":{"created_at":"2026-05-27T05:21:43.844Z","author":"codex-agent-20260527","text":"Final verification 2026-05-27: node scripts/release/run-gates.mjs --telemetry-mode best-effort passed end-to-end after completion parity updates. Coverage gate is green at 100 percent (2611/2611 statements, 1907/1907 branches, 481/481 functions, 2512/2512 lines), docs/skills gate passed, static quality passed, version policy passed, secret scan passed, npx smoke passed, package-first dogfood passed (84 commands), and release gates reported success."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:21:43.844Z"}],"before_hash":"96344f02bbdbbbfc842165849b70a9634bc33a0a740bc8dd8cd798f9bc19a9b2","after_hash":"826257dee24c9ffcac9dcbbdf97aec551c8b5e1994b9e14865741880af76cc39"}
{"ts":"2026-05-27T05:22:45.258Z","author":"codex-agent-20260527","op":"tests_add","patch":[{"op":"replace","path":"/metadata/tests/5/command","value":"pnpm changelog:pm:check"},{"op":"replace","path":"/metadata/tests/4/command","value":"node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/extension-command.spec.ts tests/unit/package-manifest.spec.ts tests/integration/release-readiness-runtime.spec.ts"},{"op":"replace","path":"/metadata/tests/3/command","value":"node scripts/run-tests.mjs test -- tests/unit/completion-command.spec.ts"},{"op":"replace","path":"/metadata/tests/2/timeout_seconds","value":900},{"op":"replace","path":"/metadata/tests/2/command","value":"node scripts/run-tests.mjs test -- tests/integration/release-readiness-runtime.spec.ts"},{"op":"replace","path":"/metadata/tests/1/timeout_seconds","value":240},{"op":"replace","path":"/metadata/tests/1/command","value":"node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort"},{"op":"replace","path":"/metadata/tests/0/timeout_seconds","value":1200},{"op":"replace","path":"/metadata/tests/0/command","value":"node scripts/release/run-gates.mjs --telemetry-mode best-effort"},{"op":"add","path":"/metadata/tests/6","value":{"command":"pnpm outdated --format json && pnpm audit --prod --json && pnpm audit --json","scope":"project","timeout_seconds":600}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-27T05:22:45.258Z"}],"before_hash":"826257dee24c9ffcac9dcbbdf97aec551c8b5e1994b9e14865741880af76cc39","after_hash":"fcbb7f9be779878fe76d6dd13252e6d5bee1d53ee6a3346555026285608eea50"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

History log under .agents/pm is being edited directly.

Please record these updates through the pm system path so the system-of-record flow remains authoritative and reproducible.

As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.

🤖 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 @.agents/pm/history/pm-59gj.jsonl around lines 77 - 91, The history JSON was
edited directly (ops like comment_add, files_add, tests_add modifying
metadata.comments / metadata.files / metadata.tests), which violates the
system-of-record rule; revert these manual edits and reapply the same updates
through the official pm workflow/CLI so entries are created by the pm system
(use the pm commands or API that produce
claim/update/comment_add/files_add/tests_add events rather than editing the
JSON), ensuring the same metadata keys (metadata.comments, metadata.files,
metadata.tests) and operations (comment_add, files_add, tests_add) are recorded
by pm so the change history remains authoritative and reproducible.

@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 runtime completion parity for zsh and fish shells, ensuring that runtime statuses and custom schema field flags are dynamically and consistently generated across bash, zsh, and fish. It also updates the changelog and adds regression test coverage. A bug was identified in the flag normalization logic where deduplication is performed before mapping underscores to dashes, which can lead to duplicate flags in the output if both formats are provided.

Comment on lines +91 to +95
function normalizeRuntimeCompletionFlags(runtimeFlags: string[] | undefined): string[] {
return [...new Set((runtimeFlags ?? []).map((value) => value.trim()).filter((value) => value.startsWith("--")))]
.map((value) => `--${value.slice(2).replaceAll("_", "-")}`)
.sort((left, right) => left.localeCompare(right));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The current implementation of normalizeRuntimeCompletionFlags applies Set deduplication before mapping underscores to dashes. If runtimeFlags contains both "--customer_segment" and "--customer-segment", they will not be deduplicated because they are distinct strings before the mapping step. After mapping, they both become "--customer-segment", resulting in duplicate flags in the final output.

Additionally, we should ensure that we only process valid flags that have characters after the "--" prefix (i.e., length > 2) to avoid generating empty or invalid flags.

Applying the deduplication after the normalization mapping solves this issue.

function normalizeRuntimeCompletionFlags(runtimeFlags: string[] | undefined): string[] {
  const normalized = (runtimeFlags ?? [])
    .map((value) => value.trim())
    .filter((value) => value.startsWith("--") && value.length > 2)
    .map((value) => `--${value.slice(2).replaceAll("_", "-")}`);
  return [...new Set(normalized)].sort((left, right) => left.localeCompare(right));
}

Deduping after underscore-to-dash normalization prevents duplicate shell flags when both formats are supplied, and the new regression test locks this behavior for zsh and fish outputs.
@unbraind
unbraind merged commit 63efb1b into main May 27, 2026
13 checks passed
@unbraind
unbraind deleted the fix/completion-runtime-parity-changelog-reliability branch May 27, 2026 05:48
unbraind added a commit that referenced this pull request May 27, 2026
Capturing merge outcomes and releasing ownership in tracker history keeps pm as the system of record for this completion/changelog reliability slice.
unbraind added a commit that referenced this pull request Jul 13, 2026
…y windows spec defect + GH-529/530/532–535 items, regen changelog

- backfill close-time resolution triple on pm-vjk3/pm-rxp1/pm-w1c0 (PR#536 self-close leak; 279→276)
- reconcile stranded PR#531 lane item pm-hq28 (metadata backfill, release, close)
- link PR#536 boundary spec to pm-rxp1 (orphaned-files warning cleared)
- file pm-u5zr: package-manifest spec POSIX endsWith exemption fails on Windows (new nightly defect, distinct from pm-b24b)
- file GH-529→pm-surv, GH-530→pm-kj4k, GH-532→pm-jh9t, GH-533→pm-7je0, GH-534→pm-45mb, GH-535→pm-p9sc with pm-link comments
- drift notes on pm-usfg (PR#536 SDK surface), pm-j8z6 (moved/deleted classification), pm-wenq (trend), pm-doxj (pass summary)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TTM9ZFTZCxcb4ruHjQwoEg
unbraind added a commit that referenced this pull request Jul 13, 2026
…ape drift, extend pm-hous to locks/ and ship the gitignore micro-fix

- File pm-hno5 (GH-542, parent pm-mpbb): pm_copy nests title/message under
  options while sibling mutation tools declare flat camelCase params; the
  runtime accepts flat and our own MCP integration suite triggers
  unexpected-top-level-argument warnings on every run.
- Extend pm-hous scope: the fenced ignore block and tracked-cache warning
  must also cover .agents/pm/locks/ (pass #76 accidentally committed a
  live-pid reindex.lock).
- Ship the locks/ half directly: add .agents/pm/locks/ to the canonical
  ensurePmGitignore block, the repo .gitignore fence, and the AGENT_GUIDE
  remediation line; assert it in gitignore.spec.ts; untrack the stale lock.
- Milestone note on pm-doxj: nightly windows/Node24 red matches the known
  pm-b24b + pm-u5zr pair only; validate zero-drift; npm 2026.7.13 healthy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TTM9ZFTZCxcb4ruHjQwoEg
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