Skip to content

feat(sync): add projection and problem core - #987

Merged
ctawiah merged 1 commit into
mainfrom
ctawiah/sync-projection-core-3bbf
Nov 4, 2026
Merged

ctawiah merged 1 commit into
mainfrom
ctawiah/sync-projection-core-3bbf

Conversation

@ctawiah

@ctawiah ctawiah commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Context

Repository adapters need one shared model of what a source owns: typed projections, field capabilities, and structured errors. The lock also needs to know how a projection was produced.

What changes

  • Add typed projections for variations, tools, and skills. Each has methods to read a field, list its states, and merge into a resource, so the planner never switches on the type.
  • Add ForMode, the one place that converts a source prompt between agent instructions and one system message.
  • Add structured sync problems with a stable code and a next step.
  • Record the descriptor digest, the adapter behavior version, and the indexed selections in sync.lock format version 1.

Design notes

  • A field is direct or read-only. A read-only field blocks its resource. There is no patch output.
  • The adapter behavior is a string such as python/1, stored per resource. A change to one adapter asks for a review of the bindings of that format only.

Review focus

  • Does a projection carry every mapped field with its state?
  • Does ForMode reject a message list that cannot become instructions?

Verification

  • make build
  • go test ./...
  • golangci-lint run ./...

Related changes

  1. refactor(sync): remove Phase 1 source references #1005: Phase 1 reference removal
  2. This PR: projection and problem core
  3. feat(sync): add the adapter core and the Markdown adapter #988: adapter core and Markdown
  4. feat(sync): add the structured document adapters #989: structured adapters
  5. feat(sync): add the Python adapter #991: Python adapter
  6. feat(sync): add the TypeScript and JavaScript adapters #992: TypeScript and JavaScript adapters
  7. feat(sync): add source descriptor storage #993: descriptor storage
  8. feat(sync): compile and publish repository sources #994: compile and publish
  9. feat(sync): detach descriptor-backed sources #1003: descriptor detach
  10. feat(sync): prepare repository source links #997: link preparation
  11. feat(sync): integrate repository sources with planning and link #995: planning and link
  12. feat(sync): add the link commands #998: link commands

🤖 Generated with Claude Code


Note

Overview
Introduces the shared projection model for descriptor-backed resources (variations, tools, skills): mapped fields, direct vs read-only capability, project/merge helpers, stable projection fingerprints, and ReferenceDigest for mapping changes. Adds Problem / ErrorCode for structured, actionable sync failures.

Remote and local baselines gain formatVersion: 1. Manifest entries and API upserts now carry fingerprintSchema, referenceDigest, and adapterBehavior; sync.lock can also store indexedSelections. The API client validates manifest version on get/patch and rejects unknown versions.

Domain model updates: Reference expands with select, map, and optional tools/skills ownership lists; SyncedResource / SyncedAttachment carry source metadata and projections; attachments track projection for partial publish. Manifest SetSource, SameContent, and store change detection treat descriptor metadata as part of baseline equality—not fingerprint alone.

Tests cover projection behavior (prompt normalization, ForMode, model parameters, relationships) and lock/API manifest round-trips.

Reviewed by Cursor Bugbot for commit 172938a. Bugbot is set up for automated code reviews on this repo. Configure here.

@ctawiah
ctawiah added this pull request to stack #1000 October 30, 2026 20:15
@ctawiah
ctawiah force-pushed the ctawiah/sync-projection-core-3bbf branch 3 times, most recently from f31a6bb to 73fdc58 Compare November 3, 2026 00:29
@ctawiah
ctawiah removed this pull request from stack #1000 November 3, 2026 00:32
@ctawiah
ctawiah added this pull request to stack #1004 November 3, 2026 00:34
@ctawiah
ctawiah removed this pull request from stack #1004 November 3, 2026 00:53
@ctawiah
ctawiah changed the base branch from main to ctawiah/sync-phase1-ref-removal-3bbf November 3, 2026 00:53
@ctawiah
ctawiah added this pull request to stack #1006 November 3, 2026 00:53
@ctawiah
ctawiah force-pushed the ctawiah/sync-projection-core-3bbf branch from 73fdc58 to 7cf0b26 Compare November 4, 2026 15:29
@ctawiah
ctawiah marked this pull request as ready for review November 4, 2026 15:29
@ctawiah
ctawiah requested a review from a team as a code owner November 4, 2026 15:29
@ctawiah
ctawiah requested review from btesfamariam and nkester-ld and removed request for a team November 4, 2026 15:29

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

Stale Bugbot comment from a previous run.

Comment thread internal/sync/manifest/model.go Resolved
Base automatically changed from ctawiah/sync-phase1-ref-removal-3bbf to main November 4, 2026 19:25
@ctawiah
ctawiah force-pushed the ctawiah/sync-projection-core-3bbf branch from 7cf0b26 to bfc9d15 Compare November 4, 2026 19:25

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

Stale Bugbot comment from a previous run.

Comment thread internal/sync/projection.go Resolved
@ctawiah
ctawiah force-pushed the ctawiah/sync-projection-core-3bbf branch from bfc9d15 to 2835af5 Compare November 4, 2026 19:46

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2835af5. Configure here.

Comment thread internal/sync/projection.go Resolved
Comment thread internal/sync/projection.go Resolved
Add typed projections for variations, tools, and skills, with the field states that the planner compares. Add structured sync problems with stable codes and next steps. Record the descriptor digest, the adapter behavior, and the indexed selections in sync.lock format version 1.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ctawiah
ctawiah force-pushed the ctawiah/sync-projection-core-3bbf branch from 2835af5 to 172938a Compare November 4, 2026 21:53
@ctawiah
ctawiah merged commit bcc8d30 into main Nov 4, 2026
10 checks passed
@ctawiah
ctawiah deleted the ctawiah/sync-projection-core-3bbf branch November 4, 2026 22:26
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.

2 participants