fix: close Task 4 contract graph review findings

This commit is contained in:
lda
2026-08-14 17:58:13 +07:00 Verified
parent bd226a2fa7
commit 804946531a
3 changed files with 87 additions and 17 deletions
@@ -221,11 +221,22 @@ const authoringPathOption = {
uses: ["step_input"],
};
const conditionalRuntimeContextOption = {
...authoringPathOption,
path: "context.viewer_id",
label: "Viewer ID",
origin: "runtime_context",
required: false,
availability: "conditional",
reason: "available when the selected capability accepts runtime context",
uses: ["step_input"],
};
const authoringContractInventory = {
workspace_id: "console.demo",
revision: 7,
selected_step_id: "render",
readable_sources: [authoringPathOption],
readable_sources: [authoringPathOption, conditionalRuntimeContextOption],
step_input_targets: [
{
...authoringPathOption,
@@ -1113,6 +1124,16 @@ const parityReport = (): ParityReport => {
};
describe("authored RPC and manifest schema parity", () => {
it("covers conditional runtime context sources with a reason", () => {
expect(authoringContractInventory.readable_sources).toContainEqual(
expect.objectContaining({
origin: "runtime_context",
availability: "conditional",
reason: "available when the selected capability accepts runtime context",
}),
);
});
it("rejects empty segments in authored structural binding paths", () => {
const cases: ReadonlyArray<{
readonly method: keyof typeof authoredRpcSchemas;