SDK reproducible workspaces and context-integrity primitives - #798
Conversation
Deliver versioned deterministic workspace recipes and content-addressed snapshot lifecycle APIs across the public SDK and CLI. Align extension flag preflight with runtime activation, make copied output identities decline safely, disambiguate list --all, and make fresh-clone health semantics truthful. Include full regression coverage, generated changelog, token-surface baselines, and complete PM lineage/evidence for pm-huolbk, pm-wi301j, pm-q7qojt, pm-0k4o8t, pm-83ov2i, pm-rbcvt2, and pm-dkrmzv.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
@greptileai review |
📝 WalkthroughWalkthroughThis PR adds deterministic workspace recipes and content-addressed snapshot/restore APIs with CLI support, standardizes extension flag validation, rejects ambiguous list usage, adjusts health directory requirements, improves output override detection, and updates public surfaces, documentation, tests, and project records. ChangesWorkspace reproducibility and snapshots
Extension contracts
CLI and health contracts
Release records and documentation
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Reviewer's GuideIntroduces deterministic workspace recipes and content-addressed workspace snapshots in the SDK/CLI, tightens extension flag validation/shared diagnostics, deprecates the ambiguous Sequence diagram for workspace snapshot CLI operationssequenceDiagram
actor User
participant CliProgram as pm_cli_program
participant SnapshotCmd as runWorkspaceSnapshotAction
participant SnapshotSDK as createWorkspaceSnapshot
participant SnapshotStore as publishWorkspaceSnapshotObject
User->>CliProgram: pm workspace snapshot create before-migration
CliProgram->>SnapshotCmd: runWorkspaceSnapshotAction("create", "before-migration")
SnapshotCmd->>SnapshotSDK: createWorkspaceSnapshot(pmRoot, { name })
SnapshotSDK->>SnapshotSDK: buildManifest(pmRoot)
SnapshotSDK->>SnapshotStore: publishWorkspaceSnapshotObject(temporaryRoot, objectRoot)
SnapshotStore-->>SnapshotSDK: deduplicated
SnapshotSDK-->>SnapshotCmd: CreateWorkspaceSnapshotResult
SnapshotCmd-->>CliProgram: printResult(result)
CliProgram-->>User: snapshot fingerprint, name, deduplicated
User->>CliProgram: pm workspace snapshot restore before-migration
CliProgram->>SnapshotCmd: runWorkspaceSnapshotAction("restore", "before-migration")
SnapshotCmd->>SnapshotSDK: restoreWorkspaceSnapshot(pmRoot, target)
SnapshotSDK->>SnapshotSDK: inspectWorkspaceSnapshot(pmRoot, target)
SnapshotSDK->>SnapshotSDK: swapWorkspaceSnapshotRoot(staging, pmRoot, backup)
SnapshotSDK-->>SnapshotCmd: WorkspaceSnapshotManifest
SnapshotCmd-->>CliProgram: printResult(manifest)
CliProgram-->>User: restored workspace state
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
✅ Action performedFull 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. |
Merging this PR will degrade performance by 0.32%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | createQueryFingerprint |
522.3 µs | 533.1 µs | -2.02% |
| ⚡ | encodeQueryCursor |
102.9 µs | 101.5 µs | +1.42% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/sdk-reproducible-workspace-integrity (91f6d3b) with main (03fbe18)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummaryPrior Greptile findings on workspace restore rollback and extension blueprint short-flag lint are addressed at HEAD.
Confidence Score: 5/5Safe to merge; previously reported restore-rollback and short-flag lint gaps are fixed and covered by tests. No blocking failure remains. Workspace restore no longer rolls back after a successful activation when backup cleanup fails, and extension blueprint lint now rejects reserved short and short-only host flags consistently with runtime validation.
|
| Filename | Overview |
|---|---|
| src/sdk/workspace-snapshot.ts | Restore swap limits rollback to activation failure; post-activation backup cleanup no longer undoes a live root. |
| src/sdk/compose.ts | Blueprint flag lint routes long and short declarations through the shared token validator, including short-only host collisions. |
| src/core/extensions/flag-definition-validation.ts | Shared host-collision and long-flag shape checks used by both lint preflight and runtime activation. |
| tests/unit/sdk/workspace-snapshot.spec.ts | Proves activation rollback sequence and that injected backup cleanup failure does not reverse a completed swap. |
| tests/unit/sdk/sdk-compose.spec.ts | Proves reserved short-only --path is rejected by blueprint lint alongside other host/malformed cases. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[restoreWorkspaceSnapshot] --> B[stage files + snapshot store]
B --> C[swapWorkspaceSnapshotRoot]
C --> D[rename pmRoot to backup]
D --> E{rename staging to pmRoot}
E -->|fail| F[rename backup to pmRoot]
F --> G[remove staging]
G --> H[throw activation error]
E -->|ok| I[remove backup]
I -->|cleanup fails| J[throw cleanup error keep active root]
I -->|ok| K[restore success]
Reviews (4): Last reviewed commit: "fix(sdk): resolve final workspace integr..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 16
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/pm/history/pm-huolbk.jsonl:
- Line 15: Update the canonical PM item through pm so its metadata.actual_result
records the completed fix rather than the pre-fix failure, then regenerate the
projection at .agents/pm/issues/pm-huolbk.toon lines 21-23. Apply the
corresponding completed result in both .agents/pm/history/pm-huolbk.jsonl lines
15-15 and the regenerated projection, preserving the fixed resolution.
In @.agents/pm/issues/pm-83ov2i.toon:
- Around line 19-21: Update the canonical PM item’s actual_result using the PM
CLI so it reflects the fixed behavior: warn-only fresh-clone health is
non-blocking, with a consistent top-level verdict and exit code while warnings
remain visible. Preserve resolution: fixed and synchronize the derived
projection before closing the item.
In `@sdk/public-surface.json`:
- Around line 10994-10999: Export SNAPSHOT_SCHEMA from the workspace-snapshot
module alongside WorkspaceSnapshotManifest, or provide a public alias, so the
manifest’s schema property references an exported symbol in generated
declarations. Preserve the existing schema value and WorkspaceSnapshotManifest
API.
In `@src/cli/register-operations.ts`:
- Around line 529-536: In the normalizedAction === "create" branch, simplify the
options construction passed to createWorkspaceSnapshot by removing the
unnecessary object spread and passing the ternary result directly. Preserve the
existing behavior of supplying either an empty options object or the target
name.
- Around line 538-568: Validate normalizedAction against the supported
create/list/inspect/restore/delete actions before checking whether target is
undefined. Keep the existing unknown-action PmCliError and its details, then
apply the snapshot-target requirement only to actions that require a target,
preserving create/list behavior.
In `@src/core/reproducibility/context.ts`:
- Around line 67-86: Update nextReproducibleToken to validate length after
confirming executionStorage has a reproducibility context and before the
generation loop. Accept only non-negative safe integers; reject Infinity, NaN,
negative, fractional, and oversized values using the function’s existing
invalid-input behavior rather than generating or hanging.
In `@src/sdk/compose.ts`:
- Around line 66-69: Update the extension flag lint validation around the
existing long-flag checks at lines 1187–1203 to validate both fields, including
definitions with an invalid short token such as “--json”. Reuse
findExtensionFlagTokenFailure(definition?.long, definition?.short) so lint and
runtime validation produce the same blocking finding, while preserving the
existing reporting flow.
In `@src/sdk/workspace-recipe.ts`:
- Around line 33-35: Update defineWorkspaceRecipe to invoke the existing
reproducibility-settings validator before returning the recipe, rejecting empty
seeds, invalid clocks, and negative tickMs values during definition while
preserving the existing Readonly<WorkspaceRecipe> return behavior.
- Around line 33-35: Update defineWorkspaceRecipe to use a const generic
constrained to WorkspaceRecipe and return that same generic type, preserving
literal action, input, and recipe-key types while still validating top-level
keys against WorkspaceRecipe.
- Around line 40-59: Update the workspace recipe validation and normalization
around the operations mapping to recursively accept only JSON-compatible input
values, rejecting undefined, functions, Date instances, and other non-JSON
values. Replace the shallow Object.freeze({ ...operation.input }) handling with
recursive cloning and deep-freezing so nested objects and arrays are detached
from the caller and remain immutable, while preserving the existing action
validation and frozen recipe structure.
In `@src/sdk/workspace-snapshot.ts`:
- Around line 234-249: Extend the existing workspace-snapshot garbage-collection
flow, including the runtime/checkpoints scopes registered in
register-operations.ts, to identify and remove stale temporary .create-* and
.ref-* entries under the workspace-snapshot runtime store. Preserve active or
newly created entries as appropriate, and ensure cleanup covers both temporary
object directories created around temporaryRoot and temporary ref files.
- Around line 182-197: Update swapWorkspaceSnapshotRoot so the try/catch covers
only the activation rename from staging to pmRoot; perform removeEntry(backup)
after that rollback scope. Preserve rollback of backup to pmRoot and staging
cleanup only when activation fails, allowing post-activation backup cleanup
errors to propagate without attempting a second restore.
- Around line 214-220: Update createWorkspaceSnapshot to reject options.name
values matching the 64-character lowercase hexadecimal fingerprint pattern
before creating the snapshot, using the existing validation/error mechanism
around validateSnapshotTarget. Keep other valid snapshot-name rules unchanged so
fingerprint-shaped targets cannot be created as names.
- Around line 199-211: Update resolveSnapshotFingerprint and the
reference-loading path in deleteWorkspaceSnapshot to catch missing
reference-file ENOENT errors and translate them into a clear domain error
identifying the unknown snapshot target; preserve existing behavior for
fingerprints, valid references, and unrelated filesystem or parsing errors.
In `@tests/unit/sdk/workspace-reproducibility.spec.ts`:
- Around line 49-55: Update the test case around runWithWorkspaceRecipe to
exercise two distinct recipes concurrently with Promise.all, yielding within
both callbacks before assertions. Verify each concurrent scope preserves its own
clock and token sequence, while retaining the existing outside-scope checks.
- Around line 57-60: Update the defineWorkspaceRecipe tests around RECIPE to
preserve literal inference: add an unannotated object literal marked with
`@ts-expect-error` that verifies an unsupported schema is rejected at compile
time, and add an unannotated call containing an extra property to verify unknown
keys are rejected. Keep the existing runtime validation assertion and use the
builder’s actual type contract.
🪄 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: bb80ca79-d10d-4a12-bd38-cfe896c2d56e
📒 Files selected for processing (49)
.agents/pm/extensions/.managed-extensions.json.agents/pm/features/pm-dkrmzv.toon.agents/pm/features/pm-rbcvt2.toon.agents/pm/history/pm-0k4o8t.jsonl.agents/pm/history/pm-83ov2i.jsonl.agents/pm/history/pm-bex0ui.jsonl.agents/pm/history/pm-dkrmzv.jsonl.agents/pm/history/pm-huolbk.jsonl.agents/pm/history/pm-q7qojt.jsonl.agents/pm/history/pm-rbcvt2.jsonl.agents/pm/history/pm-wi301j.jsonl.agents/pm/issues/pm-0k4o8t.toon.agents/pm/issues/pm-83ov2i.toon.agents/pm/issues/pm-bex0ui.toon.agents/pm/issues/pm-huolbk.toon.agents/pm/issues/pm-q7qojt.toon.agents/pm/issues/pm-wi301j.toonCHANGELOG.mddocs/README.mddocs/REPRODUCIBLE_WORKSPACES.mddocs/SDK.mdscripts/agent-token-surface-baseline.jsonsdk/public-surface.jsonsrc/cli/register-list-query.tssrc/cli/register-operations.tssrc/cli/registration-helpers.tssrc/core/extensions/extension-hook-runtime.tssrc/core/extensions/flag-definition-validation.tssrc/core/extensions/loader.tssrc/core/item/id.tssrc/core/reproducibility/context.tssrc/core/shared/time.tssrc/sdk/cli-contracts/flag-contracts.tssrc/sdk/compose.tssrc/sdk/governance/health.tssrc/sdk/index.tssrc/sdk/workspace-recipe.tssrc/sdk/workspace-snapshot.tstests/integration/cli.integration.spec.tstests/integration/workspace-snapshot-cli.integration.spec.tstests/unit/cli/registration-helpers.spec.tstests/unit/commands/health-command.spec.tstests/unit/commands/register-commands.spec.tstests/unit/core/extension-flag-definition-validation.spec.tstests/unit/extensions/extension-loader.spec.tstests/unit/sdk/context-integrity-primitives.spec.tstests/unit/sdk/sdk-compose.spec.tstests/unit/sdk/workspace-reproducibility.spec.tstests/unit/sdk/workspace-snapshot.spec.ts
|
First-round bot feedback acknowledgement:
The correction commit will be pushed next, followed by a fresh full-review request and exact-head review inventory. |
|
Tip For best results, initiate chat on the files or code changes.
✏️ Learnings added
|
Apply the complete first review round across extension flag parity, deterministic recipes, workspace snapshots, and the public CLI contract. Validate and deep-freeze portable JSON recipes, isolate concurrent deterministic scopes, bound generated tokens, publish the snapshot schema, preserve activated restores on cleanup failures, translate missing snapshot state, prevent reference/fingerprint ambiguity, and garbage-collect stale atomic publication debris. Refresh generated contracts, SDK surface and changelog; record PM evidence and closure; add focused type, concurrency, atomicity, filesystem, GC and CLI regressions while preserving exact 100% repository coverage.
|
Acknowledged — thanks for the thorough round-up. A few confirmations on my end:
Ready for the correction commit and fresh full-review request whenever you push. I'll anchor the next pass to the exact head SHA you specify. |
|
@greptileai review @coderabbitai full review First-round corrections are pushed at |
|
✅ Action performedFull 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 8 minutes. |
Route short-only blueprint declarations through the shared host-owned flag validator so author-time lint and runtime activation stay identical. Add the exact regression, record second-round PM and review evidence, regenerate the package-owned changelog, and preserve 100/100/100/100 coverage across 6,473 tests.
|
@greptileai review @coderabbitai full review Second-round short-only flag correction is pushed at |
|
✅ Action performedFull 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. |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/sdk/compose.ts (1)
1416-1416: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the detection-order comment for the new flag pass.
collectBlueprintFlagFindingsis now inserted between command and reserved-field findings, but the comment above still omits this pass and reserved-item findings. Keep the comment aligned with the actual array order.🤖 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/compose.ts` at line 1416, Update the detection-order comment above the findings array to include collectBlueprintFlagFindings and reserved-item findings in their actual order between command and reserved-field findings. Do not change the detection logic or array contents..agents/pm/features/pm-dkrmzv.toon (1)
13-19: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftClose missing PM-linked evidence before marking these features implemented.
The closed feature metadata records implementation evidence that covers snapshots/restores/coverage and recipe contract/concurrency coverage, but it does not address several accepted criteria as stated in
acceptance_criteria:
pm-dkrmzv: no covered evidence for restore/faster re-seeding at realistic scale, cross-version compatibility, multi-branch behavior, security boundaries, or packed installed-consumer tests.pm-rbcvt2: no covered evidence for cross-machine/build replay, recipe-generated corpora, CI nondeterminism regression, or “total clock injection” with no wall-clock reads when a clock is supplied.Capture the missing PM-linked evidence, or update the acceptance and resolution metadata through the PM CLI before release.
🤖 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-dkrmzv.toon around lines 13 - 19, The implemented metadata lacks PM-linked evidence for several accepted criteria. In .agents/pm/features/pm-dkrmzv.toon lines 13-19, add evidence for realistic-scale restore performance, cross-version compatibility, multi-branch behavior, security boundaries, and packed installed-consumer tests; in .agents/pm/features/pm-rbcvt2.toon lines 13-19, add evidence for cross-machine/build replay, recipe-generated corpora, CI nondeterminism regression, and total clock injection without wall-clock reads. Alternatively, use the PM CLI to update both features’ acceptance and resolution metadata before release.Sources: Coding guidelines, Learnings
src/sdk/workspace-snapshot.ts (1)
411-431: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winSerialize concurrent snapshot create/delete operations on the same fingerprint.
deleteWorkspaceSnapshotreads references without holding a lock, thenremoveSnapshotEntrycan deleteruntime/workspace-snapshots/objects/<fingerprint>while a concurrentcreateWorkspaceSnapshot({ name })is publishing that same fingerprint. Because create deduplicates viarenameinstead of lockingobjects/<fingerprint>, this can leave the newly published object as an unreachable, unlinked immutable snapshot. Route both paths through the repo’s existing workspace lock, or acquire and hold an exclusive lock against the fingerprint before listing references and removing the object.🤖 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/workspace-snapshot.ts` around lines 411 - 431, The deleteWorkspaceSnapshot flow must serialize object deletion with concurrent createWorkspaceSnapshot publishing for the same fingerprint. Route the fingerprint-based path through the existing workspace lock, holding an exclusive lock before listWorkspaceSnapshots and through removeSnapshotEntry; preserve the separate reference-deletion behavior and return values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/pm/history/pm-huolbk.jsonl:
- Line 19: Update the canonical actual_result via pm to state that validation
rejects malformed long tokens and detects host-owned collisions for long and
short tokens, without claiming malformed short-token grammar validation;
preserve the append-only hash chain in .agents/pm/history/pm-huolbk.jsonl at
lines 19-19. Regenerate .agents/pm/issues/pm-huolbk.toon from the canonical PM
item at lines 23-23 rather than editing the projection directly.
In `@docs/REPRODUCIBLE_WORKSPACES.md`:
- Around line 43-46: Update the documentation sentence describing
defineWorkspaceRecipe: remove the claim that runtime validation enforces the
exact top-level shape and that inputs are recursively JSON-compatible, unless
the implementation adds those runtime checks. Describe only the fields and
validation behavior actually enforced at runtime, while keeping the separate
TypeScript ExactWorkspaceRecipe<TRecipe> compile-time guarantee accurate.
In `@src/sdk/governance/gc.ts`:
- Around line 222-277: Update sweepWorkspaceSnapshotTemps to handle the
fs.stat(absolutePath) race like removeCacheFile: wrap the stat and subsequent
stale-entry removal flow in try/catch, skip the entry when the error is ENOENT
using isErrno, and rethrow all other errors so runGc still reports unexpected
failures.
In `@tests/unit/sdk/sdk-compose.spec.ts`:
- Around line 660-661: Make the duplicate-option regression test unambiguous by
changing the mixed long-and-short definition near the existing `--valid-long`
entry to use a distinct, non-colliding short token, while retaining `short:
"--path"` only on the short-only definition. Apply the same separation to the
corresponding definitions in the additional assertion around the later test case
so the expected finding can only come from short-only validation.
In `@tests/unit/sdk/workspace-reproducibility.spec.ts`:
- Around line 99-103: Update the Object.isFrozen assertion in the
reproducibility test to safely access the fourth value when operations[0] may be
undefined, ensuring the optional chain covers the trailing index access and
failures remain assertion failures rather than raw TypeErrors. Preserve the
existing frozen-value assertion.
---
Outside diff comments:
In @.agents/pm/features/pm-dkrmzv.toon:
- Around line 13-19: The implemented metadata lacks PM-linked evidence for
several accepted criteria. In .agents/pm/features/pm-dkrmzv.toon lines 13-19,
add evidence for realistic-scale restore performance, cross-version
compatibility, multi-branch behavior, security boundaries, and packed
installed-consumer tests; in .agents/pm/features/pm-rbcvt2.toon lines 13-19, add
evidence for cross-machine/build replay, recipe-generated corpora, CI
nondeterminism regression, and total clock injection without wall-clock reads.
Alternatively, use the PM CLI to update both features’ acceptance and resolution
metadata before release.
In `@src/sdk/compose.ts`:
- Line 1416: Update the detection-order comment above the findings array to
include collectBlueprintFlagFindings and reserved-item findings in their actual
order between command and reserved-field findings. Do not change the detection
logic or array contents.
In `@src/sdk/workspace-snapshot.ts`:
- Around line 411-431: The deleteWorkspaceSnapshot flow must serialize object
deletion with concurrent createWorkspaceSnapshot publishing for the same
fingerprint. Route the fingerprint-based path through the existing workspace
lock, holding an exclusive lock before listWorkspaceSnapshots and through
removeSnapshotEntry; preserve the separate reference-deletion behavior and
return values.
🪄 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: dd59dcc1-0b98-4ead-836c-11abee7e5b51
📒 Files selected for processing (25)
.agents/pm/extensions/.managed-extensions.json.agents/pm/features/pm-dkrmzv.toon.agents/pm/features/pm-rbcvt2.toon.agents/pm/history/pm-83ov2i.jsonl.agents/pm/history/pm-dkrmzv.jsonl.agents/pm/history/pm-huolbk.jsonl.agents/pm/history/pm-rbcvt2.jsonl.agents/pm/issues/pm-83ov2i.toon.agents/pm/issues/pm-huolbk.toonCHANGELOG.mddocs/REPRODUCIBLE_WORKSPACES.mdsdk/public-surface.jsonsrc/cli/register-operations.tssrc/core/reproducibility/context.tssrc/sdk/compose.tssrc/sdk/governance/gc.tssrc/sdk/index.tssrc/sdk/workspace-recipe.tssrc/sdk/workspace-snapshot.tstests/fixtures/contracts/full.jsontests/integration/workspace-snapshot-cli.integration.spec.tstests/unit/commands/gc-command.spec.tstests/unit/sdk/sdk-compose.spec.tstests/unit/sdk/workspace-reproducibility.spec.tstests/unit/sdk/workspace-snapshot.spec.ts
💤 Files with no reviewable changes (1)
- tests/fixtures/contracts/full.json
Handle concurrent snapshot temp disappearance without masking unexpected filesystem failures, separate runtime and TypeScript recipe guarantees, and make short-only flag coverage unambiguous. Record exact 100% coverage and linked-test evidence on the affected PM items, close and release only the active work, and refresh the managed pm-changelog state.
|
Final review corrections are pushed at
@greptileai please review the new exact head. |
|
✅ Action performedFull 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 33 minutes. |
|
@coderabbitai thank you—the exact-head full review completed with no new findings, and all five prior threads are resolved. The repository-owned static gate independently reports 100% overall, exported, and member docstring coverage, so the walkthrough's 50% external heuristic warning is not a merge blocker. @greptileai also passed exact head |
|
Tip For best results, initiate chat on the files or code changes.
|
|
Thanks for the thorough follow-through. All threads resolved, head |
Summary
This broad SDK/CLI delivery makes project management = context management more reproducible, truthful, and extension-safe:
PM lineage
Verification
Closes #784
Closes #785
Closes #786
Closes #787
Closes #792
Closes #793
Closes #794
Summary by Sourcery
Introduce reproducible workspace execution and content-addressed snapshot primitives in the SDK and CLI, while tightening extension flag validation, refining output_format override semantics, and clarifying health and list behaviors.
New Features:
pm workspace snapshotCLI commands.Bug Fixes:
Enhancements:
Documentation:
Tests:
Summary by cubic
Adds deterministic workspace recipes and content‑addressed snapshots for reproducible runs and byte‑identical restores. Finalizes integrity reviews with runtime‑validated, deep‑frozen recipes (clear TS vs runtime guarantees), safe concurrent snapshot temp cleanup without masking filesystem errors, short‑only flag validation parity, and clearer list/health behavior.
New Features
PM_WORKSPACE_RECIPE_SCHEMA,defineWorkspaceRecipe,runWithWorkspaceRecipe, andexecuteWorkspaceRecipeprovide seeded IDs, an injectable clock, validated/deep‑frozen recipes, isolated concurrent scopes, and bounded token generation.createWorkspaceSnapshot,listWorkspaceSnapshots,inspectWorkspaceSnapshot,restoreWorkspaceSnapshot,deleteWorkspaceSnapshot, pluspm workspace snapshot <list|create|inspect|restore|delete>; publishesSNAPSHOT_SCHEMA, enforces atomic publish/restore, and GC safely removes stale temp objects/refs even under concurrent deletion.Migration
pm list --allwith eitherpm list --status all --no-truncateorpm list-all --no-truncate(bare--allnow errors with guidance).--and cannot use host-owned names; short‑only aliases are also validated. Invalid or colliding flags are rejected at lint and activation.output_formatoverrides that copy the host payload now decline by default; return a handled decision to intentionally replace output.Written for commit 91f6d3b. Summary will update on new commits.