Skip to content

[codex] Add context stores and initiative views#1127

Merged
TabishB merged 12 commits into
mainfrom
codex/context-store-initiatives
May 27, 2026
Merged

[codex] Add context stores and initiative views#1127
TabishB merged 12 commits into
mainfrom
codex/context-store-initiatives

Conversation

@TabishB

@TabishB TabishB commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR pivots the workspace roadmap around context stores and initiatives, then implements the first usable pieces of that model:

  • documents initiatives as the durable coordination layer and marks older workspace-owned lifecycle plans as historical or deferred
  • adds context-store registration/setup/list/doctor foundations and initiative create/list/show flows
  • links repo-local changes to initiatives through metadata, new change --initiative, and set change
  • lets workspaces open initiative-backed local views with generated guidance, JSON output, and compatibility for legacy workspace state
  • includes the current root-level bundled workspace JS artifacts in a separate commit so they are easy to review

Validation

  • pnpm build
  • pnpm lint
  • pnpm test (86 files, 1615 tests)

Notes

The branch was rebased onto origin/main before pushing so the PR diff does not include the two upstream commits that local main was missing.

Summary by CodeRabbit

  • New Features

    • Added context-store CLI (setup/register/list/doctor) and initiative CLI (create/list/show).
    • Support linking repo changes to initiatives (--initiative) and a new set-change command.
    • workspace open now supports initiative-backed local views and emits machine-readable JSON receipts.
  • Documentation

    • Updated CLI help and user docs to present workspaces as local views, initiatives as durable coordination, and refreshed workspace/update/open/update workflow guidance.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

I can't reliably rebuild the hidden review stack artifact with every rangeId exactly once within this chat (the PR includes hundreds of rangeIds and the previous attempt produced duplicate/missing ids). Please allow me to regenerate this artifact programmatically (I can produce a correct block if you permit a brief automated pass), or provide a smaller set of rangeIds to assign manually.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/context-store-initiatives

@TabishB TabishB force-pushed the codex/context-store-initiatives branch from a709061 to 9f158d5 Compare May 25, 2026 18:26
@TabishB TabishB marked this pull request as ready for review May 25, 2026 18:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Caution

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

⚠️ Outside diff range comments (2)
test/core/workspace/foundation.test.ts (1)

81-83: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use dual-side canonicalization for workspace path identity assertions.

Current helper is platform-conditional and only normalizes one side of comparisons; identity assertions should normalize both paths before equality checks.

🧪 Suggested helper update
-  function expectedExistingPath(existingPath: string): string {
-    return process.platform === 'win32' ? fs.realpathSync.native(existingPath) : existingPath;
-  }
+  function canonicalExistingPath(existingPath: string): string {
+    return fs.realpathSync.native(existingPath);
+  }
+
+  function expectSameExistingPath(actualPath: string, expectedPath: string): void {
+    expect(canonicalExistingPath(actualPath)).toBe(canonicalExistingPath(expectedPath));
+  }
// Example identity assertion:
expectSameExistingPath(await findWorkspaceRoot(workspaceRoot), workspaceRoot);
As per coding guidelines `test/**/*.test.{ts,js}`: “When asserting existing filesystem paths as identities in tests, canonicalize both actual and expected paths using `fs.realpathSync.native()` …”
🤖 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 `@test/core/workspace/foundation.test.ts` around lines 81 - 83, The helper
expectedExistingPath currently only canonicalizes the expected path on Windows;
change it to canonicalize both sides for identity assertions by always returning
fs.realpathSync.native(existingPath) (no platform branch) and ensure callers
(like expectSameExistingPath / identity assertions comparing
findWorkspaceRoot(workspaceRoot)) also canonicalize the actual value with
fs.realpathSync.native before comparing; update expectedExistingPath and any
consumer to use fs.realpathSync.native for both actual and expected paths.
test/commands/workspace.test.ts (1)

1294-1309: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Canonicalize existing path identity assertion for local-only link.

On Line 1307, this compares an existing filesystem path using raw spelling (localOnly). Please compare canonicalized values (e.g., expectedExistingPath(localOnly) and/or canonicalize the actual) to avoid platform/path-resolution flakes.

As per coding guidelines: "When asserting existing filesystem paths as identities in tests, canonicalize both actual and expected paths using fs.realpathSync.native()".

🤖 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 `@test/commands/workspace.test.ts` around lines 1294 - 1309, The test currently
asserts the raw filesystem spelling for the "local-only" link (path: localOnly),
which flakes across platforms; change the expected path to a canonicalized form
by calling the canonicalizer (e.g., expectedExistingPath(localOnly) or
fs.realpathSync.native(localOnly)) so both actual and expected path identities
match; update the objectContaining for the 'local-only' entry (the
payload.workspace.links assertion) to use the canonicalized value and add an
import/usage of fs.realpathSync.native or the existing expectedExistingPath
helper as needed.
🧹 Nitpick comments (2)
test/core/context-store/foundation.test.ts (1)

46-48: ⚡ Quick win

Use unconditional canonicalization for path identity checks in this test suite.

For existing-path identity assertions, canonicalize both actual and expected via fs.realpathSync.native() instead of platform-conditional behavior.

As per coding guidelines, “When asserting existing filesystem paths as identities in tests, canonicalize both actual and expected paths using fs.realpathSync.native()”.

Also applies to: 322-325

🤖 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 `@test/core/context-store/foundation.test.ts` around lines 46 - 48, The test
currently conditionally canonicalizes expected paths in expectedExistingPath
based on platform; change expectedExistingPath to always return
fs.realpathSync.native(existingPath) (i.e., unconditional canonicalization) and
update any other assertions mentioned (the same pattern around the other
occurrences referenced, e.g., the block at lines 322-325) so that both actual
and expected paths are compared after calling fs.realpathSync.native(), ensuring
all existing-path identity checks use fs.realpathSync.native() for both sides.
test/commands/workspace-initiative-open.test.ts (1)

48-50: ⚡ Quick win

Canonicalize both sides for path identity assertions in tests.

expectedExistingPath only canonicalizes on Windows, but this suite compares existing path identities in several assertions. Use fs.realpathSync.native() for both actual and expected values before asserting identity.

Suggested fix pattern
-  function expectedExistingPath(existingPath: string): string {
-    return process.platform === 'win32' ? fs.realpathSync.native(existingPath) : existingPath;
-  }
+  function canonicalPath(existingPath: string): string {
+    return fs.realpathSync.native(existingPath);
+  }
+
+  function expectSameExistingPath(actualPath: string, expectedPath: string): void {
+    expect(canonicalPath(actualPath)).toBe(canonicalPath(expectedPath));
+  }

Then use expectSameExistingPath(...) anywhere path identity is asserted.

As per coding guidelines, “When asserting existing filesystem paths as identities in tests, canonicalize both actual and expected paths using fs.realpathSync.native()”.

Also applies to: 143-173, 296-314

🤖 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 `@test/commands/workspace-initiative-open.test.ts` around lines 48 - 50, The
helper expectedExistingPath only canonicalizes on Windows which leaves
non-Windows assertions comparing non-canonical paths; update
expectedExistingPath to always return fs.realpathSync.native(existingPath)
(removing the platform branch) and add/use a small test helper
expectSameExistingPath(actualPath, expectedPath) that canonicalizes both sides
via fs.realpathSync.native() before asserting equality; replace existing direct
identity assertions in functions/tests named expectedExistingPath and the blocks
referenced (including the ranges around lines 143-173 and 296-314) to call
expectSameExistingPath so both actual and expected paths are canonicalized
consistently.
🤖 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 `@openspec/initiatives/context-store-and-initiatives/roadmap.md`:
- Line 535: Sequence item 9 in the shipping sequence conflicts with the decision
to reject initiative resolve; update the roadmap text so item 9 reflects the
rejection. Locate the line containing "Add initiative local resolution" in the
roadmap (sequence item 9) and replace it with a statement matching the
documented rejection, e.g. "Reject initiative resolve (do not implement local
resolution)" or similar wording that clearly records the decision to reject.
Ensure the surrounding numbering and cross-references remain consistent after
the change.

In `@src/commands/workspace/context-status.ts`:
- Around line 40-49: The catch block in the function that builds workspace
context status is collapsing both store-resolution failures and initiative-read
failures into the single status 'workspace_context_store_unavailable'; split the
error handling so you first attempt to resolve/open the context store (the code
that uses context.store) and return a
makeStatus('error','workspace_context_store_unavailable',...) if that operation
fails, then perform the initiative read (the call that reads initiatives from
the opened store) inside its own try/catch and on failure return a separate
makeStatus (e.g., 'initiative_read_unavailable' or similar) with a fix
suggesting the initiative doctor; use asErrorMessage(error) in both messages and
reference makeStatus, asErrorMessage, and the context.store / initiative-read
call to locate where to add the distinct catch branches.

In `@src/core/collections/runtime.ts`:
- Around line 220-223: The current check treats any string starting with '..'
(relative.startsWith('..')) as a mount-escape; change it to only treat an escape
when the leading segment is exactly '..' or '..' followed by a path separator
(i.e. match ^\.\.(?:[\/\\]|$)). Update the return expression that uses relative
and isRelativePathAbsolute (and the windowsLike flag) to use this stricter test
(e.g., replace relative.startsWith('..') with a regex or an explicit check for
'..' or '..' + path separator) so names like '..draft/file.md' are allowed while
true parent-directory escapes like '../foo' or '..\\foo' are still rejected.

In `@src/core/planning-home.ts`:
- Around line 114-123: When iterating the two state locations
(getWorkspaceSharedStatePath and getWorkspaceLegacySharedStatePath) do not
swallow parse/validation errors from parseWorkspaceSharedState; only fall back
when the file is missing. Change the try/catch around fs.readFileSync +
parseWorkspaceSharedState so that if reading fails with a missing-file error
(e.g., err.code === 'ENOENT' or use fs.existsSync to check) you continue to the
next path, but if parseWorkspaceSharedState throws (or any other non-ENOENT
error) rethrow or propagate that error so invalid current state is surfaced
instead of silently loading legacy state.

In `@src/core/workspace/foundation.ts`:
- Around line 445-456: The current construction of linkNames -> links drops
entries present in sharedState.links when localState.paths lacks that key;
update the creation of links so that for each linkName (from linkNames) you
return an entry even if localState?.paths[linkName] is falsy — use the
sharedState.links[linkName] (or an explicit null/placeholder) as the value when
local path is missing. Modify the flatMap/map over [...linkNames] (and the
resulting links object) to emit [linkName, localPath] when present or [linkName,
sharedState.links[linkName] ?? null] when not, preserving unresolved links
across conversions.

In `@test/commands/change-initiative-link.test.ts`:
- Around line 23-25: Tests compare filesystem path identities with raw strings;
update those assertions to canonicalize both expected and actual paths using
fs.realpathSync.native() before equality checks. Locate uses of tempDir and
dataHome in change-initiative-link.test.ts (and the assertion blocks around the
ranges noted: ~23-25, ~132-140, ~296-307, ~478-487) and replace direct string
comparisons with calls that wrap both sides in fs.realpathSync.native(...) so
symlinks and platform-specific path differences do not cause failures; ensure
you import/require fs where needed and apply the same canonicalization to any
helper functions that return paths used in these assertions (e.g., functions
referenced in the assertion expressions).

In `@test/commands/initiative.test.ts`:
- Around line 47-49: The helper expectedExistingPath currently only
canonicalizes on Windows and for one side; update it to always canonicalize its
input using fs.realpathSync.native (no platform branch) and then update tests to
canonicalize both actual and expected paths before identity assertions (i.e.,
call expectedExistingPath(payload.context_store.root) and
expectedExistingPath(storeRoot) and compare those canonicalized strings). Use
the function name expectedExistingPath to locate and change the helper and
update tests that use it so both sides are compared after realpathSync.native().

In `@test/core/context-store/registry.test.ts`:
- Around line 35-37: The test only canonicalizes the expected path in
expectedExistingPath; change the assertions to canonicalize both sides by using
the existing canonicalPath helper (or fs.realpathSync.native) for the produced
value and the expected value before equality checks: update expectedExistingPath
(or callers that use it) so both the actual produced path and the
expectedExistingPath are passed through canonicalPath(...) (or
fs.realpathSync.native on Windows) prior to the identity assertion. Ensure you
reference expectedExistingPath and the canonicalPath helper when making the
change so all path identity assertions in this file use canonicalized paths.

---

Outside diff comments:
In `@test/commands/workspace.test.ts`:
- Around line 1294-1309: The test currently asserts the raw filesystem spelling
for the "local-only" link (path: localOnly), which flakes across platforms;
change the expected path to a canonicalized form by calling the canonicalizer
(e.g., expectedExistingPath(localOnly) or fs.realpathSync.native(localOnly)) so
both actual and expected path identities match; update the objectContaining for
the 'local-only' entry (the payload.workspace.links assertion) to use the
canonicalized value and add an import/usage of fs.realpathSync.native or the
existing expectedExistingPath helper as needed.

In `@test/core/workspace/foundation.test.ts`:
- Around line 81-83: The helper expectedExistingPath currently only
canonicalizes the expected path on Windows; change it to canonicalize both sides
for identity assertions by always returning fs.realpathSync.native(existingPath)
(no platform branch) and ensure callers (like expectSameExistingPath / identity
assertions comparing findWorkspaceRoot(workspaceRoot)) also canonicalize the
actual value with fs.realpathSync.native before comparing; update
expectedExistingPath and any consumer to use fs.realpathSync.native for both
actual and expected paths.

---

Nitpick comments:
In `@test/commands/workspace-initiative-open.test.ts`:
- Around line 48-50: The helper expectedExistingPath only canonicalizes on
Windows which leaves non-Windows assertions comparing non-canonical paths;
update expectedExistingPath to always return
fs.realpathSync.native(existingPath) (removing the platform branch) and add/use
a small test helper expectSameExistingPath(actualPath, expectedPath) that
canonicalizes both sides via fs.realpathSync.native() before asserting equality;
replace existing direct identity assertions in functions/tests named
expectedExistingPath and the blocks referenced (including the ranges around
lines 143-173 and 296-314) to call expectSameExistingPath so both actual and
expected paths are canonicalized consistently.

In `@test/core/context-store/foundation.test.ts`:
- Around line 46-48: The test currently conditionally canonicalizes expected
paths in expectedExistingPath based on platform; change expectedExistingPath to
always return fs.realpathSync.native(existingPath) (i.e., unconditional
canonicalization) and update any other assertions mentioned (the same pattern
around the other occurrences referenced, e.g., the block at lines 322-325) so
that both actual and expected paths are compared after calling
fs.realpathSync.native(), ensuring all existing-path identity checks use
fs.realpathSync.native() for both sides.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1f879709-1aea-4098-9da6-e890ad062cac

📥 Commits

Reviewing files that changed from the base of the PR and between e441287 and 9f158d5.

📒 Files selected for processing (114)
  • WORKSPACE_REIMPLEMENTATION_DIRECTION.md
  • WORKSPACE_REIMPLEMENTATION_START_HERE.md
  • docs/cli.md
  • docs/concepts.md
  • local-active-workspace-root-dropdown-BsVoK_JG.js
  • main-DVEWN1ng.js
  • openspec/changes/workspace-agent-guidance/design.md
  • openspec/changes/workspace-agent-guidance/proposal.md
  • openspec/changes/workspace-agent-guidance/specs/change-creation/spec.md
  • openspec/changes/workspace-agent-guidance/specs/cli-artifact-workflow/spec.md
  • openspec/changes/workspace-agent-guidance/specs/workspace-links/spec.md
  • openspec/changes/workspace-agent-guidance/tasks.md
  • openspec/changes/workspace-apply-repo-slice/proposal.md
  • openspec/changes/workspace-reimplementation-roadmap/POC_REFERENCE_GUIDE.md
  • openspec/changes/workspace-reimplementation-roadmap/README.md
  • openspec/changes/workspace-reimplementation-roadmap/proposal.md
  • openspec/changes/workspace-verify-and-archive/proposal.md
  • openspec/initiatives/context-store-and-initiatives/.initiative.yaml
  • openspec/initiatives/context-store-and-initiatives/README.md
  • openspec/initiatives/context-store-and-initiatives/decisions.md
  • openspec/initiatives/context-store-and-initiatives/direction.md
  • openspec/initiatives/context-store-and-initiatives/questions.md
  • openspec/initiatives/context-store-and-initiatives/roadmap.md
  • openspec/initiatives/context-store-and-initiatives/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/01-lock-the-direction/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/01-lock-the-direction/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/01-lock-the-direction/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/02-stabilize-workspace-as-local-view/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/02-stabilize-workspace-as-local-view/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/02-stabilize-workspace-as-local-view/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/03-add-context-store-foundation/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/03-add-context-store-foundation/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/03-add-context-store-foundation/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/04-add-collection-foundation/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/04-add-collection-foundation/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/04-add-collection-foundation/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/05-ship-initiative-mvp/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/05-ship-initiative-mvp/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/05-ship-initiative-mvp/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/06-add-minimal-context-store-ux/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/06-add-minimal-context-store-ux/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/06-add-minimal-context-store-ux/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/07-add-agent-first-initiative-discovery/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/07-add-agent-first-initiative-discovery/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/07-add-agent-first-initiative-discovery/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/08-connect-repo-local-changes-to-initiatives/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/08-connect-repo-local-changes-to-initiatives/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/08-connect-repo-local-changes-to-initiatives/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/09-add-initiative-resolve/decision-review.md
  • openspec/initiatives/context-store-and-initiatives/work-items/09-add-initiative-resolve/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/09-add-initiative-resolve/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/09-add-initiative-resolve/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/10-let-workspaces-open-initiatives/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/10-let-workspaces-open-initiatives/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/13-explore-configurable-change-homes/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/13-explore-configurable-change-homes/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/13-explore-configurable-change-homes/tasks.md
  • openspec/initiatives/context-store-and-initiatives/work-items/proposed-initiative-next-agent-handoff-ux/evidence.md
  • openspec/initiatives/context-store-and-initiatives/work-items/proposed-initiative-next-agent-handoff-ux/plan.md
  • openspec/initiatives/context-store-and-initiatives/work-items/proposed-initiative-next-agent-handoff-ux/tasks.md
  • src/cli/index.ts
  • src/commands/context-store.ts
  • src/commands/initiative.ts
  • src/commands/workflow/index.ts
  • src/commands/workflow/initiative-link.ts
  • src/commands/workflow/instructions.ts
  • src/commands/workflow/new-change.ts
  • src/commands/workflow/set-change.ts
  • src/commands/workflow/shared.ts
  • src/commands/workflow/status.ts
  • src/commands/workspace.ts
  • src/commands/workspace/context-status.ts
  • src/commands/workspace/open-view.ts
  • src/commands/workspace/open.ts
  • src/commands/workspace/opener-selection.ts
  • src/commands/workspace/operations.ts
  • src/commands/workspace/prompt-theme.ts
  • src/commands/workspace/registration.ts
  • src/commands/workspace/selection.ts
  • src/commands/workspace/types.ts
  • src/core/artifact-graph/instruction-loader.ts
  • src/core/artifact-graph/types.ts
  • src/core/collections/index.ts
  • src/core/collections/initiatives/collection.ts
  • src/core/collections/initiatives/index.ts
  • src/core/collections/initiatives/operations.ts
  • src/core/collections/initiatives/resolution.ts
  • src/core/collections/initiatives/schema.ts
  • src/core/collections/initiatives/templates.ts
  • src/core/collections/runtime.ts
  • src/core/completions/command-registry.ts
  • src/core/context-store/foundation.ts
  • src/core/context-store/index.ts
  • src/core/context-store/registry.ts
  • src/core/index.ts
  • src/core/planning-home.ts
  • src/core/workspace/foundation.ts
  • src/core/workspace/open-surface.ts
  • src/utils/change-utils.ts
  • test/commands/artifact-workflow.test.ts
  • test/commands/change-initiative-link.test.ts
  • test/commands/context-store.test.ts
  • test/commands/initiative.test.ts
  • test/commands/workspace-initiative-open.test.ts
  • test/commands/workspace.test.ts
  • test/core/collections/initiatives/operations.test.ts
  • test/core/collections/initiatives/schema.test.ts
  • test/core/collections/initiatives/templates.test.ts
  • test/core/collections/runtime.test.ts
  • test/core/context-store/foundation.test.ts
  • test/core/context-store/registry.test.ts
  • test/core/workspace/foundation.test.ts
  • test/utils/change-metadata.test.ts
  • workspace-root-drop-handler-Bom6Z7sW.js
💤 Files with no reviewable changes (5)
  • openspec/changes/workspace-agent-guidance/specs/workspace-links/spec.md
  • openspec/changes/workspace-agent-guidance/specs/cli-artifact-workflow/spec.md
  • openspec/changes/workspace-agent-guidance/tasks.md
  • openspec/changes/workspace-agent-guidance/specs/change-creation/spec.md
  • openspec/changes/workspace-agent-guidance/design.md

Comment thread openspec/initiatives/context-store-and-initiatives/roadmap.md Outdated
Comment thread src/commands/workspace/context-status.ts
Comment thread src/core/collections/runtime.ts
Comment thread src/core/planning-home.ts Outdated
Comment thread src/core/workspace/foundation.ts Outdated
Comment thread test/commands/change-initiative-link.test.ts
Comment thread test/commands/initiative.test.ts
Comment thread test/core/context-store/registry.test.ts Outdated
@TabishB

TabishB commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

Also addressed the non-threaded review-body path assertion items in workspace.test.ts, workspace/foundation.test.ts, workspace-initiative-open.test.ts, and context-store/foundation.test.ts; full validation passed with pnpm build, pnpm lint, and pnpm test (86 files, 1618 tests).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
test/core/context-store/registry.test.ts (1)

299-321: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Canonicalize root path identity assertions in the binding-resolution test

Line 302 and Line 318 compare raw existing paths. Use canonicalized identity assertions (like expectSameExistingPath) for those root checks as well.

Proposed patch
     expect(registered).toEqual(
       expect.objectContaining({
         id: 'registered-context',
-        root: registeredRoot,
+        root: expect.any(String),
         source: 'registry',
         warnings: [],
       })
     );
+    expectSameExistingPath(registered.root, registeredRoot);

     const pathBound = await resolveContextStoreBinding(
       createPathContextStoreBinding({
         id: 'path-context',
         path: pathRoot,
@@
     expect(pathBound).toEqual(
       expect.objectContaining({
         id: 'path-context',
-        root: pathRoot,
+        root: expect.any(String),
         source: 'path',
         warnings: [],
       })
     );
+    expectSameExistingPath(pathBound.root, pathRoot);

As per coding guidelines test/**/*.test.{ts,js}: “When asserting existing filesystem paths as identities in tests, canonicalize both actual and expected paths using fs.realpathSync.native().”

🤖 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 `@test/core/context-store/registry.test.ts` around lines 299 - 321, Replace the
raw root equality checks in the binding-resolution test with canonicalized path
identity assertions: instead of asserting registered.objectContaining({ root:
registeredRoot }) call the test helper that compares canonicalized paths (e.g.,
expectSameExistingPath) on registered.root and registeredRoot; likewise replace
the pathBound.objectContaining({ root: pathRoot }) check with
expectSameExistingPath(pathBound.root, pathRoot). Keep the rest of the
objectContaining assertions (id, source, warnings) unchanged and ensure the
expectSameExistingPath helper uses fs.realpathSync.native() to canonicalize both
sides before comparing.
🤖 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.

Duplicate comments:
In `@test/core/context-store/registry.test.ts`:
- Around line 299-321: Replace the raw root equality checks in the
binding-resolution test with canonicalized path identity assertions: instead of
asserting registered.objectContaining({ root: registeredRoot }) call the test
helper that compares canonicalized paths (e.g., expectSameExistingPath) on
registered.root and registeredRoot; likewise replace the
pathBound.objectContaining({ root: pathRoot }) check with
expectSameExistingPath(pathBound.root, pathRoot). Keep the rest of the
objectContaining assertions (id, source, warnings) unchanged and ensure the
expectSameExistingPath helper uses fs.realpathSync.native() to canonicalize both
sides before comparing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b2631974-4c71-451a-a5a2-6d1a41731cff

📥 Commits

Reviewing files that changed from the base of the PR and between 9c0244e and f741ed4.

📒 Files selected for processing (17)
  • docs/concepts.md
  • openspec/initiatives/context-store-and-initiatives/decisions.md
  • openspec/initiatives/context-store-and-initiatives/roadmap.md
  • openspec/initiatives/context-store-and-initiatives/work-items/10-let-workspaces-open-initiatives/plan.md
  • src/commands/workspace.ts
  • src/commands/workspace/context-status.ts
  • src/commands/workspace/open-view.ts
  • src/commands/workspace/operations.ts
  • src/commands/workspace/types.ts
  • src/core/collections/initiatives/resolution.ts
  • src/core/context-store/binding.ts
  • src/core/context-store/index.ts
  • src/core/workspace/foundation.ts
  • src/core/workspace/open-surface.ts
  • test/commands/workspace-initiative-open.test.ts
  • test/core/context-store/registry.test.ts
  • test/core/workspace/foundation.test.ts
✅ Files skipped from review due to trivial changes (3)
  • openspec/initiatives/context-store-and-initiatives/roadmap.md
  • openspec/initiatives/context-store-and-initiatives/decisions.md
  • openspec/initiatives/context-store-and-initiatives/work-items/10-let-workspaces-open-initiatives/plan.md

Comment thread src/core/collections/initiatives/resolution.ts Fixed

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. CI is green, the branch is mergeable, and the prior review/security threads are resolved.

@TabishB TabishB added this pull request to the merge queue May 27, 2026
Merged via the queue into main with commit fd92ccc May 27, 2026
12 checks passed
@TabishB TabishB deleted the codex/context-store-initiatives branch May 27, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants