Skip to content

SDK evidence traceability and context-integrity primitives - #872

Merged
unbraind merged 5 commits into
mainfrom
feat/sdk-evidence-traceability-integrity
Aug 2, 2026
Merged

unbraind merged 5 commits into
mainfrom
feat/sdk-evidence-traceability-integrity

Conversation

@unbraind

@unbraind unbraind commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Outcome

Ships a cohesive SDK/CLI context-integrity tranche: indexed source-to-item evidence lookup, atomic evidence replacement, truthful no-op and telemetry receipts, reliable linked-test classification, duplicate identity preservation, Windows portability, and transactional history-redaction cache refresh.

This advances the project philosophy that project management = context management by making evidence discoverable and safe to maintain through the same typed primitives across CLI, SDK, PmClient, one-shot actions, and MCP.

Major changes

  • Adds bounded pm files lookup <path...> reverse traceability with cursor-bound SQLite projection, incremental refresh, pagination, strict/source-scan completeness receipts, absolute-path canonicalization, and CLI/SDK/MCP parity.
  • Adds atomic --replace-files and --replace-docs update contracts, including bulk preview, completions, guarded argv vocabulary, rollback behavior, and generated schemas.
  • Makes duplicate linked file/doc additions true no-ops without item or history rewrites.
  • Separates telemetry queue progress from completion with queue_entries_drained, queue_progressed, queue_empty, and completion-correct queue_drained.
  • Classifies narrow linked-test lock acquisition contention as infra_collision while retaining real assertions as assertion_failure.
  • Preserves meaningful suffixes in external issue-code duplicate scoring.
  • Makes workspace/global path regressions portable across Windows, macOS, and Linux.
  • Serializes history-redact with metadata-index refresh and drift-cache invalidation on commit and rollback.
  • Documents the public evidence/integrity contracts and regenerates contracts, SDK surface, and changelog through pm-changelog 2026.8.2.

Canonical PM lineage

Verification

  • Full sandboxed coverage: 418 files / 6,703 tests, exact 100% statements (47,530/47,530), branches (34,246/34,246), functions (9,673/9,673), and lines (46,120/46,120).
  • Strict lint, typecheck, zero-clone duplication, 100% docstring/static quality, package boundary, SDK parity/surface, token-budget, context-intent, compatibility, secret scan, and dependency audit gates pass.
  • Exact-head nightly matrix run 30747290823 passes Windows Node 24, macOS Node 24, and Ubuntu Node 22/24/25.
  • pnpm smoke:npx passes the generated tarball across all 15 packaged modules.
  • Independent unrelated-root npm and Bun consumers installed the tarball, initialized isolated trackers, created work, linked and looked up evidence; npm also proved atomic replacement and repeated-add changed=false.
  • pnpm changelog:pm:check, history verification, and graph audit pass with zero drift and zero active isolates. Existing historical resolution debt remains unchanged at 295 items.

Release boundary

The immutable automatic release v2026.8.2 already exists for 2026-08-02, so this PR must not create or move a second same-day auto release. The merged changes are eligible for the next daily auto release; packed npm/Bun consumer acceptance supplies pre-publication proof.

Closes #779
Closes #861
Closes #865
Closes #866
Closes #867
Closes #868
Closes #870
Closes #871

Summary by Sourcery

Introduce reverse source-to-item evidence lookup, atomic linked-file/doc replacement, and more precise telemetry, test, and similarity governance across CLI, SDK, PmClient, one-shot actions, and MCP.

New Features:

  • Add bounded pm files lookup for reverse linked-file traceability with pagination, index-backed reads, and source-scan completeness receipts.
  • Expose files lookup as a first-class SDK primitive, in PmClient, one-shot helpers, MCP actions, and CLI subcommands with guarded contracts and shell completions.
  • Extend update and update-many to support atomic replacement of linked files and docs alongside existing dependency and test replacement semantics.
  • Publish an SDK evidence traceability and integrity guide documenting reverse lookup, atomic replacement, no-op behavior, telemetry receipts, and similarity contracts.

Bug Fixes:

  • Ensure history-redact rewrites refresh item metadata and history drift projections atomically, invalidating drift caches on both success and rollback.
  • Treat repeated linked file/doc additions as true no-ops that report changed=false and avoid emitting phantom history entries.
  • Classify linked-test lock acquisition contention as infrastructure collisions while preserving genuine assertion failures as assertion_failure.
  • Preserve letter-suffixed external issue codes (for example BD-30-A vs BD-30-B) in duplicate similarity scoring to avoid collapsing sibling work.
  • Correct telemetry flush receipts so queue_drained only reports full drain, with explicit fields for entries drained, progress, and queue emptiness.
  • Harden workspace path assertions and snapshot expectations to behave consistently on Windows, macOS, and Linux.
  • Prevent corrupt or stale metadata-query indexes from serving reverse lookup results by falling back to authoritative source reads when needed.

Enhancements:

  • Extend the item metadata derived index and SQLite projection to store linked-file records separately for efficient reverse traceability queries.
  • Tighten linked-artifact mutation semantics so change detection respects stable value equality and skips item writes for true no-op updates.
  • Relax MCP and tool schema contracts for files so actions can target either an item id or reverse lookup paths with clear parameter metadata.
  • Improve CLI flag contracts, option normalization, and shell completions to cover new files lookup and replace-files/replace-docs capabilities.
  • Adjust test failure classification patterns to recognize compound lock-contention messages without over-matching generic lock-related assertions.

Documentation:

  • Add SDK Evidence Traceability and Integrity documentation and link it from the main README and docs index.
  • Update the changelog with fixes and contracts for history-redact projection integrity, Windows portability, suffixed issue-code identity, linked-test classification, telemetry receipts, linked evidence no-op behavior, and atomic replacement.

Tests:

  • Introduce comprehensive context-management SDK primitive tests covering files lookup across transports, atomic evidence replacement, no-op behavior, index-backed reverse queries, telemetry flush receipts, and lock-collision classification.
  • Extend existing validation, similarity, runtime, and action-schema parity tests to cover new index refresh behavior, issue-code patterns, files lookup contracts, and Windows-safe path expectations.
  • Add TypeScript surface tests to guarantee availability of filesLookup, runFilesLookup, and telemetry flush receipt types from the public SDK entrypoint.

Chores:

  • Bump the metadata-query-index schema version and adjust caching thresholds and manifest handling to support the new linked-file projection.

Summary by cubic

Adds reverse source-to-item lookup and hardens evidence integrity across the SDK and CLI. Enables atomic evidence updates, precise telemetry receipts, and consistent indexing/history across platforms.

  • New Features

    • pm files lookup <path...>: indexed reverse traceability with pagination, strict/source-scan receipts, scope validation, authoritative index joins with source-read fallback, and absolute-path canonicalization; available via CLI, filesLookup, runFilesLookup, and PmClient.filesLookup.
    • Atomic replacement for linked files/docs with --replace-files and --replace-docs; duplicate adds are true no-ops and do not write history or migration receipts.
    • Updated schemas, flags, and shell completions; new docs at docs/SDK_EVIDENCE_TRACEABILITY.md.
  • Bug Fixes

    • Telemetry flush now reports queue_entries_drained, queue_progressed, and queue_empty; queue_drained is true only when empty; exposes TelemetryStatusSummary and TelemetryFlushResult.
    • Linked-test lock acquisition contention classified as infra_collision (not assertion_failure).
    • Preserves letter-suffixed issue codes (e.g., BD-30-A) in similarity scoring.
    • Windows portability: native path assertions and absolute-path lookup canonicalization.
    • history-redact refreshes the derived metadata index and invalidates drift cache atomically on commit/rollback, and preserves error precedence.

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

Review in cubic

Deliver indexed CLI/SDK/MCP reverse file lookup, atomic files/docs replacement, idempotent linked evidence, precise telemetry drain receipts, lock-collision diagnostics, issue-code suffix identity, Windows path portability, and atomic history-redaction projection refresh.\n\nAdd generated contracts and public surface snapshots, agent-focused documentation, latest pm-changelog provenance, PM lineage, isolated packed npm/Bun acceptance, and regression coverage preserving the repository-wide 100/100/100/100 gate.
Resolve workspace and requested absolute paths through filesystem identity before deriving project-relative lookup keys. This closes the Windows drive alias/casing gap discovered by the hosted nightly while preserving source-scan and indexed lookup semantics.\n\nRecord the failed hosted evidence and corrected full 100% verification on the canonical traceability and portability PM items.
Build the global linked-file fixture from os.tmpdir() so the SDK lookup contract receives an absolute external path on Windows, macOS, and Linux. The previous /tmp literal was relative on Windows and invalidated the portability assertion.
Record exact-head cross-platform evidence, close and release seven completed issue items, return the broader line-level traceability feature to open, and regenerate CHANGELOG.md with pm-changelog 2026.8.2.\n\nThe tracker now has zero in-progress items, zero history drift, no active graph isolates, and preserves the existing 295-item historical resolution-debt baseline.
@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.

@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

@sourcery-ai

sourcery-ai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds reverse linked-file lookup, atomic evidence replacement, and stricter integrity/telemetry primitives across CLI, SDK, MCP, and metadata indexing, plus documentation and tests for the new context-integrity contracts.

Sequence diagram for reverse files lookup runtime

sequenceDiagram
  actor User
  participant CliFilesLookup as pm_files_lookup_command
  participant SdkFiles as runFilesLookup
  participant Index as queryLinkedFileMetadataIndex
  participant Store as listAllItemMetadata

  User->>CliFilesLookup: pm files lookup <paths...>
  CliFilesLookup->>SdkFiles: runFilesLookup(options, global)
  SdkFiles->>SdkFiles: normalizeFilesLookupPaths(paths, workspaceRoot)
  SdkFiles->>SdkFiles: resolveItemTypeRegistry(settings, getActiveExtensionRegistrations)
  SdkFiles->>SdkFiles: resolveFilesLookupWindow(options)
  SdkFiles->>Index: queryFilesLookupIndex(pmRoot, type_to_folder, paths, scope, limit, offset, strictRead, noTruncate)
  alt indexed result available
    Index-->>SdkFiles: LinkedFileMetadataIndexResult
    SdkFiles-->>CliFilesLookup: FilesLookupResult { source:index, completeness.status:unchecked }
  else index missing_or_unusable
    SdkFiles->>Store: listAllItemMetadata(pmRoot, item_format, type_to_folder, warnings, schema)
    Store-->>SdkFiles: ItemMetadata[]
    SdkFiles->>SdkFiles: queryFilesLookupSource(pmRoot, settings, type_to_folder, paths, scope, limit, offset, strictRead)
    SdkFiles-->>CliFilesLookup: FilesLookupResult { source:source_scan, completeness.status:complete|partial }
  end
  CliFilesLookup-->>User: FilesLookupResult (paths, total, matches, has_more, truncated)
Loading

Sequence diagram for history-redact with derived index refresh

sequenceDiagram
  actor User
  participant CliHistoryRedact as runHistoryRedact
  participant HistoryRewrite as executeHistoryRewrite
  participant IndexLock as acquireItemMetadataDerivedIndexLock
  participant DriftCache as invalidateHistoryDriftCacheForPath
  participant MetadataIndex as refreshItemMetadataDerivedIndex
  participant Fs as writeFileAtomic

  User->>CliHistoryRedact: pm history redact <id> ...
  CliHistoryRedact->>HistoryRewrite: executeHistoryRewrite({ applyRewrite, applyPostRewrite })
  HistoryRewrite->>IndexLock: acquireItemMetadataDerivedIndexLock(pmRoot, author)
  IndexLock-->>HistoryRewrite: releaseDerivedIndexLock
  HistoryRewrite->>Fs: writeFileAtomic(nextItem.path, nextItem.raw)
  HistoryRewrite->>Fs: fs.rm(currentItem.path)
  HistoryRewrite->>Fs: writeFileAtomic(subject.historyPath, historyEntriesToRaw(rewrittenEntries))
  alt write failure
    HistoryRewrite->>Fs: rollbackHistoryRedactRewrite(subject.historyPath, historyRawUnderLock, affectedItemPaths, itemSnapshots)
    HistoryRewrite->>DriftCache: invalidateHistoryDriftCacheForPath(subject.historyPath)
    HistoryRewrite-->>CliHistoryRedact: error
  else write success
    HistoryRewrite->>DriftCache: invalidateHistoryDriftCacheForPath(subject.historyPath)
    HistoryRewrite->>MetadataIndex: refreshItemMetadataDerivedIndex({... itemPath, previousItemPath, document })
    MetadataIndex-->>HistoryRewrite: derivedIndexWarnings[]
    HistoryRewrite->>IndexLock: releaseDerivedIndexLock()
    HistoryRewrite-->>CliHistoryRedact: rewrittenEntries + derivedIndexWarnings
  end
  CliHistoryRedact-->>User: history-redact result with projection in sync
Loading

File-Level Changes

Change Details Files
Introduce reverse linked-file lookup across CLI, SDK, MCP, and metadata index, with bounded pagination and completeness receipts.
  • Add FilesLookup* types and runFilesLookup implementation in sdk/files.ts using either the SQLite metadata index or authoritative source scans.
  • Extend item-metadata query index schema with item_linked_files table and queryLinkedFileMetadataIndex API for reverse traceability queries.
  • Wire files lookup through PmClient, one-shot SDK helpers, MCP action handlers, CLI command registration, flag/tool contracts, and shell completions.
  • Normalize and validate lookup paths, offsets, and limits, supporting project/global scopes, pagination, strict-read mode, and no-truncate output semantics.
src/sdk/files.ts
src/core/store/item-metadata-query-index.ts
src/core/store/item-metadata-cache.ts
src/sdk/item-metadata-index.ts
src/sdk/runtime.ts
src/cli/register-files-lookup.ts
src/sdk/cli-contracts/tool-parameter-tables.ts
src/sdk/cli-contracts/tool-schema.ts
src/sdk/cli-contracts/action-schema-parity.spec.ts
src/sdk/cli-contracts/flag-contracts.ts
src/sdk/cli-contracts/completeness.ts
src/cli/register-mutation.ts
src/sdk/completion.ts
tests/unit/sdk/context-management-primitives.spec.ts
tests/types/sdk-evidence-traceability.test-d.ts
Add atomic replace-files/replace-docs semantics to update commands and ensure true no-op behavior for duplicate linked evidence mutations.
  • Extend UpdateCommandOptions, normalization helpers, ownership-bypass enforcement, and flag contracts to support replaceFiles and replaceDocs.
  • Validate that replace-files/docs require corresponding values and cannot be combined with clear-files/docs; treat replacement as a distinct path in applyClearCollectionDefinitions.
  • Propagate replacement semantics into update-many planning definitions and legacy-none token handling, and ensure applyUniqueLinkedCollectionMutation overwrites collections when replace=true.
  • Change runLinkedArtifacts to skip no-op mutations via skipNoop and stableValueEquals, so repeated adds do not rewrite items or history and changed=false is reported.
src/sdk/lifecycle/update.ts
src/sdk/lifecycle/update-many.ts
src/sdk/lifecycle/legacy-none-tokens.ts
src/sdk/cli-contracts/registration-helpers.ts
src/sdk/cli-contracts/tool-option-contracts.ts
src/sdk/cli-contracts/flag-contracts.ts
src/cli/register-mutation.ts
src/sdk/linked-artifacts.ts
src/sdk/completion.ts
tests/unit/sdk/context-management-primitives.spec.ts
Tighten history-redact, drift cache, and metadata index coherence so redactions refresh projections transactionally and invalidate drift state on both success and rollback.
  • Wire history-redact to acquire the item-metadata derived-index lock during rewrite, refresh the derived index for affected item paths, and release the lock afterwards.
  • Invalidate history drift cache for the history path on both successful rewrite and rollback paths.
  • Return derived index warnings alongside existing history-redact write-hook warnings to callers.
  • Add test coverage that forces an authoritative source scan, runs history-redact, and asserts drift cache removal and validate command warnings behavior.
src/sdk/history-redact.ts
src/core/history/drift-cache.ts
src/core/store/item-metadata-cache.ts
tests/unit/commands/validate-command.spec.ts
tests/unit/sdk/context-management-primitives.spec.ts
Refine telemetry flush receipts to distinguish partial progress from complete draining and expose typed flush result via SDK.
  • Extend TelemetryStatusSummary with more explicit queue and state attributes, and define TelemetryFlushResult with queue_entries_* fields and a precise completion contract.
  • Update runTelemetryFlush to compute entries drained, whether progress occurred, whether the queue is fully empty, and set queue_drained to mirror queue_empty.
  • Overload runTelemetry so the flush subcommand returns TelemetryFlushResult while other subcommands still return generic records.
  • Expose TelemetryFlushResult and TelemetryStatusSummary types from the public SDK surface and add type-level tests and runtime coverage for partial-drain scenarios.
src/sdk/telemetry.ts
src/sdk/index.ts
tests/unit/sdk/context-management-primitives.spec.ts
tests/types/sdk-evidence-traceability.test-d.ts
Improve linked-test failure classification and external issue-code similarity to preserve meaningful lock contention and suffixed issue identities.
  • Extend linked test execution classification with patterns that treat compound lock-acquisition failures plus contention context as infra_collision, while keeping assertion-based lock messages as assertion_failure.
  • Broaden ISSUE_CODE_PATTERN to treat letter-suffixed codes (e.g., BD-30-A, BD-30-B) as distinct identities, preventing them from clustering as duplicates.
  • Add unit tests for similarity scoring around suffixed issue codes and for lock-acquisition vs assertion failure classification.
  • Wire tracker history/issues artifacts for the new governance features and changelog entries documenting these fixes.
src/sdk/test/execution.ts
src/sdk/similarity-scoring.ts
tests/unit/sdk/similarity.spec.ts
tests/unit/sdk/context-management-primitives.spec.ts
CHANGELOG.md
.agents/pm/issues/pm-2irc1p.toon
.agents/pm/issues/pm-sn3xor.toon
.agents/pm/history/pm-2irc1p.jsonl
.agents/pm/history/pm-sn3xor.jsonl
Strengthen Windows path portability, workspace snapshot expectations, and documentation around evidence traceability primitives.
  • Adjust runtime extended actions test to assert snapshot path using path.join, making expectations portable across Windows/macOS/Linux.
  • Ensure metadata cache and derived index behavior respect DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS and correctly project linkedFiles into the index rows.
  • Add SDK Evidence Traceability documentation and wire it into docs/README and top-level README authoring table.
  • Update sdk/public-surface.json, contracts fixture, and various managed-extension metadata to reflect new surface and contracts.
tests/unit/sdk/runtime-extended-actions.spec.ts
src/core/store/item-metadata-cache.ts
docs/SDK_EVIDENCE_TRACEABILITY.md
README.md
docs/README.md
sdk/public-surface.json
tests/fixtures/contracts/full.json
.agents/pm/history/pm-rusbe4.jsonl
.agents/pm/issues/pm-rusbe4.toon

Assessment against linked issues

Issue Objective Addressed Explanation
#779 Ensure that history drift cache entries are invalidated or refreshed when history streams are repaired or rewritten, so that subsequent validate/health commands do not report stale chain mismatches. ✅
#861 Add a typed SDK/CLI/MCP primitive (e.g., filesLookup) that performs reverse lookup of PM items by one or more workspace-relative or absolute file paths, supporting scope filtering, stable ordering, pagination (limit/offset), noTruncate, strictRead, and returning each matching item identity plus the exact linked-file records. ✅
#861 Back the reverse lookup with the workspace metadata/index layer (a reverse linked-file index) when possible, falling back to authoritative item reads when needed, and keep this index atomically updated/invalidated along mutation paths so query cost scales with requested paths and matches rather than total items. ✅
#861 Expose precise, well-typed SDK and tool contracts for reverse file lookup (no Record<string, unknown>), and add integration/test coverage for project vs workspace/global scopes, path normalization (including ./ and absolute paths), missing paths, duplicate links, unreadable items, and completeness/strictRead behavior. ✅
#865 Classify narrow linked-test lock acquisition contention (e.g., 'could not acquire lock' plus 'already running' or timeout context) as infra_collision instead of assertion_failure. ✅
#865 Add SDK/CLI-level test coverage to ensure the new lock-contention stderr patterns are classified as infra_collision and do not introduce false positives for generic assertions. ✅
#866 Change telemetry flush behavior so that it reports explicit fields for queue_entries_drained, queue_progressed, and queue_empty, and make queue_drained semantically equivalent to the queue being empty instead of just any decrease in queue size. ✅
#866 Update the public SDK/CLI contracts and documentation to expose and explain the new telemetry flush receipt fields and the corrected meaning of queue_drained. ✅
#867 Ensure that re-adding an already-linked file/doc (same normalized path and scope) that deduplicates back to the existing collection reports changed: false instead of changed: true. ✅
#867 Avoid creating any no-op history or item file mutation when a linked file/doc add operation is a true no-op after deduplication. ✅
#867 Introduce explicit atomic replacement controls for linked files/docs (e.g., flags to upsert/replace entries including notes) instead of treating a duplicate add as an implicit change. ✅
#868 Implement atomic replacement support for linked files and docs in pm update and update-many, analogous to replace-tests/replace-deps, so that evidence can be replaced in one mutation instead of clear+add. ✅
#868 Expose replace-files and replace-docs through the public CLI, SDK, MCP/tool contracts, and shell completions so that callers can reliably use the new atomic evidence replacement mode. ✅
#868 Add tests and documentation verifying atomic linked-file/doc replacement behavior, including history/rollback or no-op integrity for repeated additions. ✅
#870 Fix the underlying cause of the Windows-latest / Node 24 nightly validation failure (portability / runtime issues) so that validation can succeed on that platform. ✅
#870 Ensure the Windows-latest / Node 24 nightly validation matrix job now passes and is covered by appropriate tests or portability safeguards. ✅
#871 Adjust issue-code similarity scoring so that complete issue codes, including letter/task suffixes (e.g., BD-30-A vs BD-30-B), are only treated as near-certain duplicates when the full code matches exactly, preventing letter-suffixed sibling work items from being scored as 0.99 issue_code duplicates or clustered together. ✅
#871 Add tests/fixtures covering letter-suffixed sibling work items to ensure that pm duplicates no longer clusters distinct suffixed issues (e.g., BD-30-A/B/C/D) as duplicates and to guard against regressions in issue-code similarity behavior. ✅

Possibly linked issues

  • #pm-f86lth: They both define and implement the indexed reverse linked-file lookup primitive (files lookup) with SDK/CLI/MCP parity.

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

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 52 minutes

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

How can I continue?

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

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

How do review limits work?

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

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

Please refer docs for additional details.

Review details
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9848d9aa-889c-4113-86c9-ede71f52d59c

📥 Commits

Reviewing files that changed from the base of the PR and between c557226 and baee50a.

📒 Files selected for processing (55)
  • .agents/pm/extensions/.managed-extensions.json
  • .agents/pm/features/pm-f86lth.toon
  • .agents/pm/history/pm-2irc1p.jsonl
  • .agents/pm/history/pm-cstuys.jsonl
  • .agents/pm/history/pm-f86lth.jsonl
  • .agents/pm/history/pm-jb1ron.jsonl
  • .agents/pm/history/pm-rusbe4.jsonl
  • .agents/pm/history/pm-sn3xor.jsonl
  • .agents/pm/history/pm-u5c27w.jsonl
  • .agents/pm/history/pm-wnbk2l.jsonl
  • .agents/pm/issues/pm-2irc1p.toon
  • .agents/pm/issues/pm-cstuys.toon
  • .agents/pm/issues/pm-jb1ron.toon
  • .agents/pm/issues/pm-rusbe4.toon
  • .agents/pm/issues/pm-sn3xor.toon
  • .agents/pm/issues/pm-u5c27w.toon
  • .agents/pm/issues/pm-wnbk2l.toon
  • CHANGELOG.md
  • README.md
  • docs/README.md
  • docs/SDK_EVIDENCE_TRACEABILITY.md
  • scripts/agent-token-surface-baseline.json
  • sdk/public-surface.json
  • src/cli/register-files-lookup.ts
  • src/cli/register-mutation.ts
  • src/core/store/item-metadata-cache.ts
  • src/core/store/item-metadata-query-index.ts
  • src/sdk/cli-contracts/completeness.ts
  • src/sdk/cli-contracts/flag-contracts.ts
  • src/sdk/cli-contracts/registration-helpers.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/completion.ts
  • src/sdk/files.ts
  • src/sdk/history-redact.ts
  • src/sdk/index.ts
  • src/sdk/item-metadata-index.ts
  • src/sdk/lifecycle/legacy-none-tokens.ts
  • src/sdk/lifecycle/update-many.ts
  • src/sdk/lifecycle/update.ts
  • src/sdk/linked-artifacts.ts
  • src/sdk/runtime.ts
  • src/sdk/similarity-scoring.ts
  • src/sdk/telemetry.ts
  • src/sdk/test/execution.ts
  • tests/fixtures/contracts/full.json
  • tests/types/sdk-evidence-traceability.test-d.ts
  • tests/unit/commands/files-docs-command.spec.ts
  • tests/unit/commands/history-activity-command.spec.ts
  • tests/unit/commands/validate-command.spec.ts
  • tests/unit/sdk/action-schema-parity.spec.ts
  • tests/unit/sdk/context-management-primitives.spec.ts
  • tests/unit/sdk/runtime-extended-actions.spec.ts
  • tests/unit/sdk/similarity.spec.ts
📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added reverse linked-file lookup across CLI, SDK, client, and MCP, with filtering, pagination, completeness details, and strict-read controls.
    • Added atomic replacement options for linked files and documents.
    • Added typed telemetry flush receipts and expanded shell completions.
  • Bug Fixes
    • Improved history redaction, telemetry queue reporting, duplicate detection, Windows path handling, lock classification, and no-op mutation reporting.
  • Documentation
    • Added SDK evidence traceability documentation and updated documentation maps.

Walkthrough

This PR adds indexed reverse linked-file lookup across the CLI, SDK, MCP, and metadata index. It also adds atomic file/document replacement, no-op mutation handling, history-redaction cache coordination, typed telemetry receipts, issue-classification fixes, public contracts, tests, documentation, and PM records.

Changes

SDK reverse lookup

Layer / File(s) Summary
Indexed lookup and storage
src/core/store/..., src/sdk/files.ts
The metadata index stores linked-file projections. runFilesLookup supports normalization, scope, pagination, strict reads, index queries, and authoritative fallback.
CLI, MCP, and SDK wiring
src/cli/..., src/sdk/runtime.ts, src/sdk/index.ts
The files lookup command, PmClient.filesLookup, standalone SDK calls, and MCP handlers invoke reverse lookup.
Contracts and validation
src/sdk/cli-contracts/..., tests/fixtures/contracts/full.json, tests/unit/sdk/context-management-primitives.spec.ts
CLI schemas, flags, completions, public exports, and integration tests cover the new operation.

Mutation and integrity fixes

Layer / File(s) Summary
Atomic replacement and no-op mutations
src/sdk/lifecycle/..., src/sdk/linked-artifacts.ts, src/cli/register-mutation.ts
Updates support atomic file/document replacement. Duplicate additions report no change and avoid no-op history mutations.
History redaction coordination
src/sdk/history-redact.ts, tests/unit/commands/*
History rewrites acquire the derived-index lock, invalidate drift caches, refresh the metadata index, and preserve rollback handling.

Typed results and classification

Layer / File(s) Summary
Telemetry flush contracts
src/sdk/telemetry.ts, src/sdk/index.ts, sdk/public-surface.json
Flush results expose drained counts, progress, empty-state, status, and timestamps through typed overloads.
Test and duplicate classification
src/sdk/test/execution.ts, src/sdk/similarity-scoring.ts, tests/unit/sdk/...
Lock contention is classified as infra_collision, and complete letter-suffixed issue codes remain distinct in duplicate scoring.

Documentation and release records

Layer / File(s) Summary
Contracts and documentation
docs/SDK_EVIDENCE_TRACEABILITY.md, README.md, docs/README.md, CHANGELOG.md
The documentation map and evidence-traceability document cover lookup, mutation, history, telemetry, classification, and similarity behavior.
PM and release metadata
.agents/pm/..., .managed-extensions.json, scripts/agent-token-surface-baseline.json
Issue histories, feature records, verification evidence, token-surface measurements, and managed extension metadata were updated.

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

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant PmClient
  participant runFilesLookup
  participant MetadataIndex
  participant AuthoritativeMetadata
  Client->>PmClient: filesLookup(options)
  PmClient->>runFilesLookup: dispatch lookup request
  runFilesLookup->>MetadataIndex: query indexed linked files
  MetadataIndex-->>runFilesLookup: matches or unavailable result
  runFilesLookup->>AuthoritativeMetadata: scan when index is stale, strict, or unsuitable
  AuthoritativeMetadata-->>runFilesLookup: matching items and completeness
  runFilesLookup-->>PmClient: FilesLookupResult
  PmClient-->>Client: return lookup result
Loading

Possibly related PRs

  • unbraind/pm-cli#783: Both changes coordinate history redaction with drift-cache and metadata-index updates.
  • unbraind/pm-cli#543: Both changes extend src/sdk/files.ts with linked-file operations.
  • unbraind/pm-cli#117: Both changes modify telemetry result and command contract surfaces.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.78% 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 changes address the linked issues for reverse lookup, cache refresh, replacement, no-op behavior, telemetry, classification, portability, and duplicate scoring.
Out of Scope Changes check ✅ Passed The code, tests, documentation, generated contracts, and changelog changes support the linked objectives and show no unrelated scope.
Title check ✅ Passed The title clearly summarizes the main SDK and CLI context-integrity changes for evidence traceability.
Description check ✅ Passed The description directly documents the implemented evidence traceability, integrity, portability, testing, and release changes.
✨ 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.

@unbraind

unbraind commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@greptileai please review this exact head.

@unbraind

unbraind commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
✅ 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.

@codspeed

codspeed Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 11 untouched benchmarks


Comparing feat/sdk-evidence-traceability-integrity (baee50a) with main (c557226)

Open in CodSpeed

@codecov

codecov Bot commented Aug 2, 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: 9

Caution

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

⚠️ Outside diff range comments (2)
src/sdk/lifecycle/update.ts (1)

1531-1603: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Route --replace-tests through the new shared validator.

validateLinkedArtifactReplacement now covers --replace-files and --replace-docs. The inline block at lines 1573-1587 for --replace-tests performs exactly the same two checks with the same message templates. Call the helper there as well. --replace-deps cannot use it, because it pairs with --dep-remove instead of a clear flag.

This keeps the four replacement flags on one validation path and prevents the messages from diverging.

♻️ Proposed refactor
-  if (
-    options.replaceTests === true &&
-    (options.test === undefined || options.test.length === 0)
-  ) {
-    throw new PmCliError(
-      "--replace-tests requires at least one --test entry",
-      EXIT_CODE.USAGE,
-    );
-  }
-  if (options.replaceTests === true && options.clearTests === true) {
-    throw new PmCliError(
-      "--replace-tests cannot be combined with --clear-tests",
-      EXIT_CODE.USAGE,
-    );
-  }
+  validateLinkedArtifactReplacement({
+    enabled: options.replaceTests === true,
+    values: options.test,
+    replaceFlag: "--replace-tests",
+    clearEnabled: options.clearTests === true,
+    clearFlag: "--clear-tests",
+    valueFlag: "--test",
+  });
   validateLinkedArtifactReplacement({
     enabled: options.replaceFiles === true,
🤖 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/sdk/lifecycle/update.ts` around lines 1531 - 1603, Update
validateReplaceOptions to remove the inline --replace-tests validation and route
it through validateLinkedArtifactReplacement, passing the test values and the
corresponding replace, clear, and value flags. Leave the --replace-deps checks
unchanged because they use --dep-remove rather than a clear flag.
src/sdk/linked-artifacts.ts (1)

685-716: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Ensure migration counts do not produce a positive migrations_applied when changed stays false.

applyLinkedArtifactMigrations counts any successful path rewrite in next, but mergeLinkedArtifactChanges and dedupe can still leave the linked-artifact metadata equivalent to the original current snapshot. Since result.changed is derived only from changedFields.includes(metadataKey), use a delta-aware migration counter or include migration warnings only when the final metadata differs.

🤖 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/sdk/linked-artifacts.ts` around lines 685 - 716, Update the warning
construction in the mutate handler around applyLinkedArtifactMigrations and
mergeLinkedArtifactChanges so migrations_applied is emitted only when the final
normalized metadata differs from current and changedFields includes metadataKey.
Preserve the existing migration count for genuinely changed metadata, but
suppress the warning when deduplication or merging leaves the document
unchanged.
🤖 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 `@CHANGELOG.md`:
- Around line 5-13: Add an Unreleased Added changelog section before the
existing Fixed section, documenting GH-861 and the public reverse linked-file
lookup capability exposed through pm files lookup, the SDK, and MCP. Preserve
all existing Fixed entries unchanged.

In `@src/cli/register-files-lookup.ts`:
- Around line 25-46: Update runFilesLookupAction to validate options.scope
before constructing the runFilesLookup request: accept only "project", "global",
or undefined, and throw PmCliError for any other value instead of passing
undefined. Preserve the existing valid-scope behavior and ensure invalid values
prevent the lookup from running.

In `@src/core/store/item-metadata-query-index.ts`:
- Around line 596-599: Update the loop over itemRows in the item metadata query
to use the selected items.id value as the key for filesByItem, rather than
item.id from parsed metadata_json; preserve the parsed metadata for the returned
item. Adjust the existing context-management test expectation to verify files
are joined using the authoritative row ID.

In `@src/sdk/history-redact.ts`:
- Around line 692-694: Update the finally block surrounding the rewrite/rollback
flow to guard the await of releaseDerivedIndexLock so a release rejection cannot
replace the original rewrite error; preserve the existing rethrow behavior for
the write failure while handling any lock-release failure without propagating it
from finally.

In `@src/sdk/lifecycle/update.ts`:
- Around line 2355-2364: Update the metadata handling around the replace branch
so empty linked-artifact replacements from replaceFiles/replaceDocs are deleted
rather than assigned undefined. Account for parseFiles results with values
undefined and explicitEmpty false, while preserving normal replacement
assignment and existing clear-item behavior.

In `@src/sdk/test/execution.ts`:
- Around line 105-108: Update hasInfraCollisionSignal to evaluate
LINKED_TEST_LOCK_ACQUISITION_PATTERN and
LINKED_TEST_LOCK_CONTENTION_CONTEXT_PATTERN against each individual line of the
combined failure output, returning true only when both match the same line;
preserve the existing false result when no single line contains both signals.

In `@tests/unit/commands/validate-command.spec.ts`:
- Line 2437: Update the test setup’s resolveItemTypeRegistry call to pass
getActiveExtensionRegistrations() as its second argument, matching runValidate’s
registry construction and ensuring the cache uses the same active extension item
types and folder mapping.
- Around line 2466-2471: Update the test around applyHistoryRedactRewrite to
positively read history-drift-cache.json and verify it exists before invoking
redaction, then retain the existing ENOENT assertion afterward to verify
removal. Ensure the test fails if cache creation or invalidation is omitted.

In `@tests/unit/sdk/context-management-primitives.spec.ts`:
- Around line 272-280: Validate the --scope option in registerFilesLookupCommand
before invoking runFilesLookupAction, accepting only project and global values
and rejecting unsupported values with EXIT_CODE.USAGE. Update the affected
assertions for unsupported, global, and related invalid-scope cases to expect
the validation rejection rather than unfiltered lookup results.

---

Outside diff comments:
In `@src/sdk/lifecycle/update.ts`:
- Around line 1531-1603: Update validateReplaceOptions to remove the inline
--replace-tests validation and route it through
validateLinkedArtifactReplacement, passing the test values and the corresponding
replace, clear, and value flags. Leave the --replace-deps checks unchanged
because they use --dep-remove rather than a clear flag.

In `@src/sdk/linked-artifacts.ts`:
- Around line 685-716: Update the warning construction in the mutate handler
around applyLinkedArtifactMigrations and mergeLinkedArtifactChanges so
migrations_applied is emitted only when the final normalized metadata differs
from current and changedFields includes metadataKey. Preserve the existing
migration count for genuinely changed metadata, but suppress the warning when
deduplication or merging leaves the document unchanged.
🪄 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: 2c545309-44c1-4e5f-9605-3169672f2bc6

📥 Commits

Reviewing files that changed from the base of the PR and between c557226 and ca7ed8a.

📒 Files selected for processing (52)
  • .agents/pm/extensions/.managed-extensions.json
  • .agents/pm/features/pm-f86lth.toon
  • .agents/pm/history/pm-2irc1p.jsonl
  • .agents/pm/history/pm-cstuys.jsonl
  • .agents/pm/history/pm-f86lth.jsonl
  • .agents/pm/history/pm-jb1ron.jsonl
  • .agents/pm/history/pm-rusbe4.jsonl
  • .agents/pm/history/pm-sn3xor.jsonl
  • .agents/pm/history/pm-u5c27w.jsonl
  • .agents/pm/history/pm-wnbk2l.jsonl
  • .agents/pm/issues/pm-2irc1p.toon
  • .agents/pm/issues/pm-cstuys.toon
  • .agents/pm/issues/pm-jb1ron.toon
  • .agents/pm/issues/pm-rusbe4.toon
  • .agents/pm/issues/pm-sn3xor.toon
  • .agents/pm/issues/pm-u5c27w.toon
  • .agents/pm/issues/pm-wnbk2l.toon
  • CHANGELOG.md
  • README.md
  • docs/README.md
  • docs/SDK_EVIDENCE_TRACEABILITY.md
  • sdk/public-surface.json
  • src/cli/register-files-lookup.ts
  • src/cli/register-mutation.ts
  • src/core/store/item-metadata-cache.ts
  • src/core/store/item-metadata-query-index.ts
  • src/sdk/cli-contracts/completeness.ts
  • src/sdk/cli-contracts/flag-contracts.ts
  • src/sdk/cli-contracts/registration-helpers.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/completion.ts
  • src/sdk/files.ts
  • src/sdk/history-redact.ts
  • src/sdk/index.ts
  • src/sdk/item-metadata-index.ts
  • src/sdk/lifecycle/legacy-none-tokens.ts
  • src/sdk/lifecycle/update-many.ts
  • src/sdk/lifecycle/update.ts
  • src/sdk/linked-artifacts.ts
  • src/sdk/runtime.ts
  • src/sdk/similarity-scoring.ts
  • src/sdk/telemetry.ts
  • src/sdk/test/execution.ts
  • tests/fixtures/contracts/full.json
  • tests/types/sdk-evidence-traceability.test-d.ts
  • tests/unit/commands/validate-command.spec.ts
  • tests/unit/sdk/action-schema-parity.spec.ts
  • tests/unit/sdk/context-management-primitives.spec.ts
  • tests/unit/sdk/runtime-extended-actions.spec.ts
  • tests/unit/sdk/similarity.spec.ts

Comment thread CHANGELOG.md Resolved
Comment thread src/cli/register-files-lookup.ts Resolved
Comment thread src/sdk/history-redact.ts Resolved
Comment thread src/sdk/lifecycle/update.ts Resolved
Comment thread src/sdk/test/execution.ts Resolved
Validate reverse lookup scope, preserve authoritative index joins, constrain lock-contention classification, keep history-redact error precedence, and suppress no-op migration receipts. Reuse shared replacement validation, add regression coverage, regenerate package-owned changelog ordering, and calibrate measured agent token budgets for the expanded SDK/CLI/MCP surfaces.

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

Caution

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

⚠️ Outside diff range comments (2)
src/sdk/history-redact.ts (1)

626-629: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Require the derived-index lock for history redaction.

acquireItemMetadataDerivedIndexLock returns a no-op release when the manifest is absent or below the index threshold unless required: true is set. A history redaction can then interleave with an item mutation and lose a derived-index update.

Pass { required: true } to this acquisition.

Proposed fix
       const releaseDerivedIndexLock = await acquireItemMetadataDerivedIndexLock(
         params.pmRoot,
         params.author,
+        { required: true },
       );
🤖 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/sdk/history-redact.ts` around lines 626 - 629, Update the
acquireItemMetadataDerivedIndexLock call in the history redaction flow to pass
the required option, ensuring the derived-index lock is always acquired even
when the manifest is absent or below the index threshold.
.agents/pm/features/pm-f86lth.toon (1)

73-92: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Link CHANGELOG.md to pm-f86lth.

CHANGELOG.md is modified in this PR, but docs[] only includes docs/README.md, docs/SDK_EVIDENCE_TRACEABILITY.md, and root README.md. Add the changelog through the PM CLI as a project-owned generated document; do not edit .agents/pm 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/features/pm-f86lth.toon around lines 73 - 92, Update the PM
feature metadata for pm-f86lth to include CHANGELOG.md in the project-owned
generated docs/files collection. Register it through the PM CLI so the generated
.agents/pm content is refreshed, without editing .agents/pm directly; preserve
the existing documentation entries.

Source: Coding guidelines

🤖 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.

Outside diff comments:
In @.agents/pm/features/pm-f86lth.toon:
- Around line 73-92: Update the PM feature metadata for pm-f86lth to include
CHANGELOG.md in the project-owned generated docs/files collection. Register it
through the PM CLI so the generated .agents/pm content is refreshed, without
editing .agents/pm directly; preserve the existing documentation entries.

In `@src/sdk/history-redact.ts`:
- Around line 626-629: Update the acquireItemMetadataDerivedIndexLock call in
the history redaction flow to pass the required option, ensuring the
derived-index lock is always acquired even when the manifest is absent or below
the index threshold.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7ad6495c-2314-464b-b4c6-bd1350e379b6

📥 Commits

Reviewing files that changed from the base of the PR and between ca7ed8a and baee50a.

📒 Files selected for processing (22)
  • .agents/pm/features/pm-f86lth.toon
  • .agents/pm/history/pm-2irc1p.jsonl
  • .agents/pm/history/pm-cstuys.jsonl
  • .agents/pm/history/pm-f86lth.jsonl
  • .agents/pm/history/pm-jb1ron.jsonl
  • .agents/pm/history/pm-wnbk2l.jsonl
  • .agents/pm/issues/pm-2irc1p.toon
  • .agents/pm/issues/pm-cstuys.toon
  • .agents/pm/issues/pm-jb1ron.toon
  • .agents/pm/issues/pm-wnbk2l.toon
  • CHANGELOG.md
  • scripts/agent-token-surface-baseline.json
  • src/cli/register-files-lookup.ts
  • src/core/store/item-metadata-query-index.ts
  • src/sdk/history-redact.ts
  • src/sdk/lifecycle/update.ts
  • src/sdk/linked-artifacts.ts
  • src/sdk/test/execution.ts
  • tests/unit/commands/files-docs-command.spec.ts
  • tests/unit/commands/history-activity-command.spec.ts
  • tests/unit/commands/validate-command.spec.ts
  • tests/unit/sdk/context-management-primitives.spec.ts

@unbraind

unbraind commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

First review-loop disposition at exact head baee50a:

  • Gemini: sunset notice acknowledged; no actionable code finding.
  • Sourcery: guide acknowledged; quota-limited review could not produce findings.
  • CodeRabbit: all nine inline findings were reacted to and answered in their threads. Seven required corrections, two were already fixed on the reviewed head, and the generated-changelog request was declined with package-ownership rationale.
  • CodeRabbit outside-diff findings: replace-tests now shares the replacement validator; no-op path migration receipts are suppressed unless normalized metadata changes.
  • CodSpeed: no performance-impacting benchmark delta reported.
  • Codecov: modified lines remain fully covered.

Verification after corrections: 418 files / 6,704 tests, exact 100/100/100/100 coverage, zero clones, 100% docstrings, static/package/SDK/context gates green, and the measured 96-surface token budget green.

@unbraind

unbraind commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@greptileai please review exact head baee50a.

@coderabbitai full review

@sourcery-ai review exact head baee50a.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

@unbraind: I will perform a full review of the requested PR head baee50ace714ae56412a844346d456c6f150e04d.

✅ 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 52 minutes.

@unbraind

unbraind commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Exact-head review follow-up: all nine CodeRabbit confirmations have been individually acknowledged and their threads remain resolved. The requested second full CodeRabbit pass reported completion but was limited by the repository fair-usage quota; this is recorded as a service limitation, not a code finding. Sourcery completed its exact-head review successfully, and the complete required check suite is green on baee50ace714ae56412a844346d456c6f150e04d.

@unbraind
unbraind merged commit b9d5bae into main Aug 2, 2026
32 checks passed
@unbraind
unbraind deleted the feat/sdk-evidence-traceability-integrity branch August 2, 2026 14:01
@unbraind

unbraind commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

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