@codyswann/lisa 8.2.11 → 8.4.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/all/copy-overwrite/scripts/lisa-work-item.mjs +50 -11
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +1 -1
- package/cdk/package-lisa/package.lisa.json +1 -1
- package/dist/cli/confined-project-read.d.ts +2 -1
- package/dist/cli/confined-project-read.d.ts.map +1 -1
- package/dist/cli/confined-project-read.js +22 -5
- package/dist/cli/confined-project-read.js.map +1 -1
- package/dist/cli/gh-cli.d.ts +2 -1
- package/dist/cli/gh-cli.d.ts.map +1 -1
- package/dist/cli/gh-cli.js +5 -3
- package/dist/cli/gh-cli.js.map +1 -1
- package/dist/cli/github-read-issue-cmd.d.ts +62 -0
- package/dist/cli/github-read-issue-cmd.d.ts.map +1 -0
- package/dist/cli/github-read-issue-cmd.js +121 -0
- package/dist/cli/github-read-issue-cmd.js.map +1 -0
- package/dist/cli/github-reader-relationships.d.ts +41 -0
- package/dist/cli/github-reader-relationships.d.ts.map +1 -0
- package/dist/cli/github-reader-relationships.js +218 -0
- package/dist/cli/github-reader-relationships.js.map +1 -0
- package/dist/cli/github-reader-target.d.ts +24 -0
- package/dist/cli/github-reader-target.d.ts.map +1 -0
- package/dist/cli/github-reader-target.js +95 -0
- package/dist/cli/github-reader-target.js.map +1 -0
- package/dist/cli/github-reader-wire.d.ts +72 -0
- package/dist/cli/github-reader-wire.d.ts.map +1 -0
- package/dist/cli/github-reader-wire.js +125 -0
- package/dist/cli/github-reader-wire.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/learnings-overflow-cmd.js +2 -2
- package/dist/cli/learnings-overflow-cmd.js.map +1 -1
- package/dist/configs/jest/expo.d.ts.map +1 -1
- package/dist/configs/jest/expo.js +6 -0
- package/dist/configs/jest/expo.js.map +1 -1
- package/dist/controls/commands/attest-workspace.d.ts +1 -7
- package/dist/controls/commands/attest-workspace.d.ts.map +1 -1
- package/dist/controls/commands/attest-workspace.js +29 -12
- package/dist/controls/commands/attest-workspace.js.map +1 -1
- package/dist/controls/commands/declaration-check.d.ts.map +1 -1
- package/dist/controls/commands/declaration-check.js +7 -4
- package/dist/controls/commands/declaration-check.js.map +1 -1
- package/dist/controls/commands/seed.d.ts +1 -9
- package/dist/controls/commands/seed.d.ts.map +1 -1
- package/dist/controls/commands/seed.js +72 -65
- package/dist/controls/commands/seed.js.map +1 -1
- package/dist/controls/configure-road.d.ts +2 -0
- package/dist/controls/configure-road.d.ts.map +1 -1
- package/dist/controls/configure-road.js +18 -14
- package/dist/controls/configure-road.js.map +1 -1
- package/dist/controls/proof-copy.d.ts.map +1 -1
- package/dist/controls/proof-copy.js +3 -0
- package/dist/controls/proof-copy.js.map +1 -1
- package/dist/controls/proof-scratch.d.ts +42 -0
- package/dist/controls/proof-scratch.d.ts.map +1 -0
- package/dist/controls/proof-scratch.js +172 -0
- package/dist/controls/proof-scratch.js.map +1 -0
- package/dist/controls/register-evidence-rule.d.ts +2 -0
- package/dist/controls/register-evidence-rule.d.ts.map +1 -1
- package/dist/controls/register-evidence-rule.js +8 -7
- package/dist/controls/register-evidence-rule.js.map +1 -1
- package/dist/controls/register-rules.d.ts +2 -0
- package/dist/controls/register-rules.d.ts.map +1 -1
- package/dist/controls/register-rules.js.map +1 -1
- package/dist/controls/register-types.d.ts +2 -4
- package/dist/controls/register-types.d.ts.map +1 -1
- package/dist/controls/register-types.js.map +1 -1
- package/dist/controls/register.d.ts +2 -0
- package/dist/controls/register.d.ts.map +1 -1
- package/dist/controls/register.js +3 -1
- package/dist/controls/register.js.map +1 -1
- package/dist/controls/shipped-parts.d.ts +82 -0
- package/dist/controls/shipped-parts.d.ts.map +1 -0
- package/dist/controls/shipped-parts.js +216 -0
- package/dist/controls/shipped-parts.js.map +1 -0
- package/dist/core/learnings-document.d.ts +2 -3
- package/dist/core/learnings-document.d.ts.map +1 -1
- package/dist/core/learnings-document.js.map +1 -1
- package/dist/core/learnings-overflow.d.ts +4 -0
- package/dist/core/learnings-overflow.d.ts.map +1 -1
- package/dist/core/learnings-overflow.js +47 -24
- package/dist/core/learnings-overflow.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.json +18 -0
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.json +101 -27
- package/dist/strategies/package-lisa-host-pins.d.ts +7 -12
- package/dist/strategies/package-lisa-host-pins.d.ts.map +1 -1
- package/dist/strategies/package-lisa-host-pins.js +29 -30
- package/dist/strategies/package-lisa-host-pins.js.map +1 -1
- package/dist/strategies/package-lisa-range-intersection.d.ts +8 -0
- package/dist/strategies/package-lisa-range-intersection.d.ts.map +1 -0
- package/dist/strategies/package-lisa-range-intersection.js +73 -0
- package/dist/strategies/package-lisa-range-intersection.js.map +1 -0
- package/expo/package-lisa/package.lisa.json +8 -2
- package/harper-fabric/package-lisa/package.lisa.json +3 -2
- package/package.json +4 -4
- package/phaser/package-lisa/package.lisa.json +3 -2
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa/.codex-plugin/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/lisa/rules/reference/config-resolution.md +1 -0
- package/plugins/lisa/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa-agy/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa-agy/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa-agy/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa-agy/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/lisa-copilot/rules/reference/config-resolution.md +1 -0
- package/plugins/lisa-copilot/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa-copilot/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa-copilot/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa-copilot/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa-copilot/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +1 -0
- package/plugins/lisa-cursor/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa-cursor/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa-cursor/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa-cursor/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa-cursor/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/lisa-devin/rules/reference/config-resolution.md +1 -0
- package/plugins/lisa-devin/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/lisa-devin/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/lisa-devin/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/lisa-devin/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/lisa-devin/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/hooks/inject-resolved-config.mjs +23 -1
- package/plugins/src/base/rules/reference/config-resolution.md +1 -0
- package/plugins/src/base/skills/lisa-configure/SKILL.md +8 -7
- package/plugins/src/base/skills/lisa-github-read-issue/SKILL.md +22 -106
- package/plugins/src/base/skills/lisa-linear-sync/SKILL.md +3 -3
- package/plugins/src/base/skills/lisa-persist-learning/SKILL.md +37 -5
- package/plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs +5 -0
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +56 -49
- package/plugins/src/base/skills/lisa-session-manager/references/runbook-template.md +5 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/answer-record.mjs +24 -20
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-answer-record.mjs +3 -1
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-status.mjs +2 -1
- package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +4 -1
- package/rails/copy-overwrite/lefthook.yml +3 -0
- package/rails/copy-overwrite/scripts/check-nightly-e2e-health.mjs +5115 -0
- package/rails/copy-overwrite/scripts/lisa-rails-ast-grep.mjs +31 -0
- package/rails/copy-overwrite/scripts/lisa-rails-gates.mjs +5 -0
- package/scripts/check-derived-artifacts.mjs +1 -0
- package/scripts/generate-nightly-e2e-guard-certificate.mjs +15 -1
- package/scripts/two-channel-couplings.json +37 -7
- package/scripts/verify-packed-learnings-contract.mjs +27 -1
- package/typescript/copy-overwrite/.prettierignore +2 -0
- package/typescript/copy-overwrite/scripts/lisa-typecheck.mjs +82 -0
- package/typescript/package-lisa/package.lisa.json +3 -2
|
@@ -6261,6 +6261,35 @@ function sweepBranches(args, contract, since) {
|
|
|
6261
6261
|
);
|
|
6262
6262
|
}
|
|
6263
6263
|
|
|
6264
|
+
/**
|
|
6265
|
+
* Report one declared issue through the read-only, canonical proof decision.
|
|
6266
|
+
* Only authorization calls the issue drift. A proof still being collected
|
|
6267
|
+
* remains visible without misleading a reader into attempting completion.
|
|
6268
|
+
* @param {string} ref Native issue reference.
|
|
6269
|
+
* @param {object} contract Resolved work-item contract.
|
|
6270
|
+
* @param {object} issue Issue selected by the configured lifecycle roles.
|
|
6271
|
+
* @param {string[]} shas Commits that declared the issue.
|
|
6272
|
+
* @returns {"drift"|"pending"|"failed"} The reported outcome.
|
|
6273
|
+
*/
|
|
6274
|
+
function reportSweptIssue(ref, contract, issue, shas) {
|
|
6275
|
+
const declaration = `${ref} declared by: ${describeDeclarations(shas)} [${issue.roles.join(", ")}] ${issue.title}`;
|
|
6276
|
+
const decision = authorizeCompletion(proofContext(ref, contract));
|
|
6277
|
+
if (decision.category === "authorized") {
|
|
6278
|
+
console.log(`DRIFT ${declaration}`);
|
|
6279
|
+
return "drift";
|
|
6280
|
+
}
|
|
6281
|
+
if (decision.category === "pending-proof") {
|
|
6282
|
+
console.log(
|
|
6283
|
+
`PENDING VERIFICATION ${declaration} [${decision.category}]\n${decision.reason}`
|
|
6284
|
+
);
|
|
6285
|
+
return "pending";
|
|
6286
|
+
}
|
|
6287
|
+
console.log(
|
|
6288
|
+
`VERIFICATION FAILED ${declaration} [${decision.category}]\n${decision.reason}`
|
|
6289
|
+
);
|
|
6290
|
+
return "failed";
|
|
6291
|
+
}
|
|
6292
|
+
|
|
6264
6293
|
function sweep(args) {
|
|
6265
6294
|
const contract = trackerContract();
|
|
6266
6295
|
if (contract.provider !== "github") {
|
|
@@ -6295,18 +6324,25 @@ function sweep(args) {
|
|
|
6295
6324
|
// its reader was asking. An instrument that reports an absence has to say
|
|
6296
6325
|
// what it looked at.
|
|
6297
6326
|
const examined = roles.map(role => `"${role}"`).join(" and ");
|
|
6298
|
-
let
|
|
6327
|
+
let declared = 0;
|
|
6328
|
+
const report = { drift: 0, pending: 0, failed: 0 };
|
|
6299
6329
|
for (const issue of [...subjects.values()].sort(
|
|
6300
6330
|
(left, right) => right.number - left.number
|
|
6301
6331
|
)) {
|
|
6302
6332
|
const shas = declarations.get(issue.number) ?? [];
|
|
6303
6333
|
if (shas.length === 0) continue;
|
|
6304
|
-
|
|
6334
|
+
declared += 1;
|
|
6305
6335
|
const ref = `${repository}#${issue.number}`;
|
|
6306
6336
|
if (!apply) {
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6337
|
+
try {
|
|
6338
|
+
const outcome = reportSweptIssue(ref, contract, issue, shas);
|
|
6339
|
+
report[outcome] += 1;
|
|
6340
|
+
} catch (error) {
|
|
6341
|
+
report.failed += 1;
|
|
6342
|
+
console.log(
|
|
6343
|
+
`VERIFICATION FAILED ${ref} [${COMPLETION_READ_ERROR}]\n${error instanceof Error ? error.message : String(error)}. Restore access and rerun the sweep.`
|
|
6344
|
+
);
|
|
6345
|
+
}
|
|
6310
6346
|
continue;
|
|
6311
6347
|
}
|
|
6312
6348
|
// A sweep must not abort on an item the applying arm refuses — whether it
|
|
@@ -6321,17 +6357,20 @@ function sweep(args) {
|
|
|
6321
6357
|
);
|
|
6322
6358
|
}
|
|
6323
6359
|
}
|
|
6324
|
-
|
|
6325
|
-
|
|
6360
|
+
const scope =
|
|
6361
|
+
describeSinceBound(since, branches) +
|
|
6362
|
+
describeUnresolvedBranches(unresolved);
|
|
6363
|
+
const examinedSummary = `Examined ${subjects.size} item(s) across ${roles.length} lifecycle role(s); no role outside ${examined} was queried.`;
|
|
6364
|
+
if (!apply && (declared > 0 || unresolved.length > 0)) {
|
|
6326
6365
|
console.log(
|
|
6327
|
-
|
|
6366
|
+
`\n${examinedSummary} ${report.drift} authorized drift, ${report.pending} pending verification, ${report.failed} verification failed.${scope}`
|
|
6328
6367
|
);
|
|
6368
|
+
if (report.failed > 0 || unresolved.length > 0) process.exitCode = 1;
|
|
6329
6369
|
return;
|
|
6330
6370
|
}
|
|
6331
|
-
if (
|
|
6332
|
-
const driftHeadline = `${drifted} open item(s) carrying ${examined} are declared by a commit on a deploy branch.`;
|
|
6371
|
+
if (declared === 0) {
|
|
6333
6372
|
console.log(
|
|
6334
|
-
|
|
6373
|
+
`No drift: every open item carrying ${examined} is genuinely in flight.\n${examinedSummary}${scope}`
|
|
6335
6374
|
);
|
|
6336
6375
|
}
|
|
6337
6376
|
}
|
|
@@ -1705,7 +1705,7 @@
|
|
|
1705
1705
|
"children": []
|
|
1706
1706
|
},
|
|
1707
1707
|
"lisa-work-item.mjs": {
|
|
1708
|
-
"sha256": "
|
|
1708
|
+
"sha256": "ddca51ff886326ba2bcaef21afa3f4d8fa418d52d997159579e4c0b3a8b30144",
|
|
1709
1709
|
"staticImports": [
|
|
1710
1710
|
"lib/completion-authorization.mjs",
|
|
1711
1711
|
"lib/completion-proof-adapters.mjs",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"force": {
|
|
3
3
|
"scripts": {
|
|
4
|
-
"build": "node scripts/lib/worktree-dependencies.mjs &&
|
|
4
|
+
"build": "node scripts/lib/worktree-dependencies.mjs && node scripts/lisa-typecheck.mjs",
|
|
5
5
|
"cdk": "cdk",
|
|
6
6
|
"lint:fix": "node scripts/lib/worktree-dependencies.mjs && oxlint --fix && eslint . --fix",
|
|
7
7
|
"lint:lisa": "node scripts/lib/worktree-dependencies.mjs && oxlint && eslint . --quiet",
|
|
@@ -2,7 +2,8 @@ import { type JsonObject } from "../sync/json-path.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Read committed-plus-local Lisa config without following unsafe files.
|
|
4
4
|
* @param projectRoot - Project root
|
|
5
|
+
* @param strict - Refuse a present configuration with a non-object root.
|
|
5
6
|
* @returns Merged config with the local overlay winning per key
|
|
6
7
|
*/
|
|
7
|
-
export declare function readConfinedMergedConfig(projectRoot: string): Promise<JsonObject>;
|
|
8
|
+
export declare function readConfinedMergedConfig(projectRoot: string, strict?: boolean): Promise<JsonObject>;
|
|
8
9
|
//# sourceMappingURL=confined-project-read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confined-project-read.d.ts","sourceRoot":"","sources":["../../src/cli/confined-project-read.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"confined-project-read.d.ts","sourceRoot":"","sources":["../../src/cli/confined-project-read.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AA6CrE;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,MAAM,UAAQ,GACb,OAAO,CAAC,UAAU,CAAC,CASrB"}
|
|
@@ -17,21 +17,38 @@ async function readConfinedProjectText(projectRoot, relativePath) {
|
|
|
17
17
|
* Read and parse one confined JSON file.
|
|
18
18
|
* @param projectRoot - Project root
|
|
19
19
|
* @param relativePath - Strict project-relative JSON path
|
|
20
|
+
* @param strict - Require an object without exposing malformed source text.
|
|
20
21
|
* @returns Parsed JSON, or undefined when absent
|
|
21
22
|
*/
|
|
22
|
-
async function readConfinedProjectJson(projectRoot, relativePath) {
|
|
23
|
+
async function readConfinedProjectJson(projectRoot, relativePath, strict) {
|
|
23
24
|
const text = await readConfinedProjectText(projectRoot, relativePath);
|
|
24
|
-
|
|
25
|
+
if (text === undefined)
|
|
26
|
+
return undefined;
|
|
27
|
+
try {
|
|
28
|
+
const value = JSON.parse(text);
|
|
29
|
+
if (strict && !isJsonObject(value)) {
|
|
30
|
+
throw new TypeError(`${relativePath} must contain a JSON object`);
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (!strict || !(error instanceof SyntaxError))
|
|
36
|
+
throw error;
|
|
37
|
+
throw new Error(`Could not parse ${relativePath} as JSON`, {
|
|
38
|
+
cause: error,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
25
41
|
}
|
|
26
42
|
/**
|
|
27
43
|
* Read committed-plus-local Lisa config without following unsafe files.
|
|
28
44
|
* @param projectRoot - Project root
|
|
45
|
+
* @param strict - Refuse a present configuration with a non-object root.
|
|
29
46
|
* @returns Merged config with the local overlay winning per key
|
|
30
47
|
*/
|
|
31
|
-
export async function readConfinedMergedConfig(projectRoot) {
|
|
48
|
+
export async function readConfinedMergedConfig(projectRoot, strict = false) {
|
|
32
49
|
const [committed, local] = await Promise.all([
|
|
33
|
-
readConfinedProjectJson(projectRoot, ".lisa.config.json"),
|
|
34
|
-
readConfinedProjectJson(projectRoot, ".lisa.config.local.json"),
|
|
50
|
+
readConfinedProjectJson(projectRoot, ".lisa.config.json", strict),
|
|
51
|
+
readConfinedProjectJson(projectRoot, ".lisa.config.local.json", strict),
|
|
35
52
|
]);
|
|
36
53
|
return deepMerge(isJsonObject(committed) ? committed : {}, isJsonObject(local) ? local : {});
|
|
37
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confined-project-read.js","sourceRoot":"","sources":["../../src/cli/confined-project-read.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAmB,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;;;GAKG;AACH,KAAK,UAAU,uBAAuB,CACpC,WAAmB,EACnB,YAAoB;IAEpB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC;IACzC,OAAO,MAAM,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACnD,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"confined-project-read.js","sourceRoot":"","sources":["../../src/cli/confined-project-read.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAmB,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;;;GAKG;AACH,KAAK,UAAU,uBAAuB,CACpC,WAAmB,EACnB,YAAoB;IAEpB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC;IACzC,OAAO,MAAM,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,uBAAuB,CACpC,WAAmB,EACnB,YAAo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
9
9
|
* @param timeoutMs - Child-process timeout
|
|
10
10
|
* @param signal - Probe cancellation signal
|
|
11
|
+
* @param maxBuffer - Optional output bound for paginated reads.
|
|
11
12
|
* @returns Trimmed stdout
|
|
12
13
|
*/
|
|
13
|
-
export declare function runGh(args: readonly string[], cwd: string, timeoutMs: number, signal: AbortSignal): Promise<string>;
|
|
14
|
+
export declare function runGh(args: readonly string[], cwd: string, timeoutMs: number, signal: AbortSignal, maxBuffer?: number): Promise<string>;
|
|
14
15
|
//# sourceMappingURL=gh-cli.d.ts.map
|
package/dist/cli/gh-cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gh-cli.d.ts","sourceRoot":"","sources":["../../src/cli/gh-cli.ts"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"gh-cli.d.ts","sourceRoot":"","sources":["../../src/cli/gh-cli.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CACnB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAyBjB"}
|
package/dist/cli/gh-cli.js
CHANGED
|
@@ -14,9 +14,10 @@ import { spawnTarget } from "../utils/resolve-executable.js";
|
|
|
14
14
|
* @param cwd - Working directory
|
|
15
15
|
* @param timeoutMs - Child-process timeout
|
|
16
16
|
* @param signal - Probe cancellation signal
|
|
17
|
+
* @param maxBuffer - Optional output bound for paginated reads.
|
|
17
18
|
* @returns Trimmed stdout
|
|
18
19
|
*/
|
|
19
|
-
export function runGh(args, cwd, timeoutMs, signal) {
|
|
20
|
+
export function runGh(args, cwd, timeoutMs, signal, maxBuffer) {
|
|
20
21
|
return new Promise((resolve, reject) => {
|
|
21
22
|
// Throws ExecutableNotFoundError (code ENOENT) when gh is not installed;
|
|
22
23
|
// inside the executor that rejects, exactly as execFile's ENOENT did.
|
|
@@ -25,11 +26,12 @@ export function runGh(args, cwd, timeoutMs, signal) {
|
|
|
25
26
|
cwd,
|
|
26
27
|
signal,
|
|
27
28
|
timeout: timeoutMs,
|
|
29
|
+
...(maxBuffer === undefined ? {} : { maxBuffer }),
|
|
28
30
|
encoding: "utf8",
|
|
29
31
|
windowsVerbatimArguments: gh.windowsVerbatimArguments,
|
|
30
|
-
}, (error, stdout) => {
|
|
32
|
+
}, (error, stdout, stderr) => {
|
|
31
33
|
if (error !== null) {
|
|
32
|
-
reject(error);
|
|
34
|
+
reject(Object.assign(error, { stderr }));
|
|
33
35
|
return;
|
|
34
36
|
}
|
|
35
37
|
resolve(stdout.trim());
|
package/dist/cli/gh-cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gh-cli.js","sourceRoot":"","sources":["../../src/cli/gh-cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"gh-cli.js","sourceRoot":"","sources":["../../src/cli/gh-cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,KAAK,CACnB,IAAuB,EACvB,GAAW,EACX,SAAiB,EACjB,MAAmB,EACnB,SAAkB;IAElB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,yEAAyE;QACzE,sEAAsE;QACtE,MAAM,EAAE,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnC,QAAQ,CACN,EAAE,CAAC,IAAI,EACP,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EACZ;YACE,GAAG;YACH,MAAM;YACN,OAAO,EAAE,SAAS;YAClB,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;YACjD,QAAQ,EAAE,MAAM;YAChB,wBAAwB,EAAE,EAAE,CAAC,wBAAwB;SACtD,EACD,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;gBACzC,OAAO;YACT,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACzB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Read repository context and separately resolve configured GitHub Projects metadata. */
|
|
2
|
+
import type { Command } from "commander";
|
|
3
|
+
import { type GitHubRead } from "./github-reader-wire.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read the issue bundle without requesting any unconfigured services.
|
|
6
|
+
* @param root - Current Lisa checkout.
|
|
7
|
+
* @param input - Issue reference accepted by the GitHub reader.
|
|
8
|
+
* @param read - Native read function, injectable for request-selection tests.
|
|
9
|
+
* @returns Repository-native context and separately qualified Project metadata.
|
|
10
|
+
*/
|
|
11
|
+
export declare function readGitHubIssue(root: string, input: string, read?: GitHubRead): Promise<{
|
|
12
|
+
graph: {
|
|
13
|
+
parent: import("../sync/json-path.js").JsonObject | null;
|
|
14
|
+
children: import("../sync/json-path.js").JsonObject[];
|
|
15
|
+
warning?: never;
|
|
16
|
+
} | {
|
|
17
|
+
warning: string;
|
|
18
|
+
parent?: never;
|
|
19
|
+
children?: never;
|
|
20
|
+
};
|
|
21
|
+
timeline: {
|
|
22
|
+
events: import("../sync/json-path.js").JsonObject[];
|
|
23
|
+
warning?: never;
|
|
24
|
+
} | {
|
|
25
|
+
events: never[];
|
|
26
|
+
warning: string;
|
|
27
|
+
};
|
|
28
|
+
pullRequests: ({
|
|
29
|
+
repo: string;
|
|
30
|
+
metadata: import("../sync/json-path.js").JsonObject;
|
|
31
|
+
reviews: import("../sync/json-path.js").JsonObject[];
|
|
32
|
+
threads: {
|
|
33
|
+
comments: import("../sync/json-path.js").JsonObject[];
|
|
34
|
+
}[];
|
|
35
|
+
} | {
|
|
36
|
+
repo: string;
|
|
37
|
+
number: number;
|
|
38
|
+
warning: string;
|
|
39
|
+
})[];
|
|
40
|
+
ref: string;
|
|
41
|
+
issue: import("../sync/json-path.js").JsonObject;
|
|
42
|
+
comments: import("../sync/json-path.js").JsonObject[];
|
|
43
|
+
project: {
|
|
44
|
+
readonly status: "unconfigured";
|
|
45
|
+
readonly metadata?: never;
|
|
46
|
+
warning?: never;
|
|
47
|
+
} | {
|
|
48
|
+
readonly status: "verified";
|
|
49
|
+
readonly metadata: import("../sync/json-path.js").JsonObject;
|
|
50
|
+
warning?: never;
|
|
51
|
+
} | {
|
|
52
|
+
readonly status: "unverified";
|
|
53
|
+
readonly warning: string;
|
|
54
|
+
readonly metadata?: never;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Register the exact read-only command used by generated GitHub skills.
|
|
59
|
+
* @param program - The Lisa CLI program.
|
|
60
|
+
*/
|
|
61
|
+
export declare function addGitHubReadIssueCommand(program: Command): void;
|
|
62
|
+
//# sourceMappingURL=github-read-issue-cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-read-issue-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/github-read-issue-cmd.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAkGjC;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,UAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkB1C;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAchE"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { readGitHubIssueRelationships } from "./github-reader-relationships.js";
|
|
2
|
+
import { resolveGitHubReaderTarget, } from "./github-reader-target.js";
|
|
3
|
+
import { githubReadError, graphql, nativeGitHubRead, responseObject, restPages, } from "./github-reader-wire.js";
|
|
4
|
+
const ISSUE_FIELDS = "number,title,body,state,stateReason,author,assignees,labels,milestone,createdAt,updatedAt,closedAt,url,reactionGroups";
|
|
5
|
+
/**
|
|
6
|
+
* Query only the configured Project and keep service failures separate.
|
|
7
|
+
* @param read - Native GitHub reader.
|
|
8
|
+
* @param project - Validated effective Project settings.
|
|
9
|
+
* @returns Metadata with an explicit evidence status.
|
|
10
|
+
*/
|
|
11
|
+
async function readProject(read, project) {
|
|
12
|
+
if (project === undefined)
|
|
13
|
+
return { status: "unconfigured" };
|
|
14
|
+
const query = `query($login:String!,$number:Int!) {
|
|
15
|
+
${project.kind}(login:$login) { login projectV2(number:$number) { id title number url } }
|
|
16
|
+
}`;
|
|
17
|
+
try {
|
|
18
|
+
const [page] = await graphql(read, query, {
|
|
19
|
+
login: project.login,
|
|
20
|
+
number: project.number,
|
|
21
|
+
});
|
|
22
|
+
const owner = responseObject(page?.[project.kind], "the configured Project owner");
|
|
23
|
+
const metadata = responseObject(owner.projectV2, "the configured Project metadata");
|
|
24
|
+
if (typeof owner.login !== "string" ||
|
|
25
|
+
owner.login.toLowerCase() !== project.login.toLowerCase() ||
|
|
26
|
+
metadata.number !== project.number ||
|
|
27
|
+
typeof metadata.id !== "string" ||
|
|
28
|
+
!metadata.id ||
|
|
29
|
+
typeof metadata.title !== "string" ||
|
|
30
|
+
typeof metadata.url !== "string") {
|
|
31
|
+
throw new Error("GitHub did not verify the configured Project identity");
|
|
32
|
+
}
|
|
33
|
+
return { status: "verified", metadata };
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
const message = githubReadError(error);
|
|
37
|
+
if (project.required)
|
|
38
|
+
throw new Error(`Required GitHub Project could not be read. ${message}`, {
|
|
39
|
+
cause: error,
|
|
40
|
+
});
|
|
41
|
+
return { status: "unverified", warning: message };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Read comments through all native pages and prove the number fetched.
|
|
46
|
+
* @param read - Native GitHub reader.
|
|
47
|
+
* @param route - Selected issue REST route.
|
|
48
|
+
* @returns Complete native comments in provider order.
|
|
49
|
+
*/
|
|
50
|
+
async function issueComments(read, route) {
|
|
51
|
+
const comments = await restPages(read, `${route}/comments`);
|
|
52
|
+
const total = await read(["api", route, "--jq", ".comments"]);
|
|
53
|
+
if (total !== comments.length) {
|
|
54
|
+
throw new Error(`GitHub issue comments are incomplete. Read ${comments.length} of ${String(total)}`);
|
|
55
|
+
}
|
|
56
|
+
return comments;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Read core metadata through the same native issue selection on every path.
|
|
60
|
+
* @param read - Native GitHub reader.
|
|
61
|
+
* @param ref - Selected repository and issue number.
|
|
62
|
+
* @returns Native issue metadata.
|
|
63
|
+
*/
|
|
64
|
+
async function readIssue(read, ref) {
|
|
65
|
+
const repo = `${ref.owner}/${ref.repo}`;
|
|
66
|
+
const view = await read([
|
|
67
|
+
"issue",
|
|
68
|
+
"view",
|
|
69
|
+
String(ref.number),
|
|
70
|
+
"--repo",
|
|
71
|
+
repo,
|
|
72
|
+
"--json",
|
|
73
|
+
ISSUE_FIELDS,
|
|
74
|
+
]);
|
|
75
|
+
const issue = responseObject(view, "issue metadata");
|
|
76
|
+
if (issue.number !== ref.number ||
|
|
77
|
+
typeof issue.body !== "string" ||
|
|
78
|
+
typeof issue.title !== "string")
|
|
79
|
+
throw new Error("GitHub did not verify the selected issue identity");
|
|
80
|
+
return issue;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Read the issue bundle without requesting any unconfigured services.
|
|
84
|
+
* @param root - Current Lisa checkout.
|
|
85
|
+
* @param input - Issue reference accepted by the GitHub reader.
|
|
86
|
+
* @param read - Native read function, injectable for request-selection tests.
|
|
87
|
+
* @returns Repository-native context and separately qualified Project metadata.
|
|
88
|
+
*/
|
|
89
|
+
export async function readGitHubIssue(root, input, read = nativeGitHubRead(root)) {
|
|
90
|
+
const target = await resolveGitHubReaderTarget(root, input);
|
|
91
|
+
const { owner, repo, number } = target.issue;
|
|
92
|
+
await read(["auth", "status"]);
|
|
93
|
+
const issue = await readIssue(read, target.issue);
|
|
94
|
+
const project = await readProject(read, target.project);
|
|
95
|
+
const [comments, relationships] = await Promise.all([
|
|
96
|
+
issueComments(read, `repos/${owner}/${repo}/issues/${number}`),
|
|
97
|
+
readGitHubIssueRelationships(read, target.issue),
|
|
98
|
+
]);
|
|
99
|
+
return {
|
|
100
|
+
ref: `${owner}/${repo}#${number}`,
|
|
101
|
+
issue,
|
|
102
|
+
comments,
|
|
103
|
+
project,
|
|
104
|
+
...relationships,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Register the exact read-only command used by generated GitHub skills.
|
|
109
|
+
* @param program - The Lisa CLI program.
|
|
110
|
+
*/
|
|
111
|
+
export function addGitHubReadIssueCommand(program) {
|
|
112
|
+
program
|
|
113
|
+
.command("github-read-issue")
|
|
114
|
+
.description("Read GitHub issue context and any configured Project metadata")
|
|
115
|
+
.argument("<issue>", "Issue number, owner/repo#number, or a GitHub issue URL")
|
|
116
|
+
.action(async (issue) => {
|
|
117
|
+
const result = await readGitHubIssue(process.cwd(), issue);
|
|
118
|
+
console.log(JSON.stringify(result));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=github-read-issue-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-read-issue-cmd.js","sourceRoot":"","sources":["../../src/cli/github-read-issue-cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EACL,yBAAyB,GAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,SAAS,GAEV,MAAM,yBAAyB,CAAC;AAEjC,MAAM,YAAY,GAChB,uHAAuH,CAAC;AAE1H;;;;;GAKG;AACH,KAAK,UAAU,WAAW,CACxB,IAAgB,EAChB,OAAwC;IAExC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAW,CAAC;IACtE,MAAM,KAAK,GAAG;MACV,OAAO,CAAC,IAAI;IACd,CAAC;IACH,IAAI,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE;YACxC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,cAAc,CAC1B,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EACpB,8BAA8B,CAC/B,CAAC;QACF,MAAM,QAAQ,GAAG,cAAc,CAC7B,KAAK,CAAC,SAAS,EACf,iCAAiC,CAClC,CAAC;QACF,IACE,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAC/B,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE;YACzD,QAAQ,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;YAClC,OAAO,QAAQ,CAAC,EAA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K,IAAI,IAAI,IAAI,MAAM,EAAE;QACjC,KAAK;QACL,QAAQ;QACR,OAAO;QACP,GAAG,aAAa;KACjB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CACV,+DAA+D,CAChE;SACA,QAAQ,CACP,SAAS,EACT,wDAAwD,CACzD;SACA,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;QAC9B,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Repository-native issue relationships, label history, and linked PR reviews. */
|
|
2
|
+
import type { JsonObject } from "../sync/json-path.js";
|
|
3
|
+
import type { GitHubIssueRef } from "./github-reader-target.js";
|
|
4
|
+
import { type GitHubRead } from "./github-reader-wire.js";
|
|
5
|
+
/**
|
|
6
|
+
* Gather native issue relationships, history and linked PR reviews.
|
|
7
|
+
* @param read - Native GitHub reader.
|
|
8
|
+
* @param ref - Repository and issue identity.
|
|
9
|
+
* @returns Repository context independent of Projects service metadata.
|
|
10
|
+
*/
|
|
11
|
+
export declare function readGitHubIssueRelationships(read: GitHubRead, ref: GitHubIssueRef): Promise<{
|
|
12
|
+
graph: {
|
|
13
|
+
parent: JsonObject | null;
|
|
14
|
+
children: JsonObject[];
|
|
15
|
+
warning?: never;
|
|
16
|
+
} | {
|
|
17
|
+
warning: string;
|
|
18
|
+
parent?: never;
|
|
19
|
+
children?: never;
|
|
20
|
+
};
|
|
21
|
+
timeline: {
|
|
22
|
+
events: JsonObject[];
|
|
23
|
+
warning?: never;
|
|
24
|
+
} | {
|
|
25
|
+
events: never[];
|
|
26
|
+
warning: string;
|
|
27
|
+
};
|
|
28
|
+
pullRequests: ({
|
|
29
|
+
repo: string;
|
|
30
|
+
metadata: JsonObject;
|
|
31
|
+
reviews: JsonObject[];
|
|
32
|
+
threads: {
|
|
33
|
+
comments: JsonObject[];
|
|
34
|
+
}[];
|
|
35
|
+
} | {
|
|
36
|
+
repo: string;
|
|
37
|
+
number: number;
|
|
38
|
+
warning: string;
|
|
39
|
+
})[];
|
|
40
|
+
}>;
|
|
41
|
+
//# sourceMappingURL=github-reader-relationships.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-reader-relationships.d.ts","sourceRoot":"","sources":["../../src/cli/github-reader-relationships.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EASL,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAiPjC;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BpB"}
|