@itsthelore/proofkeeper 2026.6.0
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/LICENSE +201 -0
- package/NOTICE +10 -0
- package/README.md +207 -0
- package/dist/agent/adapters/claude.d.ts +93 -0
- package/dist/agent/adapters/claude.d.ts.map +1 -0
- package/dist/agent/adapters/claude.js +96 -0
- package/dist/agent/adapters/claude.js.map +1 -0
- package/dist/agent/drive.d.ts +53 -0
- package/dist/agent/drive.d.ts.map +1 -0
- package/dist/agent/drive.js +194 -0
- package/dist/agent/drive.js.map +1 -0
- package/dist/agent/loop.d.ts +40 -0
- package/dist/agent/loop.d.ts.map +1 -0
- package/dist/agent/loop.js +29 -0
- package/dist/agent/loop.js.map +1 -0
- package/dist/agent/model.d.ts +43 -0
- package/dist/agent/model.d.ts.map +1 -0
- package/dist/agent/model.js +10 -0
- package/dist/agent/model.js.map +1 -0
- package/dist/agent/observe.d.ts +48 -0
- package/dist/agent/observe.d.ts.map +1 -0
- package/dist/agent/observe.js +65 -0
- package/dist/agent/observe.js.map +1 -0
- package/dist/agent/tools.d.ts +74 -0
- package/dist/agent/tools.d.ts.map +1 -0
- package/dist/agent/tools.js +257 -0
- package/dist/agent/tools.js.map +1 -0
- package/dist/cli.d.ts +61 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +648 -0
- package/dist/cli.js.map +1 -0
- package/dist/compiler/actions.d.ts +101 -0
- package/dist/compiler/actions.d.ts.map +1 -0
- package/dist/compiler/actions.js +13 -0
- package/dist/compiler/actions.js.map +1 -0
- package/dist/compiler/compiler.d.ts +25 -0
- package/dist/compiler/compiler.d.ts.map +1 -0
- package/dist/compiler/compiler.js +42 -0
- package/dist/compiler/compiler.js.map +1 -0
- package/dist/compiler/emit.d.ts +21 -0
- package/dist/compiler/emit.d.ts.map +1 -0
- package/dist/compiler/emit.js +164 -0
- package/dist/compiler/emit.js.map +1 -0
- package/dist/compiler/http.d.ts +30 -0
- package/dist/compiler/http.d.ts.map +1 -0
- package/dist/compiler/http.js +30 -0
- package/dist/compiler/http.js.map +1 -0
- package/dist/compiler/recorder.d.ts +62 -0
- package/dist/compiler/recorder.d.ts.map +1 -0
- package/dist/compiler/recorder.js +148 -0
- package/dist/compiler/recorder.js.map +1 -0
- package/dist/compiler/summary.d.ts +11 -0
- package/dist/compiler/summary.d.ts.map +1 -0
- package/dist/compiler/summary.js +56 -0
- package/dist/compiler/summary.js.map +1 -0
- package/dist/compiler/terminal.d.ts +42 -0
- package/dist/compiler/terminal.d.ts.map +1 -0
- package/dist/compiler/terminal.js +47 -0
- package/dist/compiler/terminal.js.map +1 -0
- package/dist/compiler/types.d.ts +25 -0
- package/dist/compiler/types.d.ts.map +1 -0
- package/dist/compiler/types.js +10 -0
- package/dist/compiler/types.js.map +1 -0
- package/dist/coverage/graph.d.ts +55 -0
- package/dist/coverage/graph.d.ts.map +1 -0
- package/dist/coverage/graph.js +87 -0
- package/dist/coverage/graph.js.map +1 -0
- package/dist/coverage/model.d.ts +36 -0
- package/dist/coverage/model.d.ts.map +1 -0
- package/dist/coverage/model.js +57 -0
- package/dist/coverage/model.js.map +1 -0
- package/dist/coverage/report.d.ts +27 -0
- package/dist/coverage/report.d.ts.map +1 -0
- package/dist/coverage/report.js +45 -0
- package/dist/coverage/report.js.map +1 -0
- package/dist/coverage/source.d.ts +23 -0
- package/dist/coverage/source.d.ts.map +1 -0
- package/dist/coverage/source.js +48 -0
- package/dist/coverage/source.js.map +1 -0
- package/dist/fidelity/gate.d.ts +34 -0
- package/dist/fidelity/gate.d.ts.map +1 -0
- package/dist/fidelity/gate.js +38 -0
- package/dist/fidelity/gate.js.map +1 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/learning/store.d.ts +44 -0
- package/dist/learning/store.d.ts.map +1 -0
- package/dist/learning/store.js +64 -0
- package/dist/learning/store.js.map +1 -0
- package/dist/qa/concurrency.d.ts +7 -0
- package/dist/qa/concurrency.d.ts.map +1 -0
- package/dist/qa/concurrency.js +21 -0
- package/dist/qa/concurrency.js.map +1 -0
- package/dist/qa/run-qa.d.ts +87 -0
- package/dist/qa/run-qa.d.ts.map +1 -0
- package/dist/qa/run-qa.js +106 -0
- package/dist/qa/run-qa.js.map +1 -0
- package/dist/qa/run-scoped.d.ts +82 -0
- package/dist/qa/run-scoped.d.ts.map +1 -0
- package/dist/qa/run-scoped.js +96 -0
- package/dist/qa/run-scoped.js.map +1 -0
- package/dist/runner/playwright-report.d.ts +52 -0
- package/dist/runner/playwright-report.d.ts.map +1 -0
- package/dist/runner/playwright-report.js +90 -0
- package/dist/runner/playwright-report.js.map +1 -0
- package/dist/runner/playwright-runner.d.ts +38 -0
- package/dist/runner/playwright-runner.d.ts.map +1 -0
- package/dist/runner/playwright-runner.js +73 -0
- package/dist/runner/playwright-runner.js.map +1 -0
- package/dist/runner/types.d.ts +45 -0
- package/dist/runner/types.d.ts.map +1 -0
- package/dist/runner/types.js +10 -0
- package/dist/runner/types.js.map +1 -0
- package/dist/scaffold/scaffold.d.ts +22 -0
- package/dist/scaffold/scaffold.d.ts.map +1 -0
- package/dist/scaffold/scaffold.js +34 -0
- package/dist/scaffold/scaffold.js.map +1 -0
- package/dist/scope/config.d.ts +89 -0
- package/dist/scope/config.d.ts.map +1 -0
- package/dist/scope/config.js +172 -0
- package/dist/scope/config.js.map +1 -0
- package/dist/scope/diff-scope.d.ts +31 -0
- package/dist/scope/diff-scope.d.ts.map +1 -0
- package/dist/scope/diff-scope.js +42 -0
- package/dist/scope/diff-scope.js.map +1 -0
- package/dist/scope/glob.d.ts +17 -0
- package/dist/scope/glob.d.ts.map +1 -0
- package/dist/scope/glob.js +50 -0
- package/dist/scope/glob.js.map +1 -0
- package/dist/writeback/comment.d.ts +103 -0
- package/dist/writeback/comment.d.ts.map +1 -0
- package/dist/writeback/comment.js +150 -0
- package/dist/writeback/comment.js.map +1 -0
- package/dist/writeback/gateways/github-rest.d.ts +66 -0
- package/dist/writeback/gateways/github-rest.d.ts.map +1 -0
- package/dist/writeback/gateways/github-rest.js +107 -0
- package/dist/writeback/gateways/github-rest.js.map +1 -0
- package/dist/writeback/merge.d.ts +27 -0
- package/dist/writeback/merge.d.ts.map +1 -0
- package/dist/writeback/merge.js +89 -0
- package/dist/writeback/merge.js.map +1 -0
- package/dist/writeback/proposal.d.ts +52 -0
- package/dist/writeback/proposal.d.ts.map +1 -0
- package/dist/writeback/proposal.js +79 -0
- package/dist/writeback/proposal.js.map +1 -0
- package/dist/writeback/proposer.d.ts +94 -0
- package/dist/writeback/proposer.d.ts.map +1 -0
- package/dist/writeback/proposer.js +79 -0
- package/dist/writeback/proposer.js.map +1 -0
- package/dist/writeback/verified-by.d.ts +56 -0
- package/dist/writeback/verified-by.d.ts.map +1 -0
- package/dist/writeback/verified-by.js +60 -0
- package/dist/writeback/verified-by.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Propose a `## Verified By` write-back as a human-reviewed pull request —
|
|
3
|
+
* Proofkeeper Initiative 5.
|
|
4
|
+
*
|
|
5
|
+
* The trust boundary is human PR review (ADR-065): Proofkeeper NEVER commits to
|
|
6
|
+
* the base branch. The proposer reads the target file from the base, builds the
|
|
7
|
+
* merged content, commits it to a NEW head branch, and opens a pull request
|
|
8
|
+
* base ← head. That guarantee is structural — there is no code path that writes
|
|
9
|
+
* to the base branch.
|
|
10
|
+
*
|
|
11
|
+
* Repository operations go through an injected {@link RepoGateway}, so there is
|
|
12
|
+
* no hard GitHub dependency: wire it to Octokit, the `gh` CLI, or a GitHub MCP
|
|
13
|
+
* client. The mapping is the consumer's choice, exactly like the model adapter.
|
|
14
|
+
*/
|
|
15
|
+
import { type FidelitySummary } from "./comment.js";
|
|
16
|
+
import type { VerificationLink } from "./verified-by.js";
|
|
17
|
+
/** The repository operations the proposer needs. Implement against any backend. */
|
|
18
|
+
export interface RepoGateway {
|
|
19
|
+
/** Read a file's content at a ref (branch/sha). */
|
|
20
|
+
getFileContent(path: string, ref: string): Promise<string>;
|
|
21
|
+
/** Create a new branch from a base ref. */
|
|
22
|
+
createBranch(name: string, fromRef: string): Promise<void>;
|
|
23
|
+
/** Commit file content to a branch (never the base — the proposer enforces this). */
|
|
24
|
+
commitFile(input: {
|
|
25
|
+
branch: string;
|
|
26
|
+
path: string;
|
|
27
|
+
content: string;
|
|
28
|
+
message: string;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
/** Open a pull request from `head` into `base`. */
|
|
31
|
+
openPullRequest(input: {
|
|
32
|
+
base: string;
|
|
33
|
+
head: string;
|
|
34
|
+
title: string;
|
|
35
|
+
body: string;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
url: string;
|
|
38
|
+
number: number;
|
|
39
|
+
}>;
|
|
40
|
+
/** Post an informational comment on a pull request. Never approves or merges. */
|
|
41
|
+
commentOnPullRequest(input: {
|
|
42
|
+
number: number;
|
|
43
|
+
body: string;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
url: string;
|
|
46
|
+
}>;
|
|
47
|
+
/** List a pull request's comments (id + body), for find-or-update of a marked comment. */
|
|
48
|
+
listComments(prNumber: number): Promise<{
|
|
49
|
+
id: number;
|
|
50
|
+
body: string;
|
|
51
|
+
}[]>;
|
|
52
|
+
/** Update a comment's body in place. */
|
|
53
|
+
updateComment(commentId: number, body: string): Promise<{
|
|
54
|
+
url: string;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
export interface WriteBackInput {
|
|
58
|
+
capabilityId: string;
|
|
59
|
+
targetPath: string;
|
|
60
|
+
links: VerificationLink[];
|
|
61
|
+
/** Overrides the proposer's default base branch. */
|
|
62
|
+
baseBranch?: string;
|
|
63
|
+
branchPrefix?: string;
|
|
64
|
+
/** When provided, a confirmation comment with the fidelity result is posted on the PR. */
|
|
65
|
+
fidelity?: FidelitySummary;
|
|
66
|
+
/** Readable step summary of the driven flow, shown in the PR body and comment. */
|
|
67
|
+
steps?: string[];
|
|
68
|
+
/** The Markdown test plan the model wrote before driving, shown in the PR. */
|
|
69
|
+
plan?: string;
|
|
70
|
+
}
|
|
71
|
+
export type WriteBackResult = {
|
|
72
|
+
status: "no-change";
|
|
73
|
+
reason: string;
|
|
74
|
+
} | {
|
|
75
|
+
status: "proposed";
|
|
76
|
+
url: string;
|
|
77
|
+
number: number;
|
|
78
|
+
headBranch: string;
|
|
79
|
+
commentUrl?: string;
|
|
80
|
+
};
|
|
81
|
+
export interface WriteBackProposer {
|
|
82
|
+
propose(input: WriteBackInput): Promise<WriteBackResult>;
|
|
83
|
+
}
|
|
84
|
+
export interface GitHubWriteBackProposerOptions {
|
|
85
|
+
/** Base branch PRs target. Defaults to `main`. */
|
|
86
|
+
baseBranch?: string;
|
|
87
|
+
}
|
|
88
|
+
export declare class GitHubWriteBackProposer implements WriteBackProposer {
|
|
89
|
+
private readonly gateway;
|
|
90
|
+
private readonly options;
|
|
91
|
+
constructor(gateway: RepoGateway, options?: GitHubWriteBackProposerOptions);
|
|
92
|
+
propose(input: WriteBackInput): Promise<WriteBackResult>;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=proposer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposer.d.ts","sourceRoot":"","sources":["../../src/writeback/proposer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAA4D,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAC9G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,2CAA2C;IAC3C,YAAY,CAAC,IAAI,EAAE,MAAM,EAA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FAA0F;IAC1F,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjG,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,8BAA8B;IAC7C,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,uBAAwB,YAAW,iBAAiB;IAE7D,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,8BAAmC;IAGzD,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;CA4D/D"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Propose a `## Verified By` write-back as a human-reviewed pull request —
|
|
3
|
+
* Proofkeeper Initiative 5.
|
|
4
|
+
*
|
|
5
|
+
* The trust boundary is human PR review (ADR-065): Proofkeeper NEVER commits to
|
|
6
|
+
* the base branch. The proposer reads the target file from the base, builds the
|
|
7
|
+
* merged content, commits it to a NEW head branch, and opens a pull request
|
|
8
|
+
* base ← head. That guarantee is structural — there is no code path that writes
|
|
9
|
+
* to the base branch.
|
|
10
|
+
*
|
|
11
|
+
* Repository operations go through an injected {@link RepoGateway}, so there is
|
|
12
|
+
* no hard GitHub dependency: wire it to Octokit, the `gh` CLI, or a GitHub MCP
|
|
13
|
+
* client. The mapping is the consumer's choice, exactly like the model adapter.
|
|
14
|
+
*/
|
|
15
|
+
import { buildProposal } from "./proposal.js";
|
|
16
|
+
import { renderWriteBackComment, upsertComment, WRITE_BACK_MARKER } from "./comment.js";
|
|
17
|
+
export class GitHubWriteBackProposer {
|
|
18
|
+
gateway;
|
|
19
|
+
options;
|
|
20
|
+
constructor(gateway, options = {}) {
|
|
21
|
+
this.gateway = gateway;
|
|
22
|
+
this.options = options;
|
|
23
|
+
}
|
|
24
|
+
async propose(input) {
|
|
25
|
+
const baseBranch = input.baseBranch ?? this.options.baseBranch ?? "main";
|
|
26
|
+
const originalContent = await this.gateway.getFileContent(input.targetPath, baseBranch);
|
|
27
|
+
const proposal = buildProposal({
|
|
28
|
+
capabilityId: input.capabilityId,
|
|
29
|
+
targetPath: input.targetPath,
|
|
30
|
+
originalContent,
|
|
31
|
+
links: input.links,
|
|
32
|
+
baseBranch,
|
|
33
|
+
...(input.branchPrefix !== undefined ? { branchPrefix: input.branchPrefix } : {}),
|
|
34
|
+
...(input.steps !== undefined ? { steps: input.steps } : {}),
|
|
35
|
+
...(input.plan !== undefined ? { plan: input.plan } : {}),
|
|
36
|
+
});
|
|
37
|
+
if (!proposal.changed) {
|
|
38
|
+
return { status: "no-change", reason: "all proposed links are already present" };
|
|
39
|
+
}
|
|
40
|
+
// Commit ONLY to the new head branch, then open a PR. The base is never written.
|
|
41
|
+
await this.gateway.createBranch(proposal.headBranch, baseBranch);
|
|
42
|
+
await this.gateway.commitFile({
|
|
43
|
+
branch: proposal.headBranch,
|
|
44
|
+
path: input.targetPath,
|
|
45
|
+
content: proposal.updatedContent,
|
|
46
|
+
message: proposal.title,
|
|
47
|
+
});
|
|
48
|
+
const pr = await this.gateway.openPullRequest({
|
|
49
|
+
base: baseBranch,
|
|
50
|
+
head: proposal.headBranch,
|
|
51
|
+
title: proposal.title,
|
|
52
|
+
body: proposal.body,
|
|
53
|
+
});
|
|
54
|
+
const result = {
|
|
55
|
+
status: "proposed",
|
|
56
|
+
url: pr.url,
|
|
57
|
+
number: pr.number,
|
|
58
|
+
headBranch: proposal.headBranch,
|
|
59
|
+
};
|
|
60
|
+
// Optional confirmation comment carrying the fidelity evidence the PR body
|
|
61
|
+
// does not. Informational only, and idempotent (one per PR, updated in place).
|
|
62
|
+
if (input.fidelity) {
|
|
63
|
+
const comment = await upsertComment(this.gateway, {
|
|
64
|
+
number: pr.number,
|
|
65
|
+
marker: WRITE_BACK_MARKER,
|
|
66
|
+
body: renderWriteBackComment({
|
|
67
|
+
capabilityId: input.capabilityId,
|
|
68
|
+
links: input.links,
|
|
69
|
+
fidelity: input.fidelity,
|
|
70
|
+
...(input.steps !== undefined ? { steps: input.steps } : {}),
|
|
71
|
+
...(input.plan !== undefined ? { plan: input.plan } : {}),
|
|
72
|
+
}),
|
|
73
|
+
});
|
|
74
|
+
result.commentUrl = comment.url;
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=proposer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposer.js","sourceRoot":"","sources":["../../src/writeback/proposer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,iBAAiB,EAAwB,MAAM,cAAc,CAAC;AAoD9G,MAAM,OAAO,uBAAuB;IAEf;IACA;IAFnB,YACmB,OAAoB,EACpB,UAA0C,EAAE;QAD5C,YAAO,GAAP,OAAO,CAAa;QACpB,YAAO,GAAP,OAAO,CAAqC;IAC5D,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,KAAqB;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,IAAI,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ative 5.
|
|
3
|
+
*
|
|
4
|
+
* Proofkeeper proposes verification links by rendering the exact section the
|
|
5
|
+
* engine recognizes (ADR-084): a `## Verified By` heading followed by a list of
|
|
6
|
+
* external references. The engine treats the entire list-item text as the
|
|
7
|
+
* reference, so each item is a single **bare** test path — the verifier the
|
|
8
|
+
* corpus records. The replayable trace is evidence surfaced in the pull request
|
|
9
|
+
* and committed as an artifact, not a corpus edge. Targets are external
|
|
10
|
+
* (ADR-084), so the engine emits them with `resolved: false` — expected, not an
|
|
11
|
+
* error.
|
|
12
|
+
*
|
|
13
|
+
* This is PROPOSE-ONLY. The renderer returns Markdown; it never writes into a
|
|
14
|
+
* corpus. Applying it is a human-reviewed pull request (ADR-065) — the trust
|
|
15
|
+
* boundary is the reviewer, never Proofkeeper.
|
|
16
|
+
*/
|
|
17
|
+
/** A single verifying reference: a committed test and, optionally, its trace. */
|
|
18
|
+
export interface VerificationLink {
|
|
19
|
+
/** Path/reference to the committed Playwright test. */
|
|
20
|
+
test: string;
|
|
21
|
+
/** Optional path/reference to the replayable trace artifact. */
|
|
22
|
+
trace?: string;
|
|
23
|
+
}
|
|
24
|
+
/** The heading the engine recognizes as the verified_by section (ADR-084). */
|
|
25
|
+
export declare const VERIFIED_BY_HEADING = "## Verified By";
|
|
26
|
+
/**
|
|
27
|
+
* Flatten links into their external reference paths — the test and, when
|
|
28
|
+
* present, the trace — deduplicated, preserving order. These are the bare
|
|
29
|
+
* targets the engine records (both are external-target references, ADR-084).
|
|
30
|
+
*/
|
|
31
|
+
export declare function verificationRefs(links: VerificationLink[]): string[];
|
|
32
|
+
/**
|
|
33
|
+
* Render one reference as a `## Verified By` list item: a single bare backticked
|
|
34
|
+
* path, so the engine's edge target is a clean reference.
|
|
35
|
+
*/
|
|
36
|
+
export declare function renderVerifiedByItem(ref: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Render the `## Verified By` section body Proofkeeper proposes for a
|
|
39
|
+
* capability — the heading plus one bare item per reference (test and trace).
|
|
40
|
+
*
|
|
41
|
+
* @throws {Error} when given no links — an empty section is never proposed.
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderVerifiedBySection(links: VerificationLink[]): string;
|
|
44
|
+
/** A proposed write-back: which capability, and the section to add to it. */
|
|
45
|
+
export interface VerifiedByProposal {
|
|
46
|
+
capabilityId: string;
|
|
47
|
+
section: string;
|
|
48
|
+
links: VerificationLink[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Build a propose-only write-back for a capability. The result is meant to be
|
|
52
|
+
* carried into a human-reviewed pull request against the target's Lore corpus —
|
|
53
|
+
* never written directly.
|
|
54
|
+
*/
|
|
55
|
+
export declare function proposeVerifiedBy(capabilityId: string, links: VerificationLink[]): VerifiedByProposal;
|
|
56
|
+
//# sourceMappingURL=verified-by.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verified-by.d.ts","sourceRoot":"","sources":["../../src/writeback/verified-by.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAOpE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAKzE;AAED,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,gBAAgB,EAAE,GACxB,kBAAkB,CAEpB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `## Verified By` write-back renderer — Proofkeeper Initiative 5.
|
|
3
|
+
*
|
|
4
|
+
* Proofkeeper proposes verification links by rendering the exact section the
|
|
5
|
+
* engine recognizes (ADR-084): a `## Verified By` heading followed by a list of
|
|
6
|
+
* external references. The engine treats the entire list-item text as the
|
|
7
|
+
* reference, so each item is a single **bare** test path — the verifier the
|
|
8
|
+
* corpus records. The replayable trace is evidence surfaced in the pull request
|
|
9
|
+
* and committed as an artifact, not a corpus edge. Targets are external
|
|
10
|
+
* (ADR-084), so the engine emits them with `resolved: false` — expected, not an
|
|
11
|
+
* error.
|
|
12
|
+
*
|
|
13
|
+
* This is PROPOSE-ONLY. The renderer returns Markdown; it never writes into a
|
|
14
|
+
* corpus. Applying it is a human-reviewed pull request (ADR-065) — the trust
|
|
15
|
+
* boundary is the reviewer, never Proofkeeper.
|
|
16
|
+
*/
|
|
17
|
+
/** The heading the engine recognizes as the verified_by section (ADR-084). */
|
|
18
|
+
export const VERIFIED_BY_HEADING = "## Verified By";
|
|
19
|
+
/**
|
|
20
|
+
* Flatten links into their external reference paths — the test and, when
|
|
21
|
+
* present, the trace — deduplicated, preserving order. These are the bare
|
|
22
|
+
* targets the engine records (both are external-target references, ADR-084).
|
|
23
|
+
*/
|
|
24
|
+
export function verificationRefs(links) {
|
|
25
|
+
const refs = [];
|
|
26
|
+
for (const link of links) {
|
|
27
|
+
refs.push(link.test);
|
|
28
|
+
if (link.trace)
|
|
29
|
+
refs.push(link.trace);
|
|
30
|
+
}
|
|
31
|
+
return [...new Set(refs)];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Render one reference as a `## Verified By` list item: a single bare backticked
|
|
35
|
+
* path, so the engine's edge target is a clean reference.
|
|
36
|
+
*/
|
|
37
|
+
export function renderVerifiedByItem(ref) {
|
|
38
|
+
return `- \`${ref}\``;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Render the `## Verified By` section body Proofkeeper proposes for a
|
|
42
|
+
* capability — the heading plus one bare item per reference (test and trace).
|
|
43
|
+
*
|
|
44
|
+
* @throws {Error} when given no links — an empty section is never proposed.
|
|
45
|
+
*/
|
|
46
|
+
export function renderVerifiedBySection(links) {
|
|
47
|
+
if (links.length === 0) {
|
|
48
|
+
throw new Error("refusing to render an empty `## Verified By` section");
|
|
49
|
+
}
|
|
50
|
+
return [VERIFIED_BY_HEADING, "", ...verificationRefs(links).map(renderVerifiedByItem), ""].join("\n");
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Build a propose-only write-back for a capability. The result is meant to be
|
|
54
|
+
* carried into a human-reviewed pull request against the target's Lore corpus —
|
|
55
|
+
* never written directly.
|
|
56
|
+
*/
|
|
57
|
+
export function proposeVerifiedBy(capabilityId, links) {
|
|
58
|
+
return { capabilityId, section: renderVerifiedBySection(links), links };
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=verified-by.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verified-by.js","sourceRoot":"","sources":["../../src/writeback/verified-by.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAUH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAyB;IACxD,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,OAAO,OAAO,GAAG,IAAI,CAAC;AACxB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAyB;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,CAAC,mBAAmB,EAAE,EAAE,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxG,CAAC;AASD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAoB,EACpB,KAAyB;IAEzB,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,uBAAuB,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;AAC1E,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@itsthelore/proofkeeper",
|
|
3
|
+
"version": "2026.6.0",
|
|
4
|
+
"description": "Lore Proofkeeper — an autonomous QA agent that drives a product, compiles the session into durable Playwright tests, gates them on fidelity, and reports which Lore capabilities are unverified.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"proofkeeper": "./dist/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"NOTICE",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"prepublishOnly": "npm run build",
|
|
24
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest",
|
|
27
|
+
"proofkeeper": "node --import tsx ./src/cli.ts"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"lore",
|
|
31
|
+
"proofkeeper",
|
|
32
|
+
"playwright",
|
|
33
|
+
"verification",
|
|
34
|
+
"qa",
|
|
35
|
+
"requirements-as-code"
|
|
36
|
+
],
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/itsthelore/proofkeeper.git"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@anthropic-ai/sdk": "^0.105.0",
|
|
46
|
+
"@types/node": "^20.14.0",
|
|
47
|
+
"tsx": "^4.16.0",
|
|
48
|
+
"typescript": "^5.5.0",
|
|
49
|
+
"vitest": "^2.0.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@playwright/test": "^1.45.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@anthropic-ai/sdk": ">=0.40.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"@anthropic-ai/sdk": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|