Skip to content

refactor(core): move lifecycle provider-binding into Core-internal - #723

Merged
Drswith merged 2 commits into
mainfrom
cursor/lifecycle-provider-core-internal-l2-1cd6
Sep 7, 2026
Merged

refactor(core): move lifecycle provider-binding into Core-internal#723
Drswith merged 2 commits into
mainfrom
cursor/lifecycle-provider-core-internal-l2-1cd6

Conversation

@Drswith

@Drswith Drswith commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

L2 lifecycle internalization: move provider-binding resolution and observeLifecycleProvider from src/lifecycle into Core-internal modules at src/core/lifecycle/provider-binding.ts and src/core/lifecycle/provider-evidence.ts. This removes the next Core → src/lifecycle reverse dependency after L1 without expanding the published SDK.

Unlike the L1 model leaf, these modules are not zero-import: they may import agents, provider types, the model leaf, and type-only state. ADR 0012 records that src/state still may import only the model leaf. Remaining src/lifecycle/* engines stay in place for L3+.

Before / after import map

Importer Before After
src/core/installation-*.ts ../lifecycle/provider-binding ./lifecycle/provider-binding
src/core/production-observation.ts ../lifecycle/provider-binding ./lifecycle/provider-binding
src/core/update-production.ts ../lifecycle/provider-binding ./lifecycle/provider-binding
src/core/uninstall-executor.ts binding/evidence via ../lifecycle barrel ./lifecycle/provider-binding and ./lifecycle/provider-evidence
src/core/client.ts type-only ../lifecycle/provider-evidence type-only ./lifecycle/provider-binding
src/commands/core-installation-cli.ts ../lifecycle/provider-binding ../core/lifecycle/provider-binding
src/services/lifecycle-*.ts ../lifecycle/provider-binding or provider-evidence ../core/lifecycle/provider-binding
remaining src/lifecycle/agent-observation.ts ./provider-binding ../core/lifecycle/provider-binding
src/lifecycle/index.ts barrel ./provider-evidence re-exports Core-internal evidence (existing non-SDK path)
tests that imported src/lifecycle/provider-binding / provider-evidence those paths src/core/lifecycle/provider-binding / provider-evidence

Unchanged for L3+: Core still imports agent-observation, update-planner, agent-execution, uninstall-postcondition, and the barrel.

SDK non-export checklist

  • src/core/index.ts does not export LifecycleProviderBinding, observeLifecycleProvider, resolveInstallMethodProviderBinding, or ./lifecycle
  • packages/core/src/index.ts does not export those symbols
  • Runtime export remains createQuantex only (test/core/import-purity.test.ts)
  • No new packages/core export subpath
  • No src/core/lifecycle/index.ts barrel
  • Existing non-SDK re-exports only: src/lifecycle barrel

Freeze checklist

  • State schema remains v2; receipt JSON field names/requiredness/meanings unchanged
  • --json / NDJSON still omit engine / route
  • Aliases and exit codes untouched
  • No command/SDK expansion; no fold of config/capabilities/commands/schema
  • YAML / release-core.yml / protect-main untouched
  • Shelved OpenSpec changes untouched: release-one-line-delivery, release-pr-skip-human-heuristics, windows-ci-advisory-merge-gate
  • Did not start L3+ (no move/delete of remaining src/lifecycle/*)
  • Did not touch L1 OpenSpec archive path (lifecycle-model-core-internal-l1)

Linked Artifacts

Validation

  • bun run memory:check
  • bun run lint
  • bun run format:check
  • bun run typecheck
  • bun run test — 176 files / 2144 passed / 5 skipped
  • bun run openspec:validate
  • Freeze smoke: install/ensure --dry-run --jsonok=true, warnings[0].code=DRY_RUN, data.changed=false, exit 0, no engine/route
  • SDK import keys remain ["createQuantex"]

Release Intent

  • Release: not applicable - internal helper relocation; no user-facing CLI or SDK change. Changelog framing is refactor: / Internal Improvements and does not bump on its own.

Release Summary

BEGIN_COMMIT_OVERRIDE
refactor(core): move lifecycle provider-binding into Core-internal
END_COMMIT_OVERRIDE

Docs Updated

  • openspec/changes/lifecycle-provider-core-internal-l2/
  • docs/adr/0012-core-internal-lifecycle-provider-binding.md
  • AGENTS.md (thin pointer to provider-binding and ADR 0012)

Scope Check

  • I did not add a new ad hoc root-level Markdown file.
  • I updated the relevant ADR, OpenSpec change, and AGENTS.md pointer.
  • I did not silently expand into L3+, SDK exports, YAML, shelved OpenSpec changes, or the L1 archive path.

Closure Check

  • Working tree was clean after commit.
  • Branch was pushed and this PR is the active delivery artifact.
  • OpenSpec change lifecycle-provider-core-internal-l2 is still active until this merge, then queued for agent-driven archive closure.
  • Release is not applicable (internal refactor; no version bump from this knife).

Notes

  • Draft kept after CI (requested as draft — do not mark ready).
  • Ownership tests now lock: src/lifecycle/provider-binding.ts and provider-evidence.ts absent; src/core/lifecycle/ contains model.ts, provider-binding.ts, provider-evidence.ts and no index.ts; src/state Core imports remain leaf-only.
  • Archive closure waits on merge; this is a complete L2 change, not an umbrella milestone. L1 archive stays a separate PR (chore(openspec): archive lifecycle-model-core-internal-l1 #722).
Open in Web Open in Cursor 

Relocate provider-binding and provider-evidence under src/core/lifecycle/
so Core no longer reverse-depends on src/lifecycle for those helpers.
Keep them unpublished from the SDK; state still imports only the model leaf.
@Drswith
Drswith marked this pull request as ready for review September 7, 2026 04:14
@Drswith
Drswith merged commit e2945a7 into main Sep 7, 2026
14 of 17 checks passed
@Drswith
Drswith deleted the cursor/lifecycle-provider-core-internal-l2-1cd6 branch September 7, 2026 04:14
cursor Bot pushed a commit that referenced this pull request Sep 7, 2026
Sync accepted L2 provider-binding deltas into living specs after #723,
and drop the completed change from the working tree without committing the
generated archive directory.
cursor Bot pushed a commit that referenced this pull request Sep 7, 2026
Sync accepted L2 provider-binding deltas into living specs after #723,
and drop the completed change from the working tree without committing the
generated archive directory.
Drswith added a commit that referenced this pull request Sep 7, 2026
* chore(openspec): archive lifecycle-provider-core-internal-l2

Sync accepted L2 provider-binding deltas into living specs after #723,
and drop the completed change from the working tree without committing the
generated archive directory.

* chore(openspec): hang L2 archive KEEP on lifecycle barrel

Retarget the product-path keep comment to src/lifecycle/index.ts and
revert keep-only churn on src/core/lifecycle/uninstall-postcondition.ts.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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