@playfast/reform-proof 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/engine.ts +345 -0
- package/src/errors.ts +56 -0
- package/src/index.ts +301 -0
- package/src/runner.ts +42 -0
- package/dist/engine.d.ts +0 -18
- package/dist/engine.d.ts.map +0 -1
- package/dist/engine.js +0 -259
- package/dist/engine.js.map +0 -1
- package/dist/errors.d.ts +0 -40
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -23
- package/dist/errors.js.map +0 -1
- package/dist/index.d.ts +0 -176
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -92
- package/dist/index.js.map +0 -1
- package/dist/runner.d.ts +0 -22
- package/dist/runner.d.ts.map +0 -1
- package/dist/runner.js +0 -18
- package/dist/runner.js.map +0 -1
package/dist/errors.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type Cause } from 'effect';
|
|
2
|
-
/**
|
|
3
|
-
* Tagged errors for the proof harness. A failed assertion or a malformed proof
|
|
4
|
-
* navigation throws one of these — tagged and structured, never a bare `Error` —
|
|
5
|
-
* so a runner can distinguish an assertion failure from a harness misuse.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* The constructor shape `Data.TaggedError(tag)<A>` produces, named so the
|
|
9
|
-
* generated `.d.ts` can describe the `extends` base under `isolatedDeclarations`
|
|
10
|
-
* (which forbids an inferred expression in an extends clause).
|
|
11
|
-
*/
|
|
12
|
-
type TaggedErrorClass<Tag extends string, A extends Record<string, unknown>> = new (args: A) => Cause.YieldableError & {
|
|
13
|
-
readonly _tag: Tag;
|
|
14
|
-
} & Readonly<A>;
|
|
15
|
-
declare const AssertionFailedBase: TaggedErrorClass<'reform-proof/AssertionFailed', {
|
|
16
|
-
readonly detail: string;
|
|
17
|
-
}>;
|
|
18
|
-
/** An `expect(...)` matcher did not hold. */
|
|
19
|
-
export declare class AssertionFailed extends AssertionFailedBase {
|
|
20
|
-
get message(): string;
|
|
21
|
-
}
|
|
22
|
-
declare const UnknownActionBase: TaggedErrorClass<'reform-proof/UnknownAction', {
|
|
23
|
-
readonly composition: string;
|
|
24
|
-
readonly action: string;
|
|
25
|
-
readonly rendered: number;
|
|
26
|
-
}>;
|
|
27
|
-
/** A proof referenced an action the rendered composition never exposed. */
|
|
28
|
-
export declare class UnknownAction extends UnknownActionBase {
|
|
29
|
-
get message(): string;
|
|
30
|
-
}
|
|
31
|
-
declare const UnknownSlotBase: TaggedErrorClass<'reform-proof/UnknownSlot', {
|
|
32
|
-
readonly parent: string;
|
|
33
|
-
readonly slot: string;
|
|
34
|
-
}>;
|
|
35
|
-
/** A proof navigated into a slot the parent composition does not declare. */
|
|
36
|
-
export declare class UnknownSlot extends UnknownSlotBase {
|
|
37
|
-
get message(): string;
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
40
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAQ,MAAM,QAAQ,CAAA;AAEzC;;;;GAIG;AAEH;;;;GAIG;AACH,KAAK,gBAAgB,CAAC,GAAG,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,KAC7E,IAAI,EAAE,CAAC,KACJ,KAAK,CAAC,cAAc,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAA;CAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAEhE,QAAA,MAAM,mBAAmB,EAAE,gBAAgB,CACzC,8BAA8B,EAC9B;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CACoD,CAAA;AAEjF,6CAA6C;AAC7C,qBAAa,eAAgB,SAAQ,mBAAmB;IACtD,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAED,QAAA,MAAM,iBAAiB,EAAE,gBAAgB,CACvC,4BAA4B,EAC5B;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAKpF,CAAA;AAEF,2EAA2E;AAC3E,qBAAa,aAAc,SAAQ,iBAAiB;IAClD,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAED,QAAA,MAAM,eAAe,EAAE,gBAAgB,CACrC,0BAA0B,EAC1B;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CACgD,CAAA;AAEpG,6EAA6E;AAC7E,qBAAa,WAAY,SAAQ,eAAe;IAC9C,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF"}
|
package/dist/errors.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Data } from 'effect';
|
|
2
|
-
const AssertionFailedBase = (Data.TaggedError('reform-proof/AssertionFailed'));
|
|
3
|
-
/** An `expect(...)` matcher did not hold. */
|
|
4
|
-
export class AssertionFailed extends AssertionFailedBase {
|
|
5
|
-
get message() {
|
|
6
|
-
return `reform-proof: assertion failed — ${this.detail}`;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
const UnknownActionBase = (Data.TaggedError('reform-proof/UnknownAction'));
|
|
10
|
-
/** A proof referenced an action the rendered composition never exposed. */
|
|
11
|
-
export class UnknownAction extends UnknownActionBase {
|
|
12
|
-
get message() {
|
|
13
|
-
return `reform-proof: '${this.composition}' has no action '${this.action}' (rendered ${this.rendered} instance(s))`;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const UnknownSlotBase = (Data.TaggedError('reform-proof/UnknownSlot'));
|
|
17
|
-
/** A proof navigated into a slot the parent composition does not declare. */
|
|
18
|
-
export class UnknownSlot extends UnknownSlotBase {
|
|
19
|
-
get message() {
|
|
20
|
-
return `reform-proof: '${this.parent}' has no slot '${this.slot}'`;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,IAAI,EAAE,MAAM,QAAQ,CAAA;AAiBzC,MAAM,mBAAmB,GAGrB,CAAA,IAAI,CAAC,WAAW,CAAC,8BAA8B,CAA8B,CAAA,CAAA;AAEjF,6CAA6C;AAC7C,MAAM,OAAO,eAAgB,SAAQ,mBAAmB;IACtD,IAAa,OAAO;QAClB,OAAO,oCAAoC,IAAI,CAAC,MAAM,EAAE,CAAA;IAC1D,CAAC;CACF;AAED,MAAM,iBAAiB,GAGnB,CAAA,IAAI,CAAC,WAAW,CAAC,4BAA4B,CAI/C,CAAA,CAAA;AAEF,2EAA2E;AAC3E,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAClD,IAAa,OAAO;QAClB,OAAO,kBAAkB,IAAI,CAAC,WAAW,oBAAoB,IAAI,CAAC,MAAM,eAAe,IAAI,CAAC,QAAQ,eAAe,CAAA;IACrH,CAAC;CACF;AAED,MAAM,eAAe,GAGjB,CAAA,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAqD,CAAA,CAAA;AAEpG,6EAA6E;AAC7E,MAAM,OAAO,WAAY,SAAQ,eAAe;IAC9C,IAAa,OAAO;QAClB,OAAO,kBAAkB,IAAI,CAAC,MAAM,kBAAkB,IAAI,CAAC,IAAI,GAAG,CAAA;IACpE,CAAC;CACF"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import type { YieldWrap } from 'effect/Utils';
|
|
3
|
-
import { ProofRunner, type ProofRunnerApi, proofRunnerLayer, withProofRunner } from './runner';
|
|
4
|
-
import type { CompositionClass, CompositionService, Scene, SlotInstance, Trigger, UiCapture, UiContract } from '@playfast/reform';
|
|
5
|
-
export { ProofRunner, proofRunnerLayer, withProofRunner };
|
|
6
|
-
export type { ProofRunnerApi };
|
|
7
|
-
/** Any composition, used where the contract type is irrelevant. */
|
|
8
|
-
type AnyComposition = CompositionClass<any, any>;
|
|
9
|
-
export interface RequirementManifest<Comp extends AnyComposition, Statement extends string> {
|
|
10
|
-
readonly kind: 'ProductRequirement';
|
|
11
|
-
readonly name: Statement;
|
|
12
|
-
/** The human-readable behavioural statement; doubles as the manifest name. */
|
|
13
|
-
readonly statement: Statement;
|
|
14
|
-
/** The composition this requirement specifies — its contract types the facade. */
|
|
15
|
-
readonly composition: Comp;
|
|
16
|
-
}
|
|
17
|
-
export interface RequirementClass<Comp extends AnyComposition, Statement extends string> {
|
|
18
|
-
new (): {};
|
|
19
|
-
readonly manifest: RequirementManifest<Comp, Statement>;
|
|
20
|
-
}
|
|
21
|
-
export interface ProductManifest<Comp extends AnyComposition> {
|
|
22
|
-
readonly kind: 'Product';
|
|
23
|
-
readonly name: string;
|
|
24
|
-
readonly composition: Comp;
|
|
25
|
-
readonly requirements: ReadonlyArray<RequirementClass<Comp, string>>;
|
|
26
|
-
}
|
|
27
|
-
export interface ProductClass<Comp extends AnyComposition = AnyComposition> {
|
|
28
|
-
new (): {};
|
|
29
|
-
readonly manifest: ProductManifest<Comp>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* A named, human-readable behavioural statement bound to the composition it
|
|
33
|
-
* specifies. The composition types the proof facade; the statement's literal
|
|
34
|
-
* type is re-stated (and enforced) at `Proof.implement`.
|
|
35
|
-
*/
|
|
36
|
-
declare const makeRequirement: <Comp extends AnyComposition, const Statement extends string>(composition: Comp, statement: Statement) => RequirementClass<Comp, Statement>;
|
|
37
|
-
export declare const ProductRequirement: {
|
|
38
|
-
readonly make: typeof makeRequirement;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Group a composition with the full list of requirements that specify it. The
|
|
42
|
-
* shared `Comp` type-checks that every requirement targets this composition.
|
|
43
|
-
*/
|
|
44
|
-
declare const makeProduct: <Comp extends AnyComposition>(composition: Comp, config: {
|
|
45
|
-
readonly requirements: ReadonlyArray<RequirementClass<Comp, string>>;
|
|
46
|
-
}) => ProductClass<Comp>;
|
|
47
|
-
export declare const Product: {
|
|
48
|
-
readonly make: typeof makeProduct;
|
|
49
|
-
};
|
|
50
|
-
export declare const expect: <A>(actual: A) => {
|
|
51
|
-
toBe: (expected: A) => Effect.Effect<void>;
|
|
52
|
-
toEqual: (expected: A) => Effect.Effect<void>;
|
|
53
|
-
toContain: (expected: A extends ReadonlyArray<infer E> ? E : unknown) => Effect.Effect<void>;
|
|
54
|
-
};
|
|
55
|
-
/** The event payloads of a contract, keyed by event name. */
|
|
56
|
-
type EventsOf<C extends UiContract> = C extends {
|
|
57
|
-
events: infer E;
|
|
58
|
-
} ? E : Record<never, never>;
|
|
59
|
-
/** The slot instances of a contract, keyed by slot name. */
|
|
60
|
-
type SlotsOf<C extends UiContract> = C extends {
|
|
61
|
-
slots: infer S;
|
|
62
|
-
} ? S : Record<never, never>;
|
|
63
|
-
/** The payload a trigger accepts. */
|
|
64
|
-
type PayloadOf<T> = T extends Trigger<infer P> ? P : never;
|
|
65
|
-
/** The UI contract a composition resolves. */
|
|
66
|
-
export type ContractOf<Comp> = Comp extends CompositionClass<any, infer C> ? C : never;
|
|
67
|
-
/** The child contract a slot stands for — the contract of the composition it holds. */
|
|
68
|
-
type ContractOfSlot<S> = S extends SlotInstance<infer Comp> ? ContractOf<Comp> : never;
|
|
69
|
-
/** The contract's events as facade actions: payload in, dispatch-and-settle Effect out. */
|
|
70
|
-
export type ActionsOf<C extends UiContract> = {
|
|
71
|
-
readonly [K in keyof EventsOf<C>]: (payload: PayloadOf<EventsOf<C>[K]>) => Effect.Effect<void, never, CompositionService>;
|
|
72
|
-
};
|
|
73
|
-
/** The contract's slots as child facades, each typed by the child's own contract. */
|
|
74
|
-
export type SlotFacadesOf<C extends UiContract> = {
|
|
75
|
-
readonly [K in keyof SlotsOf<C>]: SlotFacade<ContractOfSlot<SlotsOf<C>[K]>>;
|
|
76
|
-
};
|
|
77
|
-
/** The Effect a facade action returns: dispatch the event, then settle. */
|
|
78
|
-
export type Action = (payload: unknown) => Effect.Effect<void, never, CompositionService>;
|
|
79
|
-
/**
|
|
80
|
-
* The handle a proof drives — the same surface the production UI receives, fully
|
|
81
|
-
* typed from the composition's contract `C`: read state (`props`), trigger events
|
|
82
|
-
* (`actions`), reach children (`slots`), and wait for the next frame (`frame`).
|
|
83
|
-
* Each access yields a real Effect/SlotFacade against the running engine.
|
|
84
|
-
*/
|
|
85
|
-
export interface Facade<C extends UiContract> {
|
|
86
|
-
/** Re-render the tree and read the props this node last computed. */
|
|
87
|
-
readonly props: Effect.Effect<C['props'], never, CompositionService>;
|
|
88
|
-
/** The contract's events as callables; calling one dispatches and settles. */
|
|
89
|
-
readonly actions: ActionsOf<C>;
|
|
90
|
-
/** Child composition facades, keyed by slot name. */
|
|
91
|
-
readonly slots: SlotFacadesOf<C>;
|
|
92
|
-
/** Settle the engine and re-render — wait for the next stable frame. */
|
|
93
|
-
readonly frame: Effect.Effect<void, never, CompositionService>;
|
|
94
|
-
}
|
|
95
|
-
/** A slot may hold many instances (a list); it is also usable as its first one. */
|
|
96
|
-
export interface SlotFacade<C extends UiContract> extends Facade<C> {
|
|
97
|
-
readonly first: Effect.Effect<Facade<C>, never, CompositionService>;
|
|
98
|
-
readonly at: (index: number) => Effect.Effect<Facade<C>, never, CompositionService>;
|
|
99
|
-
readonly all: Effect.Effect<ReadonlyArray<Facade<C>>, never, CompositionService>;
|
|
100
|
-
}
|
|
101
|
-
/** The generator a proof body produces — its yielded effects run on the engine. */
|
|
102
|
-
type ProofGenerator = Generator<YieldWrap<Effect.Effect<unknown, unknown, CompositionService>>, void, unknown>;
|
|
103
|
-
/** An erased facade — the runtime shape before the contract type is re-attached. */
|
|
104
|
-
type AnyFacade = Facade<UiContract>;
|
|
105
|
-
/** The erased body stored on a `Proof` value; `implement` types the contract in. */
|
|
106
|
-
export type ProofBody = (app: AnyFacade) => ProofGenerator;
|
|
107
|
-
export interface Proof {
|
|
108
|
-
readonly requirement: RequirementClass<AnyComposition, string>;
|
|
109
|
-
/** The scene this proof runs against: its closed wiring + boot events. */
|
|
110
|
-
readonly scene: Scene;
|
|
111
|
-
readonly body: ProofBody;
|
|
112
|
-
}
|
|
113
|
-
export interface ProofSuite {
|
|
114
|
-
/** Brand so adapters can duck-type a suite among a module's exports. */
|
|
115
|
-
readonly kind: 'ProofSuite';
|
|
116
|
-
readonly product: ProductClass;
|
|
117
|
-
readonly proofs: ReadonlyArray<Proof>;
|
|
118
|
-
}
|
|
119
|
-
export interface ProofResult {
|
|
120
|
-
readonly requirement: string;
|
|
121
|
-
readonly ok: boolean;
|
|
122
|
-
readonly error?: string;
|
|
123
|
-
}
|
|
124
|
-
export interface SuiteResult {
|
|
125
|
-
readonly product: string;
|
|
126
|
-
readonly results: ReadonlyArray<ProofResult>;
|
|
127
|
-
readonly ok: boolean;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Implement (prove) a requirement by driving the facade against a scene. A proof
|
|
131
|
-
* is a VALUE. The scene supplies the runtime (its closed `provide` + `boot`) and
|
|
132
|
-
* the composition that types the facade; its contract must equal the
|
|
133
|
-
* requirement's composition contract, so a scene for the wrong composition — or
|
|
134
|
-
* one whose contract has drifted — is a compile error. The `app` facade is fully
|
|
135
|
-
* typed from that contract.
|
|
136
|
-
*/
|
|
137
|
-
declare const implement: <Comp extends AnyComposition>(requirement: RequirementClass<Comp, string>, scene: Scene<ContractOf<Comp>>, body: (app: Facade<ContractOf<Comp>>) => ProofGenerator) => Proof;
|
|
138
|
-
/** Compose proofs with the product whose requirements they prove. */
|
|
139
|
-
declare const suite: (product: ProductClass, config: {
|
|
140
|
-
readonly proofs: ReadonlyArray<Proof>;
|
|
141
|
-
}) => ProofSuite;
|
|
142
|
-
/** Duck-type a `ProofSuite` among arbitrary module exports (the adapter's seam). */
|
|
143
|
-
export declare const isProofSuite: (value: unknown) => value is ProofSuite;
|
|
144
|
-
/**
|
|
145
|
-
* Run every proof against a fresh runtime, returning per-requirement results.
|
|
146
|
-
* Each proof gets its own environment, so nothing leaks between proofs. Execution
|
|
147
|
-
* goes through the injected `ProofRunner` (the headless engine by default).
|
|
148
|
-
*/
|
|
149
|
-
declare const run: (proofSuite: ProofSuite) => Promise<SuiteResult>;
|
|
150
|
-
/** One step of a driven proof: the rendered tree captured right after the
|
|
151
|
-
* proof's i-th yielded effect settled. Index 0 is the booted, pre-drive tree. */
|
|
152
|
-
export interface StepFrame {
|
|
153
|
-
readonly index: number;
|
|
154
|
-
readonly captures: ReadonlyArray<UiCapture>;
|
|
155
|
-
}
|
|
156
|
-
export interface DriveResult {
|
|
157
|
-
readonly requirement: string;
|
|
158
|
-
readonly frames: ReadonlyArray<StepFrame>;
|
|
159
|
-
readonly ok: boolean;
|
|
160
|
-
readonly error?: string;
|
|
161
|
-
}
|
|
162
|
-
export interface ProofDriver {
|
|
163
|
-
readonly requirement: string;
|
|
164
|
-
/** Run the proof, snapshotting the captured tree after each yielded step. */
|
|
165
|
-
readonly run: () => Promise<DriveResult>;
|
|
166
|
-
}
|
|
167
|
-
/** A driver per proof in the suite — the editor's Test-play entry point. Each
|
|
168
|
-
* `run` resolves the same `ProofRunner` layer and steps that proof. */
|
|
169
|
-
declare const driver: (proofSuite: ProofSuite) => ReadonlyArray<ProofDriver>;
|
|
170
|
-
export declare const Proof: {
|
|
171
|
-
readonly implement: typeof implement;
|
|
172
|
-
readonly suite: typeof suite;
|
|
173
|
-
readonly run: typeof run;
|
|
174
|
-
readonly driver: typeof driver;
|
|
175
|
-
};
|
|
176
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index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A;CACK,CAAA"}
|
package/dist/index.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import { AssertionFailed } from './errors';
|
|
3
|
-
import { ProofRunner, proofRunnerLayer, withProofRunner } from './runner';
|
|
4
|
-
// reform-proof — the stability story for AI authorship. Product behaviour is
|
|
5
|
-
// declared as human-readable requirements (the definition) and proven by tests
|
|
6
|
-
// (the implementation), the same split as the rest of reform. A proof drives the
|
|
7
|
-
// real reduce loop through a headless FACADE: no DOM, no text matching. It reads
|
|
8
|
-
// the props each composition computed and calls the contract's events as
|
|
9
|
-
// callbacks — exactly what the production UI receives. HOW a proof runs is the
|
|
10
|
-
// injectable `ProofRunner` layer (./runner); the headless engine (./engine) is its
|
|
11
|
-
// default. `Proof.run`/`Proof.driver` resolve that layer, so the vitest adapter
|
|
12
|
-
// can drive the very same proofs as native tests.
|
|
13
|
-
// The injectable execution seam is re-exported so adapters can resolve it.
|
|
14
|
-
export { ProofRunner, proofRunnerLayer, withProofRunner };
|
|
15
|
-
/**
|
|
16
|
-
* A named, human-readable behavioural statement bound to the composition it
|
|
17
|
-
* specifies. The composition types the proof facade; the statement's literal
|
|
18
|
-
* type is re-stated (and enforced) at `Proof.implement`.
|
|
19
|
-
*/
|
|
20
|
-
const makeRequirement = (composition, statement) => Object.assign(class {
|
|
21
|
-
}, {
|
|
22
|
-
manifest: { kind: 'ProductRequirement', name: statement, statement, composition },
|
|
23
|
-
});
|
|
24
|
-
export const ProductRequirement = {
|
|
25
|
-
make: makeRequirement,
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Group a composition with the full list of requirements that specify it. The
|
|
29
|
-
* shared `Comp` type-checks that every requirement targets this composition.
|
|
30
|
-
*/
|
|
31
|
-
const makeProduct = (composition, config) => Object.assign(class {
|
|
32
|
-
}, {
|
|
33
|
-
manifest: {
|
|
34
|
-
kind: 'Product',
|
|
35
|
-
name: composition.manifest.name,
|
|
36
|
-
composition,
|
|
37
|
-
requirements: config.requirements,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
export const Product = { make: makeProduct };
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
// Assertions — Effect-returning matchers; a failed match fails the proof.
|
|
43
|
-
// ---------------------------------------------------------------------------
|
|
44
|
-
const deepEqual = (a, b) => Object.is(a, b) || JSON.stringify(a) === JSON.stringify(b);
|
|
45
|
-
const fail = (message) => Effect.sync(() => {
|
|
46
|
-
throw new AssertionFailed({ detail: message });
|
|
47
|
-
});
|
|
48
|
-
export const expect = (actual) => ({
|
|
49
|
-
toBe: (expected) => Object.is(actual, expected)
|
|
50
|
-
? Effect.void
|
|
51
|
-
: fail(`expected ${JSON.stringify(actual)} to be ${JSON.stringify(expected)}`),
|
|
52
|
-
toEqual: (expected) => deepEqual(actual, expected)
|
|
53
|
-
? Effect.void
|
|
54
|
-
: fail(`expected ${JSON.stringify(actual)} to equal ${JSON.stringify(expected)}`),
|
|
55
|
-
toContain: (expected) => Array.isArray(actual) && actual.some((item) => deepEqual(item, expected))
|
|
56
|
-
? Effect.void
|
|
57
|
-
: fail(`expected ${JSON.stringify(actual)} to contain ${JSON.stringify(expected)}`),
|
|
58
|
-
});
|
|
59
|
-
/**
|
|
60
|
-
* Implement (prove) a requirement by driving the facade against a scene. A proof
|
|
61
|
-
* is a VALUE. The scene supplies the runtime (its closed `provide` + `boot`) and
|
|
62
|
-
* the composition that types the facade; its contract must equal the
|
|
63
|
-
* requirement's composition contract, so a scene for the wrong composition — or
|
|
64
|
-
* one whose contract has drifted — is a compile error. The `app` facade is fully
|
|
65
|
-
* typed from that contract.
|
|
66
|
-
*/
|
|
67
|
-
const implement = (requirement, scene, body) => ({ requirement, scene, body: body });
|
|
68
|
-
/** Compose proofs with the product whose requirements they prove. */
|
|
69
|
-
const suite = (product, config) => ({ kind: 'ProofSuite', product, proofs: config.proofs });
|
|
70
|
-
const isRecord = (value) => typeof value === 'object' && value !== null;
|
|
71
|
-
/** Duck-type a `ProofSuite` among arbitrary module exports (the adapter's seam). */
|
|
72
|
-
export const isProofSuite = (value) => isRecord(value) && value['kind'] === 'ProofSuite' && Array.isArray(value['proofs']);
|
|
73
|
-
/**
|
|
74
|
-
* Run every proof against a fresh runtime, returning per-requirement results.
|
|
75
|
-
* Each proof gets its own environment, so nothing leaks between proofs. Execution
|
|
76
|
-
* goes through the injected `ProofRunner` (the headless engine by default).
|
|
77
|
-
*/
|
|
78
|
-
const run = (proofSuite) => withProofRunner(async (runner) => {
|
|
79
|
-
const results = [];
|
|
80
|
-
for (const proof of proofSuite.proofs) {
|
|
81
|
-
results.push(await runner.executeProof(proof));
|
|
82
|
-
}
|
|
83
|
-
return { product: proofSuite.product.manifest.name, results, ok: results.every((r) => r.ok) };
|
|
84
|
-
});
|
|
85
|
-
/** A driver per proof in the suite — the editor's Test-play entry point. Each
|
|
86
|
-
* `run` resolves the same `ProofRunner` layer and steps that proof. */
|
|
87
|
-
const driver = (proofSuite) => proofSuite.proofs.map((proof) => ({
|
|
88
|
-
requirement: proof.requirement.manifest.statement,
|
|
89
|
-
run: () => withProofRunner((runner) => runner.driveProof(proof)),
|
|
90
|
-
}));
|
|
91
|
-
export const Proof = { implement, suite, run, driver };
|
|
92
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAuB,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAW9F,6EAA6E;AAC7E,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,yEAAyE;AACzE,+EAA+E;AAC/E,mFAAmF;AACnF,gFAAgF;AAChF,kDAAkD;AAElD,2EA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,CAAC,CAAA;AAEL,MAAM,CAAC,MAAM,KAAK,GAKd,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA"}
|
package/dist/runner.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Context, Layer } from 'effect';
|
|
2
|
-
import type { DriveResult, Proof, ProofResult } from './index';
|
|
3
|
-
export interface ProofRunnerApi {
|
|
4
|
-
/** Run a proof to completion, returning its pass/fail result. */
|
|
5
|
-
readonly executeProof: (proof: Proof) => Promise<ProofResult>;
|
|
6
|
-
/** Step a proof a frame at a time (the editor's Test-play timeline). */
|
|
7
|
-
readonly driveProof: (proof: Proof) => Promise<DriveResult>;
|
|
8
|
-
}
|
|
9
|
-
declare const ProofRunnerBase: Context.TagClass<ProofRunner, 'reform-proof/ProofRunner', ProofRunnerApi>;
|
|
10
|
-
/** The service identity for the proof execution strategy. */
|
|
11
|
-
export declare class ProofRunner extends ProofRunnerBase {
|
|
12
|
-
}
|
|
13
|
-
/** The default runner: the headless engine that drives the real reduce loop. */
|
|
14
|
-
export declare const proofRunnerLayer: Layer.Layer<ProofRunner>;
|
|
15
|
-
/**
|
|
16
|
-
* Resolve the `ProofRunner` from `proofRunnerLayer` and use it — the single seam
|
|
17
|
-
* the proof system (`Proof.run`/`Proof.driver`) and the vitest adapter both run
|
|
18
|
-
* through, so every proof executes via the same injectable engine.
|
|
19
|
-
*/
|
|
20
|
-
export declare const withProofRunner: <A>(use: (runner: ProofRunnerApi) => Promise<A>) => Promise<A>;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=runner.d.ts.map
|
package/dist/runner.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAS9D,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;IAC7D,wEAAwE;IACxE,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;CAC5D;AAED,QAAA,MAAM,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,0BAA0B,EAAE,cAAc,CACvB,CAAA;AAExE,6DAA6D;AAC7D,qBAAa,WAAY,SAAQ,eAAe;CAAG;AAEnD,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAGpD,CAAA;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAMvF,CAAA"}
|
package/dist/runner.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Context, Effect, Layer } from 'effect';
|
|
2
|
-
import { driveProof, executeProof } from './engine';
|
|
3
|
-
const ProofRunnerBase = Context.Tag('reform-proof/ProofRunner')();
|
|
4
|
-
/** The service identity for the proof execution strategy. */
|
|
5
|
-
export class ProofRunner extends ProofRunnerBase {
|
|
6
|
-
}
|
|
7
|
-
/** The default runner: the headless engine that drives the real reduce loop. */
|
|
8
|
-
export const proofRunnerLayer = Layer.succeed(ProofRunner, {
|
|
9
|
-
executeProof,
|
|
10
|
-
driveProof,
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* Resolve the `ProofRunner` from `proofRunnerLayer` and use it — the single seam
|
|
14
|
-
* the proof system (`Proof.run`/`Proof.driver`) and the vitest adapter both run
|
|
15
|
-
* through, so every proof executes via the same injectable engine.
|
|
16
|
-
*/
|
|
17
|
-
export const withProofRunner = (use) => Effect.runPromise(ProofRunner.pipe(Effect.flatMap((runner) => Effect.promise(() => use(runner))), Effect.provide(proofRunnerLayer)));
|
|
18
|
-
//# sourceMappingURL=runner.js.map
|
package/dist/runner.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAiBnD,MAAM,eAAe,GACnB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,EAA+B,CAAA;AAExE,6DAA6D;AAC7D,MAAM,OAAO,WAAY,SAAQ,eAAe;CAAG;AAEnD,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAA6B,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE;IACnF,YAAY;IACZ,UAAU;CACX,CAAC,CAAA;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,GAA2C,EAAc,EAAE,CAC5F,MAAM,CAAC,UAAU,CACf,WAAW,CAAC,IAAI,CACd,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAC7D,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CACjC,CACF,CAAA"}
|