Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
3ccb7bd
test: attribute failure journals to declaring cases
taras Nov 16, 2026
41946db
test: capture failure journals for Testing document cases
taras Nov 16, 2026
0a1f45e
test: capture failure journals for live WebForm cases
taras Nov 16, 2026
e9aef6f
test: capture failure journals for held Core hosts
taras Nov 16, 2026
72a360f
test: retain the ORC12 child journal for parent failures
taras Nov 16, 2026
d6398b9
test: attribute journals in ordinary Git execution cases
taras Nov 16, 2026
78360b8
test: attribute journals in direct Core document cases
taras Nov 16, 2026
2c56e87
test: attribute failure journals for live synthetic REPL entries
taras Nov 16, 2026
a633714
test: attribute guarded ACP and TestAgent execution journals
taras Nov 16, 2026
1be6fa0
test: attribute safe Agent and nested Testing execution journals
taras Nov 16, 2026
576f139
test: attribute fresh REPL observation entry journals
taras Nov 16, 2026
7de6ad0
test: capture additional direct Core execution journals
taras Nov 16, 2026
e9d5c7f
test: attribute fresh workflow observation journals
taras Nov 16, 2026
a12074a
test: attribute fresh CLI and Testing execution journals
taras Nov 16, 2026
5003c32
test: attribute fresh Git issue scenario journals
taras Nov 16, 2026
81ef099
test: retain separate CLI assembly journals for parent failures
taras Nov 16, 2026
88cc32c
test: attribute guarded CLI host and upgrade journals
taras Nov 16, 2026
3409f1d
test: attribute guarded Agent provider and usage journals
taras Nov 16, 2026
da0ecf3
test: attribute fresh Answers, Elicit and Fail fixture journals
taras Nov 16, 2026
468000c
test: attribute fresh TestAgent component and launch journals
taras Nov 16, 2026
adb9c60
test: capture fresh inline REPL selection journals
taras Nov 16, 2026
113b89c
test: capture guarded Glob fixture journals
taras Nov 16, 2026
3421bee
test: attribute guarded Agent function component journals
taras Nov 16, 2026
1143a70
test: retain separate journals for Testing session siblings
taras Nov 16, 2026
b310585
test: capture guarded Core prop evaluation journals
taras Nov 16, 2026
dbb0571
test: preserve independently bounded subprocess journals
taras Nov 16, 2026
c5deede
test: capture additional held host and hook journals
taras Nov 16, 2026
4e77e93
test: capture guarded root comparisons and eval lifetimes
taras Nov 16, 2026
d0ed304
test: capture complete Testing activation sessions
taras Nov 16, 2026
389ab30
test: attribute guarded exec timeout fixture journals
taras Nov 16, 2026
3391a0f
test: retain the activation expiry fixture journal
taras Nov 16, 2026
90828d1
test: attribute guarded Core document helpers
taras Nov 16, 2026
e6d3589
test: attribute guarded Agent package execution controls
taras Nov 16, 2026
20636df
test: attribute guarded Git and Workflow host probes
taras Nov 16, 2026
1dc1607
test: attribute guarded Plan and Upgrade documents
taras Nov 16, 2026
c84628f
test: attribute fresh REPL source ownership runs
taras Nov 16, 2026
d9a16f3
test: attribute fresh Git binding and Issue envelopes
taras Nov 16, 2026
68b2cf9
test: attribute fresh Workflow and Testing journals
taras Nov 16, 2026
5e93fa6
test: preserve both workflow inputs in identity comparison
taras Nov 16, 2026
5289ed5
test: attribute fresh Core execution and comparison owners
taras Nov 16, 2026
260cdba
test: attribute joined read-only component subprocess journals
taras Nov 16, 2026
025238c
test: attribute loader comparisons and a fresh REPL refusal
taras Nov 16, 2026
f192591
test: attribute independent Git reconciliation runs
taras Nov 16, 2026
b8aa8db
Expose the shared test journal resource
taras Nov 17, 2026
dd651ac
Adopt shared journals in Core evaluator tests
taras Nov 17, 2026
fa56f41
Adopt shared journal resource in Each tests
taras Nov 17, 2026
6d8c9a5
Use shared failure journal package in evaluator cases
taras Nov 17, 2026
6cf50a4
Migrate Core cases to shared journal resource
taras Nov 17, 2026
2261675
test: adopt shared journal resource in #1356 consumers
taras Nov 17, 2026
b32a928
Integrate #1356 shared journal consumers
taras Nov 17, 2026
103aee9
Use package journal entry in Core stream tests
taras Nov 17, 2026
40c725b
Complete shared journal imports in #1356
taras Nov 17, 2026
00e78f8
merge signed failure journal foundation into #1357
taras Nov 17, 2026
71a0581
migrate #1357 ordinary journal cases to shared fixtures
taras Nov 17, 2026
db52b8c
Merge commit 'b8aa8db95573b84b0319d31d3948625eae7ebaef' into codex/lu…
taras Nov 17, 2026
fd67a87
Merge shared journal foundation into #1359
taras Nov 17, 2026
49db826
Migrate compiler boundary cases to shared failure journal
taras Nov 17, 2026
5cdf6d8
Use shared journal package imports in #1359 tests
taras Nov 17, 2026
9effd30
Use shared journal fixture in testing boundary cases
taras Nov 17, 2026
fdc1271
Use shared journal fixture for checkpoint case
taras Nov 17, 2026
c076e76
merge complete #1356 candidate into #1357
taras Nov 17, 2026
2cb79b2
Format #1356 shared journal tests
taras Nov 17, 2026
3e7ae5a
Integrate Luna formatting correction for #1356
taras Nov 17, 2026
b782964
merge formatter-corrected #1356 parent into #1357
taras Nov 17, 2026
238c64b
Migrate eligible journal owners to shared fixtures
taras Nov 17, 2026
ae0e769
Merge branch 'codex/luna-1357-reviewed' into codex/luna-1358-shared-j…
taras Nov 17, 2026
eedf19d
Integrate shared journal migration through #1359
taras Nov 17, 2026
86ff173
Restore #1359 journal ownership for nested tests
taras Nov 17, 2026
038a1df
Restore attributed owners in Core journal suites
taras Nov 17, 2026
7159cac
fix(core): restore D5 failure journal ownership
taras Nov 17, 2026
0fd285d
Restore direct it registration in Core held-host tests
Nov 17, 2026
53cb39c
Migrate assert throws journal ownership
taras Nov 17, 2026
c79ae82
Migrate testing boundary journal owner
taras Nov 17, 2026
c76ed7a
Restore direct test declarations in Agent, REPL and Web
taras Nov 17, 2026
2892509
Migrate testing boundary contract cases
taras Nov 17, 2026
a93742e
Migrate test component journal cases
taras Nov 17, 2026
49427d0
Migrate use testing journal cases
taras Nov 17, 2026
80c758d
Keep ordinary test declarations in two Testing suites
taras Nov 17, 2026
d33f642
Migrate workflow generated observation cases
taras Nov 17, 2026
27f6e4a
Remove unused journal case registrar
taras Nov 17, 2026
9a44b71
Integrate direct declarations in Testing and Workflow
taras Nov 17, 2026
4e12648
Remove unused testing case registrar
taras Nov 17, 2026
f7b8ea0
Restore direct it registration in Git tests
Nov 17, 2026
b9a7acf
Restore direct test declarations throughout the base journal PR
taras Nov 17, 2026
8dfb8a6
Restore direct Glob and TestAgent test declarations
taras Nov 17, 2026
feb2f97
Restore direct test declarations in #1358 suites
taras Nov 17, 2026
44d1a8b
Restore direct declarations for held-host cases
taras Nov 17, 2026
6f2c313
Carry direct test declarations into the bounded journal PR
taras Nov 17, 2026
5204275
Restore direct Git and Workflow test declarations
taras Nov 17, 2026
c5d4825
Merge revised #1357 journal registration migration into #1358
taras Nov 17, 2026
f1e2be2
Keep direct Testing declarations in the #1359 overlap
taras Nov 17, 2026
ec6959e
Integrate direct test declarations through #1359
taras Nov 17, 2026
7f31609
Capture failure journals across guarded test executions
taras Nov 17, 2026
d398db9
Preserve #1359 scope after rebasing #1358
taras Nov 17, 2026
eb2e590
Resolve #1359 ancestry after #1358 squash merge
taras Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions packages/cli/tests/repl-execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1215,30 +1215,32 @@ describe(SELECTION_SUITE, () => {
});
});

it("X1: a host's defined empty selection refuses the entry before its body", function* () {
const holder = execution();
const entry = opened(
yield* submitReplEntry({
...options(holder),
source: DESCRIBING,
installations: [selecting({})],
}),
);
const emptySelection = "X1: a host's defined empty selection refuses the entry before its body";
it(emptySelection, () =>
captureEntry(SELECTION_SUITE, emptySelection, INLINE_SOURCE_PATH, function* (holder) {
const entry = opened(
yield* submitReplEntry({
...options(holder),
source: DESCRIBING,
installations: [selecting({})],
}),
);

// Defined and empty is a host statement, not an absence: core refuses the
// setup rather than this session answering over it with its default.
const settled = yield* entry.join();
expect(settled.ok).toBe(false);
expect(settled.ok ? "" : settled.error.message).toContain("selected no component");
// Refused before the entry body: the document rendered nothing and the
// fragment was never admitted.
expect(entry.model.terminal?.output ?? "").toBe("");
expect(
(yield* readAll(holder)).filter(
(event) => event.type === "yield" && event.description.type === "generated_xmd",
),
).toEqual([]);
});
// Defined and empty is a host statement, not an absence: core refuses the
// setup rather than this session answering over it with its default.
const settled = yield* entry.join();
expect(settled.ok).toBe(false);
expect(settled.ok ? "" : settled.error.message).toContain("selected no component");
// Refused before the entry body: the document rendered nothing and the
// fragment was never admitted.
expect(entry.model.terminal?.output ?? "").toBe("");
expect(
(yield* readAll(holder)).filter(
(event) => event.type === "yield" && event.description.type === "generated_xmd",
),
).toEqual([]);
}),
);
});

describe("execution initialization in REPL entries", () => {
Expand Down
131 changes: 85 additions & 46 deletions packages/core/tests/code-block-component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ import { collect } from "../src/collect.ts";
import { execute } from "../src/execute.ts";
import { registerComponents } from "../src/components/registration.ts";
import type { Json } from "../src/types.ts";
import { journalBeforeEach, useJournalStream } from "@executablemd/test-support/failure-journal";
import {
captureTestJournal,
journalBeforeEach,
useJournalStream,
} from "@executablemd/test-support/failure-journal";

const OWNER = "packages/core/tests/code-block-component.test.ts";

Expand Down Expand Up @@ -151,20 +155,30 @@ function* captured(

describe("Tier CB — the envelope", () => {
beforeEach(journalBeforeEach(OWNER));
it("CB1: an empty value is three backticks, two line feeds and nothing else", function* () {
const result = yield* directly(undefined, "");

expect(result.failure).toBe("");
expect(result.output).toBe("```\n\n```");
expect(yield* captured(undefined, "")).toBe("```\n\n```");
const emptyValue = "CB1: an empty value is three backticks, two line feeds and nothing else";
it(emptyValue, function* () {
const label = { owner: OWNER, name: emptyValue };
yield* captureTestJournal(label, "doc.md", function* (stream) {
yield* captureTestJournal(label, "doc.md", function* (compared) {
const result = yield* directly(stream, "");
expect(result.failure).toBe("");
expect(result.output).toBe("```\n\n```");
expect(yield* captured(compared, "")).toBe("```\n\n```");
});
});
});

it("CB1: ordinary Markdown keeps its own lines, and gains no final line feed", function* () {
const value = "# Title\n\n- one\n- two";
const result = yield* directly(undefined, value);

expect(result.output).toBe("```\n# Title\n\n- one\n- two\n```");
expect(yield* captured(undefined, value)).toBe("```\n# Title\n\n- one\n- two\n```");
const markdownValue = "CB1: ordinary Markdown keeps its own lines, and gains no final line feed";
it(markdownValue, function* () {
const label = { owner: OWNER, name: markdownValue };
yield* captureTestJournal(label, "doc.md", function* (stream) {
yield* captureTestJournal(label, "doc.md", function* (compared) {
const value = "# Title\n\n- one\n- two";
const result = yield* directly(stream, value);
expect(result.output).toBe("```\n# Title\n\n- one\n- two\n```");
expect(yield* captured(compared, value)).toBe("```\n# Title\n\n- one\n- two\n```");
});
});
});

it("CB1: the block lands where the element was written", function* () {
Expand All @@ -183,7 +197,8 @@ describe("Tier CB — the envelope", () => {

describe("Tier CB — the fence the value cannot close", () => {
beforeEach(journalBeforeEach(OWNER));
it("CB2: the fence is the longest backtick run plus one, never fewer than three", function* () {
const fenceCase = "CB2: the fence is the longest backtick run plus one, never fewer than three";
it(fenceCase, function* () {
const cases: ReadonlyArray<readonly [string, number]> = [
["no backticks at all", 3],
["one ` here", 3],
Expand All @@ -198,25 +213,34 @@ describe("Tier CB — the fence the value cannot close", () => {
];

for (const [value, length] of cases) {
const block = yield* captured(undefined, value);
const fence = "`".repeat(length);

expect(block).toBe(`${fence}\n${value}\n${fence}`);
// Stated twice on purpose: the complete string pins the layout, and this
// pins the count the layout was built from.
expect(block.split("\n")[0]?.length).toBe(length);
yield* captureTestJournal({ owner: OWNER, name: fenceCase }, "doc.md", function* (stream) {
const block = yield* captured(stream, value);
const fence = "`".repeat(length);

expect(block).toBe(`${fence}\n${value}\n${fence}`);
// Stated twice on purpose: the complete string pins the layout, and this
// pins the count the layout was built from.
expect(block.split("\n")[0]?.length).toBe(length);
});
}
});

it("CB2: a run broken by any other character is two runs, not one", function* () {
// Counting backticks without resetting would read five here and open a
// six-backtick fence.
expect(yield* captured(undefined, "```\n``")).toBe("````\n```\n``\n````");
expect(yield* captured(undefined, "``x``x``")).toBe("```\n``x``x``\n```");
const brokenRun = "CB2: a run broken by any other character is two runs, not one";
it(brokenRun, function* () {
const label = { owner: OWNER, name: brokenRun };
yield* captureTestJournal(label, "doc.md", function* (stream) {
yield* captureTestJournal(label, "doc.md", function* (compared) {
// Counting backticks without resetting would read five here and open a
// six-backtick fence.
expect(yield* captured(stream, "```\n``")).toBe("````\n```\n``\n````");
expect(yield* captured(compared, "``x``x``")).toBe("```\n``x``x``\n```");
});
});
});
});

describe("Tier CB — the value is not read for anything else", () => {
beforeEach(journalBeforeEach(OWNER));
it("CB3: removing the envelope recovers the source code units exactly", function* () {
const value = [
" leading spaces",
Expand Down Expand Up @@ -248,18 +272,25 @@ describe("Tier CB — the language token", () => {
expect((yield* captured(undefined, "plain")).split("\n")[0]).toBe("```");
});

it("CB4: every accepted token renders on the opening fence, unchanged", function* () {
const acceptedLanguage = "CB4: every accepted token renders on the opening fence, unchanged";
it(acceptedLanguage, function* () {
const accepted = ["markdown", "md", "json", "shell-session", "c++", "c#", "F", "x1._+#-"];

for (const language of accepted) {
const result = yield* directly(undefined, "body", ` language="${language}"`);

expect(result.failure).toBe("");
expect(result.output).toBe("```" + language + "\nbody\n```");
yield* captureTestJournal(
{ owner: OWNER, name: acceptedLanguage },
"doc.md",
function* (stream) {
const result = yield* directly(stream, "body", ` language="${language}"`);
expect(result.failure).toBe("");
expect(result.output).toBe("```" + language + "\nbody\n```");
},
);
}
});

it("CB4: a refused token fails validation and renders no fence", function* () {
const refusedLanguage = "CB4: a refused token fails validation and renders no fence";
it(refusedLanguage, function* () {
const refused = [
"",
" ",
Expand All @@ -285,16 +316,22 @@ describe("Tier CB — the language token", () => {
];

for (const language of refused) {
const result = yield* run(
undefined,
'<Value key="v" as="v" /><Value key="lang" as="lang" /><CodeBlock value={v} language={lang} />',
{ v: "body", lang: language },
yield* captureTestJournal(
{ owner: OWNER, name: refusedLanguage },
"doc.md",
function* (stream) {
const result = yield* run(
stream,
'<Value key="v" as="v" /><Value key="lang" as="lang" /><CodeBlock value={v} language={lang} />',
{ v: "body", lang: language },
);

expect(reported(result)).toContain("Prop validation failed for <CodeBlock />");
expect(reported(result)).toContain("language");
expect(result.output).not.toContain("```");
expect(result.output).not.toContain("body");
},
);

expect(reported(result)).toContain("Prop validation failed for <CodeBlock />");
expect(reported(result)).toContain("language");
expect(result.output).not.toContain("```");
expect(result.output).not.toContain("body");
}
});
});
Expand All @@ -309,12 +346,14 @@ describe("Tier CB — the invocation is refused before the body", () => {
expect(result.output).not.toContain("```");
});

it("CB5: a non-string value is refused rather than coerced", function* () {
const nonString = "CB5: a non-string value is refused rather than coerced";
it(nonString, function* () {
for (const value of ["42", "true", "null", "{ text: 'x' }", "['x']"]) {
const result = yield* run(undefined, `<CodeBlock value={${value}} />`);

expect(reported(result)).toContain("Prop validation failed for <CodeBlock />");
expect(result.output).not.toContain("```");
yield* captureTestJournal({ owner: OWNER, name: nonString }, "doc.md", function* (stream) {
const result = yield* run(stream, `<CodeBlock value={${value}} />`);
expect(reported(result)).toContain("Prop validation failed for <CodeBlock />");
expect(result.output).not.toContain("```");
});
}
});

Expand Down
Loading
Loading