Repository navigation
Conversation
adapters/typescript/src/effects.ts ports crates/pact-loader/src/effects.rs function for function (ofAction, effectOf, ofAgent, ofSteps, ofStage, effectIs). read-effects.mts prints every agent's and workflow's effect for one shown document, and test_both_ports_compute_one_effect.py holds the port to pact discover on every agent of the corpus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Law 1 in the TypeScript port:
adapters/typescript/src/effects.tscomputes a part's effect exactly ascrates/pact-loader/src/effects.rsdoes, so a runtime that gates calls byeffect:in awhen-this, or builds an agent in code with no tree todiscover, has the checker's answer without the binary. Bud Meta Harness needs it for its PACT kernel (actor.effect) and for agents written in its SDK; it carries this file as a logged local modification until this merges.What changes
adapters/typescript/src/effects.ts:ofAction,effectOf(a<tool>/<action>, a whole tool, an agent, a workflow;seenends a circle),ofAgent,ofSteps,ofStage(a stage's ownundone-by:makes what it calls undoable),worse,effectIs(reads,writes,spends,cannot-be-undone, asEffect::is) anddiscovered(whatpact discoverprints).adapters/typescript/read-effects.mts: prints every agent's and workflow's effect for one shown document.adapters/python/tests/test_both_ports_compute_one_effect.py: runspact showandpact discoveron every example and every tree undertests/trees, and the port on each shown document; every agentdiscoverlists must agree. A second case pins a payment with a refund (undoable, still moves money), a silent action (cannot be undone), and a team (the worst of its members).One difference, stated
A tick is read with
saidYes(yes-no.ts, the five wordscoerce.rs::yes_noaccepts).workflows.rs::said_yes, whicheffects.rsuses, takes three (yes,true,on), soreads-only: y, which the checker accepts as a tick, is a lookup to the port and a write to the checker. No document of the corpus writes such a tick, so the corpus comparison passes; the Rust reading is the one that should followcoerce.rs, and a follow-up can make it.Evidence
pytest tests/test_both_ports_compute_one_effect.py: 2 passed (every corpus agent agrees).tsc --noEmitwith this package's compiler options oversrc/effects.ts,src/yes-no.tsandread-effects.mts: clean.cargo testcounts unchanged.