refactor(control-plane): move Effect Program authority to TypeScript - #3416
Merged
Conversation
Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
This is the first bounded TypeScript control-plane cutover. It moves the canonical Effect Program, settlement algebra, Turn-journal interpretation, and durable Turn-journal checkpoint effect to TypeScript while preserving the existing Python CLI and adapter APIs.
The repository does not retain two semantic engines:
effect_program.tsowns Effect and settlement rules;effect_program.pyandsettlement_driver.pysurfaces are compatibility/callback facades into one managed runtime;The managed runtime is started on demand, reused across CLI calls, bound to loopback with a private token, rotated by a source fingerprint, recovered after stale metadata/start locks or crashes, and released after idle. Users do not manually manage a daemon.
loopx doctorprojects readiness, lifecycle, and public-safe diagnostic codes.The TS runtime owns one real durable side effect in this slice: Turn-journal checkpoints use a same-key lock, previous-content CAS, operation identities, atomic replacement, and file fsync. A lost response can therefore be retried without duplicating or overwriting another effect.
Latest-main integration: #3342
This branch is rebased on
6e7dd0a0a/ #3342. That change adds the provider-neutral Claude/Kunlun host settlement path and importsSettlementIdentity. Under this cutover, that shipping adapter path becomes a real consumer of the TS authority.Packaging and upgrade contract
stoppedis a healthy idle state and that missing/unsupported Node fails closed rather than falling back to Python semantics;Validation
cqr_74e886dd711b0f29eb77, valid, 0 blockersThe scoped exploratory mypy comparison outside the repository-configured portfolio reports 20 existing errors on the candidate versus 21 on main. It is not used to turn a non-zero exploratory command into a passing oracle; the repository-declared strict mypy command itself passes.
Performance characterization
The checkpoint difference is deliberate durability work, not attributed to TypeScript alone: the new path adds RPC, file fsync, same-key locking, CAS, and operation-id calculation. This remains an explicit owner-review advisory.
A paired
loopx doctor --deepcomparison was noisy but showed no material regression: main p50 8,237.619 ms / p95 10,168.998 ms; candidate p50 7,942.542 ms / p95 8,176.975 ms; paired mean delta -1,034.505 ms. Both returned non-zero because unrelated ambient doctor checks were not clean, so this is reported only as comparative timing, not a correctness pass.Failures, corrections, and excluded evidence
PATHso aggressively that Node disappeared; nine runtime failures were test-environment errors. The final portfolio uses the normal Node path with only Git configuration isolation and passes 173/173.HEADmust still expose the old Python interpreter was removed together with its embedded old semantic worker. Exact parity was rerun against final HEAD using an external pre-cutover harness, so the evidence remains while the repository avoids dual semantics.semantic_probeas an object although its contract is the stringpassed; the corrected wheel and sdist probes both pass.Owner review decisions
Please review this PR before any later migration slice. The two intentional costs are:
No later core-control-plane migration is included here, and this PR should not be merged until those tradeoffs and the remote CI results are accepted.