Skip to content

Harden init target safety and package install verification - #491

Merged
unbraind merged 4 commits into
mainfrom
feat/init-package-verification-path-safety
Jul 10, 2026
Merged

unbraind merged 4 commits into
mainfrom
feat/init-package-verification-path-safety

Conversation

@unbraind

@unbraind unbraind commented Jul 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add explicit workspace/tracker target contracts for pm init, including executable --pm-path-scoped follow-ups
  • confine init --with-packages writes to the resolved target tracker
  • make extension load/activation failures authoritative across ok, activated, exit codes, aggregation, diagnostics, and SDK recovery guidance
  • add compact post-install verification for activation, registered commands/actions/types, target root, and blocking health
  • retain the context-evaluation runtime hardening already committed on this branch
  • normalize stale tracker sessions, close five completed canonical pm items, preserve the open canonical first-party service-collision follow-up, and regenerate CHANGELOG.md with pm-changelog 2026.7.8

Closes #488
Closes #473

Root causes

Path-target init output assumed workspace discovery and bundled installs inherited caller globals. Package installation also treated file copy as success even when runtime load or activation failed, producing contradictory result fields and a zero exit status.

Verification

  • node scripts/run-tests.mjs coverage: 270 files, 5,505 tests, exact 100/100/100/100
  • pm test-all --status in_progress --progress: 8 passed, 0 failed, 1 duplicate-safe skip
  • pnpm typecheck
  • pnpm contracts:check
  • pnpm lint: ESLint, 0 jscpd clones, static quality, token budget
  • docs/skills and context-evaluation gates
  • secret scan and dependency audit: clean
  • live CodeFactor: A+, 0 issues
  • packed npm proof: 11 bundled packages activated in target tracker, 0 caller extension files, CLI + public SDK context green, isolated doctor blocking failures = 0
  • Greptile pre-push review a05e5598-76c0-4e44-b255-a7e41fb356f2: confidence 5/5, no comments
  • pm health --check-only --summary: clean; history drift: 0

Tracker

Completed: pm-x26a, pm-3wsi, pm-yjim, pm-qt5d, pm-b3e9. Broader context work returned to open/unclaimed; no pm items remain in progress.


Summary by cubic

Hardens pm init target safety and adds compact post‑install package verification. Preserves multi‑target install diagnostics, enforces non‑zero exits on degraded/disabled verification, and serializes package probing; includes runnable, tracker‑scoped next steps (addresses GH‑488, GH‑473) and fixes a CodeQL‑reported shell‑sensitive path case.

  • New Features

    • Explicit init target contract: pm init --workspace <dir> creates <dir>/.agents/pm; a positional path keeps tracker‑root mode. Result includes target (mode, tracker_root, workspace_root?) and next_steps that carry --pm-path.
    • pm install returns a verification summary (activation, registered commands/actions/types, target root, health). ok: false or verification.status: "degraded" fails the install.
    • Next steps hint SDK recovery when activation errors mention @unbrained/pm-cli.
  • Bug Fixes

    • Confined init --with-packages and project installs to the resolved tracker; guard positional path targets from repository‑root writes.
    • Preserve activation diagnostics in multi‑target rows; treat disabled/degraded verification as failure with a non‑zero exit; doctor and aggregation match runtime.
    • Serialize package‑root probing to avoid races for concurrent SDK callers.
    • Context evaluation: ignore unknown scorer keys, require finite thresholds, and aggregate only canonical metrics.
    • Security hardening: handle repeated shell‑sensitive path characters in init target rendering (CodeQL alert).

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

Review in cubic

unbraind added 2 commits July 10, 2026 02:17
Ignore unknown JavaScript scorer weight keys, aggregate only canonical evaluation metrics, and reject missing or non-finite threshold values in both the public SDK and external corpus gate. Add focused regression coverage and record the review-fix evidence in the active pm items.
Add explicit workspace/tracker init target contracts and executable scoped follow-ups. Make package installation activation diagnostics authoritative, return non-zero failures, and include compact post-install verification. Cover path isolation, SDK recovery, contracts, docs, tracker lifecycle hygiene, and package-owned changelog generation with exact 100% coverage and packed-install proof.

@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 Jul 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds workspace-aware pm init targeting and scoped follow-up commands, enriches package-install activation verification and diagnostics, hardens context-evaluation threshold handling, updates documentation and changelog entries, and records project-tracking evidence.

Changes

Init targeting and scoped commands

Layer / File(s) Summary
Workspace targeting and scoped results
src/cli/commands/init.ts, src/cli/register-setup.ts, src/sdk/cli-contracts/flag-contracts.ts, tests/integration/init-path-guard.integration.spec.ts, tests/unit/commands/init-command.spec.ts, tests/unit/commands/register-commands.spec.ts
Adds --workspace, structured target metadata, tracker-scoped next_steps, target-rooted bundled package installation, validation, and integration coverage.
Init documentation and contracts
docs/COMMANDS.md, docs/SDK.md, tests/fixtures/contracts/full.json, tests/integration/release-readiness-runtime.spec.ts
Documents workspace targeting and install-result semantics, updates the CLI flag fixture, and includes target in deterministic JSON key ordering.

Package installation verification

Layer / File(s) Summary
Activation diagnostics and aggregate outcomes
src/cli/commands/extension.ts, src/cli/register-setup.ts, src/core/extensions/index.ts
Serializes runtime probes, scopes package-root resolution, reports activation and verification diagnostics, adds SDK recovery guidance, preserves per-target failures, computes install-all results from ok, and propagates failure exit codes.
Verification tests and release documentation
tests/integration/package-command-discovery.integration.spec.ts, tests/unit/extensions/extension-command.spec.ts, tests/unit/commands/register-commands.spec.ts, CHANGELOG.md, docs/EXTENSIONS.md
Tests successful and failed activation flows, aggregate diagnostics, exit codes, recovery guidance, verification output, and --pm-path behavior.

Context evaluation hardening

Layer / File(s) Summary
Canonical metrics and finite thresholds
src/sdk/context-relevance.ts, scripts/release/context-eval-gate.mjs, tests/unit/sdk/context-relevance.spec.ts, tests/unit/scripts/release/context-eval-gate.spec.ts
Ignores unknown weight overrides, aggregates canonical metrics, and rejects missing, null, or non-finite thresholds.

Project tracking

Layer / File(s) Summary
Lifecycle, evidence, and closure metadata
.agents/pm/{epics,features,issues,stories,tasks,history}/*
Updates work-item status, ownership, verification evidence, linked artifacts, test runs, resolutions, and release records.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI as pm CLI
  participant Init as init command
  participant Extension as extension installer
  participant Runtime as extension runtime
  CLI->>Init: resolve workspace or tracker target
  Init->>Extension: install bundled packages at tracker root
  Extension->>Runtime: probe loading and activation
  Runtime-->>Extension: activation status and diagnostics
  Extension-->>CLI: verification and failure details
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% 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 The PR addresses #488 with tracker-scoped follow-ups and #473 with post-install verification summary and failure handling.
Out of Scope Changes check ✅ Passed The extra docs, tests, changelog, and metadata updates align with the stated objectives and do not appear unrelated.
Title check ✅ Passed The title clearly summarizes the main change: harder init target safety and package install verification.
Description check ✅ Passed The description is directly related to the changeset and covers the init, install verification, and cleanup 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
unbraind marked this pull request as ready for review July 10, 2026 06:31
@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
✅ 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 workspace-local tracker initialization via the new --workspace option for pm init, ensuring that follow-up commands are properly scoped with --pm-path when discovery is unavailable. It also hardens package installation by introducing a post-install verification summary, ensuring that runtime activation failures result in non-zero exit codes and provide actionable recovery steps (such as when @unbrained/pm-cli is unresolvable). Additionally, context evaluation gates and weight overrides are hardened against non-finite thresholds and unknown keys. Feedback on the changes suggests safeguarding string operations on activationFailure.error to prevent potential runtime crashes if the error property is undefined or not a string.

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/extension.ts Resolved
@greptile-apps

greptile-apps Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR hardens pm init target handling and package install verification. The main changes are:

  • Adds explicit workspace and tracker target contracts for pm init.
  • Scopes init --with-packages installs to the resolved target tracker.
  • Makes extension load and activation failures drive ok, activation state, verification, diagnostics, and exit codes.
  • Adds post-install verification for activation, command/action/type registration, target root, and blocking health.
  • Tightens context evaluation metric validation and canonical aggregation.

Confidence Score: 5/5

Safe to merge with low risk.

The changed paths consistently scope init package installs, reject unsafe tracker targets, and propagate activation failures through result objects and exit codes. Tests cover the main changed workflows, including prior review findings.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The focused Vitest rerun completed with 5 test files passed and 185 tests passed, and exited with code 0.
  • The CLI init command returned INIT_EXIT_CODE 0, printed the target tracker path under the target directory, listed created target files, and reported CALLER_PM_DIR_ABSENT.
  • The pre-init Git status showed only untracked Greptile/runtime artifact directories.
  • The post-init Git status remained limited to untracked Greptile/runtime artifact directories.
  • A shell-script artifact documents the setup steps used during package initialization.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/cli/commands/init.ts Adds explicit init target resolution, workspace mode, scoped next steps, workspace-root guard coverage, and tracker-scoped bundled package installation.
src/cli/commands/extension.ts Makes package install verification authoritative by runtime-probing activation, disabled-extension state, registrations, diagnostics, and aggregate install success.
src/cli/register-setup.ts Propagates install verification fields to multi-target output, surfaces ok=false as non-zero exit, and wires init --workspace.
src/sdk/context-relevance.ts Constrains context relevance weight overrides and evaluation aggregation to canonical metrics with finite threshold validation.
scripts/release/context-eval-gate.mjs Adds finite canonical context evaluation threshold checks before running the release gate.
tests/integration/init-path-guard.integration.spec.ts Adds integration coverage for positional tracker guards, explicit workspace init, scoped next steps, and package install confinement.
tests/integration/package-command-discovery.integration.spec.ts Adds integration coverage for successful verification output and failed activation diagnostics/non-zero exit behavior.
tests/unit/commands/init-command.spec.ts Expands unit coverage for init target resolution, scoped next steps, workspace guards, summaries, and with-packages failures.
tests/unit/extensions/extension-command.spec.ts Adds unit coverage for activation failures, missing SDK recovery, disabled extension verification, and scaffold guidance.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant Init as pm init
participant Resolver as Target resolver
participant Tracker as Target tracker
participant Installer as pm install all
participant Runtime as Extension runtime probe

User->>Init: init [prefix/path] [--workspace] [--with-packages]
Init->>Resolver: resolve workspace/tracker target
Resolver-->>Init: target mode + tracker_root
Resolver-->>Init: target mode + tracker_root
Init->>Tracker: create settings/schema/type folders
alt --with-packages
    Init->>Installer: runExtension("all", --project, --pm-path tracker_root)
    Installer->>Tracker: install bundled packages
    Installer->>Runtime: load + activate installed packages
    Runtime-->>Installer: activation status, commands/actions/types, health
    Installer-->>Init: installed_all / failed aliases / verification
end
Init-->>User: result with target + scoped next_steps
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 Init as pm init
participant Resolver as Target resolver
participant Tracker as Target tracker
participant Installer as pm install all
participant Runtime as Extension runtime probe

User->>Init: init [prefix/path] [--workspace] [--with-packages]
Init->>Resolver: resolve workspace/tracker target
Resolver-->>Init: target mode + tracker_root
Resolver-->>Init: target mode + tracker_root
Init->>Tracker: create settings/schema/type folders
alt --with-packages
    Init->>Installer: runExtension("all", --project, --pm-path tracker_root)
    Installer->>Tracker: install bundled packages
    Installer->>Runtime: load + activate installed packages
    Runtime-->>Installer: activation status, commands/actions/types, health
    Installer-->>Init: installed_all / failed aliases / verification
end
Init-->>User: result with target + scoped next_steps
Loading

Reviews (5): Last reviewed commit: "fix(packages): preserve failure truth ac..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown

Greptile Summary

This PR hardens pm init target handling and package install verification. The main changes are:

  • Explicit tracker and workspace target contracts for pm init.
  • Scoped init --with-packages installs to the resolved target tracker.
  • Authoritative install failure handling for extension load and activation errors.
  • Compact post-install verification for activation, commands, actions, item types, target root, and blocking health.
  • Updated context evaluation validation, command contracts, docs, tests, changelog, and tracker metadata.

Confidence Score: 5/5

Safe to merge with low risk.

The reviewed paths consistently thread resolved tracker roots into writes, package installs, runtime probes, and follow-up commands. Runtime load and activation failures now produce failed install results and matching diagnostics. No blocking correctness or security issues were identified.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The init package narrow tests completed with 4 test files passed, 152 tests passed, and exit code 0.
  • The CLI init smoke test completed with exit code 0 and produced a target-project listing in the smoke directory.
  • The smoke reproduction script used for the test was saved for future runs.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/cli/commands/init.ts Adds explicit init target resolution contracts, path/workspace guardrails, scoped package installation, and next-step rendering for non-discovery targets.
src/cli/commands/extension.ts Hardens package install runtime probing so activation/load failures drive ok status, diagnostics, command discovery, and post-install verification.
src/cli/register-setup.ts Updates setup command wiring for init workspace targeting and multi-target install exit handling based on per-target ok results.
src/sdk/context-relevance.ts Tightens context relevance scorer/evaluator validation by ignoring unknown weight keys and enforcing finite canonical threshold metrics.
scripts/release/context-eval-gate.mjs Adds corpus threshold validation before running the isolated context evaluation gate.
tests/integration/init-path-guard.integration.spec.ts Adds integration coverage for init path targeting and workspace-root safety behavior.
tests/integration/package-command-discovery.integration.spec.ts Adds integration coverage proving install verification success and non-zero diagnostics on load failure.
tests/unit/commands/init-command.spec.ts Expands init unit coverage for target resolution, guarded reruns, scoped next steps, and package install failure propagation.
tests/unit/extensions/extension-command.spec.ts Expands extension/package unit tests around lifecycle errors, activation diagnostics, install verification, and command discovery.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant Init as pm init
participant Tracker as Resolved tracker root
participant Install as pm install all
participant Loader as Extension loader/activator
participant Output as Result/verification

User->>Init: "init [target|--workspace|--pm-path] [--with-packages]"
Init->>Init: Resolve target contract and guard workspace-root --pm-path
Init->>Tracker: Create dirs/settings/schema/guidance
alt --with-packages
    Init->>Install: runExtension("all", --project, --pm-path tracker)
    loop bundled package alias
        Install->>Tracker: Copy package and update managed state/settings
        Loader-->>Install: activation status, commands, actions, item types, failures
    end
    Install-->>Init: aggregate ok/failed counts and verification payloads
end
Init->>Output: Scoped next steps and concise init result
Output-->>User: ok or non-zero failure with diagnostics
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 Init as pm init
participant Tracker as Resolved tracker root
participant Install as pm install all
participant Loader as Extension loader/activator
participant Output as Result/verification

User->>Init: "init [target|--workspace|--pm-path] [--with-packages]"
Init->>Init: Resolve target contract and guard workspace-root --pm-path
Init->>Tracker: Create dirs/settings/schema/guidance
alt --with-packages
    Init->>Install: runExtension("all", --project, --pm-path tracker)
    loop bundled package alias
        Install->>Tracker: Copy package and update managed state/settings
        Loader-->>Install: activation status, commands, actions, item types, failures
    end
    Install-->>Init: aggregate ok/failed counts and verification payloads
end
Init->>Output: Scoped next steps and concise init result
Output-->>User: ok or non-zero failure with diagnostics
Loading

Reviews (1): Last reviewed commit: "feat(init): harden package verification ..." | Re-trigger Greptile

@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 workspace-local tracker initialization via a new --workspace option for pm init, scopes emitted next-step commands with --pm-path when workspace discovery is unavailable, and adds a post-install verification summary to pm install results. It also ensures non-zero CLI exit codes on installation failures, hardens the public context relevance scorer against unknown override keys, and validates evaluation thresholds as finite numbers. Review feedback recommends safeguarding against potential runtime TypeErrors and serialization issues in src/cli/commands/extension.ts by safely converting failure errors to strings and using optional chaining on activationFailure.error.

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/extension.ts Resolved
Comment thread src/cli/commands/extension.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!

Resolve PR #491 CodeQL alert 16 by exercising multiple dollar characters and using a complete replacement in the regression expectation. Record the security follow-up in pm, close and release the canonical item, and regenerate the package-owned changelog.

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

🤖 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/EXTENSIONS.md`:
- Line 45: Update the documentation sentence near the explicit “--pm-path”
guidance to replace “package dogfood” with the standard wording “package
dogfooding” or “package testing,” without changing the surrounding meaning.

In `@tests/unit/commands/init-command.spec.ts`:
- Around line 119-125: Update the expected-string builder in the
buildInitNextSteps test to escape every dollar sign in replacementSensitivePath,
not just the first; use a global replacement so paths containing multiple "$"
characters remain correctly asserted.
🪄 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: 873eaaed-b441-482c-8153-8f14e60db2f2

📥 Commits

Reviewing files that changed from the base of the PR and between 1bdca53 and 538ee63.

📒 Files selected for processing (57)
  • .agents/pm/epics/pm-mpbb.toon
  • .agents/pm/epics/pm-n7rr.toon
  • .agents/pm/epics/pm-usfg.toon
  • .agents/pm/features/pm-3mna.toon
  • .agents/pm/features/pm-4k6b.toon
  • .agents/pm/features/pm-atfm.toon
  • .agents/pm/features/pm-cbwg.toon
  • .agents/pm/features/pm-oxrw.toon
  • .agents/pm/features/pm-x6jf.toon
  • .agents/pm/features/pm-yjim.toon
  • .agents/pm/features/pm-zwpp.toon
  • .agents/pm/history/pm-3mna.jsonl
  • .agents/pm/history/pm-3wsi.jsonl
  • .agents/pm/history/pm-4k6b.jsonl
  • .agents/pm/history/pm-atfm.jsonl
  • .agents/pm/history/pm-b3e9.jsonl
  • .agents/pm/history/pm-cbwg.jsonl
  • .agents/pm/history/pm-ixoa.jsonl
  • .agents/pm/history/pm-lixy.jsonl
  • .agents/pm/history/pm-m4iu.jsonl
  • .agents/pm/history/pm-mpbb.jsonl
  • .agents/pm/history/pm-n7rr.jsonl
  • .agents/pm/history/pm-oxrw.jsonl
  • .agents/pm/history/pm-qt5d.jsonl
  • .agents/pm/history/pm-usfg.jsonl
  • .agents/pm/history/pm-w89s.jsonl
  • .agents/pm/history/pm-x26a.jsonl
  • .agents/pm/history/pm-x6jf.jsonl
  • .agents/pm/history/pm-yjim.jsonl
  • .agents/pm/history/pm-zwpp.jsonl
  • .agents/pm/issues/pm-3wsi.toon
  • .agents/pm/issues/pm-ixoa.toon
  • .agents/pm/issues/pm-m4iu.toon
  • .agents/pm/issues/pm-qt5d.toon
  • .agents/pm/issues/pm-x26a.toon
  • .agents/pm/stories/pm-w89s.toon
  • .agents/pm/tasks/pm-b3e9.toon
  • .agents/pm/tasks/pm-lixy.toon
  • CHANGELOG.md
  • docs/COMMANDS.md
  • docs/EXTENSIONS.md
  • docs/SDK.md
  • scripts/release/context-eval-gate.mjs
  • src/cli/commands/extension.ts
  • src/cli/commands/init.ts
  • src/cli/register-setup.ts
  • src/sdk/cli-contracts/flag-contracts.ts
  • src/sdk/context-relevance.ts
  • tests/fixtures/contracts/full.json
  • tests/integration/init-path-guard.integration.spec.ts
  • tests/integration/package-command-discovery.integration.spec.ts
  • tests/integration/release-readiness-runtime.spec.ts
  • tests/unit/commands/init-command.spec.ts
  • tests/unit/commands/register-commands.spec.ts
  • tests/unit/extensions/extension-command.spec.ts
  • tests/unit/scripts/release/context-eval-gate.spec.ts
  • tests/unit/sdk/context-relevance.spec.ts

Comment thread docs/EXTENSIONS.md Resolved
@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 44 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 several enhancements to the CLI initialization and package installation workflows. Key changes include adding a --workspace option to pm init to initialize repository-local tracker storage, scoping emitted follow-up commands with --pm-path when workspace discovery is unavailable, and integrating a post-install verification summary into pm install results with proper failure exit codes. Additionally, the context evaluation gate was hardened to validate thresholds and ignore unknown weight keys. The review feedback correctly identifies potential runtime TypeErrors due to unsafe property access on activationFailure.error and entry.result.details, and highlights a potential race condition from mutating global process.env inside an asynchronous function.

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/extension.ts Resolved
Comment thread src/cli/commands/extension.ts Resolved
Comment thread src/cli/commands/extension.ts Resolved
Comment thread src/cli/commands/extension.ts Resolved
Comment thread src/cli/commands/init.ts Resolved
@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai Follow-up on comments 4932637463, 4932639153, and 4932733498: both actionable inline findings were acknowledged. The repeated-dollar regression is fixed and the public wording now says package testing. The repository static-quality gate, not the bot heuristic, verifies the enforced docstring thresholds.

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai Follow-up on summaries 4932667086 and 4932668276: the reproduced multi-target diagnostic loss was valid and is fixed with unit plus real-CLI coverage. The clean second summary was also useful corroboration; the newer inline P1s are being addressed on the next head.

@unbraind

Copy link
Copy Markdown
Owner Author

Codecov report 4932683901 acknowledged: all modified coverable lines were covered. A fresh full exact 100/100/100/100 run is in progress for the additional review fixes.

@unbraind

Copy link
Copy Markdown
Owner Author

Review-body acknowledgments: GitHub Advanced Security found the valid repeated-dollar CodeQL issue and it is fixed. Gemini reviews 4669121846 and 4669140541 were declined because the producer types require normalized string errors; review 4669194939 also identified the valid process-environment concurrency concern, now fixed with FIFO serialization. CodeRabbit review 4669150393 is addressed. Greptile reviews 4669197502 and 4669204068 produced actionable P1 regressions now covered by failing-first tests. Sourcery review 4669103621 was rate-limited and contained no code finding.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown

Thanks for closing the loop. Glad the multi-target diagnostic loss reproduction was actionable — unit + real-CLI coverage is the right level of confidence for that kind of aggregation path. The second summary corroborating the fix is a good signal too.

Understood on the inline P1s moving to the next head. Nothing blocking merge from the findings raised in those two summaries then.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@unbraind Thanks for confirming. Good to hear the repeated-dollar regression is resolved and the wording now consistently reads "package testing." Also noted on the docstring threshold enforcement — makes sense that it's covered by the repository's own static-quality gate rather than being something for me to re-verify. I'll take that into account for future passes on this repo.


✏️ Learnings added
Learnt from: unbraind
URL: https://github.com/unbraind/pm-cli/pull/491

Timestamp: 2026-07-10T07:26:23.934Z
Learning: In the unbraind/pm-cli repository, enforced docstring/documentation thresholds are verified by the repository's own static-quality gate, not by CodeRabbit's review heuristics. Do not flag docstring threshold concerns as unresolved based on the bot's own analysis; defer to the repo's static-quality gate for that verification.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

This was referenced Jul 24, 2026
@unbraind

unbraind commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Tracked in PM: pm-3wsi, pm-b3e9, pm-qt5d, pm-x26a, pm-yjim.

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

Labels

None yet

Projects

None yet

2 participants