@kya-os/cli 1.8.1 → 1.8.3
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/dist/commands/agent.d.ts +35 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +321 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/build.js +2 -2
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/check.js +3 -3
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/checkpoint-init.d.ts +1 -1
- package/dist/commands/checkpoint-init.d.ts.map +1 -1
- package/dist/commands/checkpoint-init.js +8 -41
- package/dist/commands/checkpoint-init.js.map +1 -1
- package/dist/commands/claim.js +2 -2
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/dco.d.ts +59 -0
- package/dist/commands/dco.d.ts.map +1 -1
- package/dist/commands/dco.js +280 -5
- package/dist/commands/dco.js.map +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +18 -24
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.js +6 -6
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/identity.js +3 -3
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/init-stages.d.ts +141 -0
- package/dist/commands/init-stages.d.ts.map +1 -0
- package/dist/commands/init-stages.js +684 -0
- package/dist/commands/init-stages.js.map +1 -0
- package/dist/commands/init.d.ts +46 -16
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +229 -279
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/orchestrator.d.ts +18 -0
- package/dist/commands/orchestrator.d.ts.map +1 -0
- package/dist/commands/orchestrator.js +251 -0
- package/dist/commands/orchestrator.js.map +1 -0
- package/dist/commands/register.d.ts +1 -1
- package/dist/commands/register.d.ts.map +1 -1
- package/dist/commands/register.js +35 -7
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/review.d.ts +48 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +220 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/rotate.js +4 -4
- package/dist/commands/rotate.js.map +1 -1
- package/dist/commands/score.d.ts +15 -0
- package/dist/commands/score.d.ts.map +1 -0
- package/dist/commands/score.js +471 -0
- package/dist/commands/score.js.map +1 -0
- package/dist/commands/start.js +3 -3
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/verify.js +6 -6
- package/dist/commands/verify.js.map +1 -1
- package/dist/dco.d.ts +4 -0
- package/dist/dco.d.ts.map +1 -0
- package/dist/dco.js +23 -0
- package/dist/dco.js.map +1 -0
- package/dist/index.js +52 -9
- package/dist/orchestrator/daemon.d.ts +137 -0
- package/dist/orchestrator/daemon.d.ts.map +1 -0
- package/dist/orchestrator/daemon.js +242 -0
- package/dist/orchestrator/daemon.js.map +1 -0
- package/dist/orchestrator/db/dispatches.d.ts +108 -0
- package/dist/orchestrator/db/dispatches.d.ts.map +1 -0
- package/dist/orchestrator/db/dispatches.js +122 -0
- package/dist/orchestrator/db/dispatches.js.map +1 -0
- package/dist/orchestrator/db/index.d.ts +50 -0
- package/dist/orchestrator/db/index.d.ts.map +1 -0
- package/dist/orchestrator/db/index.js +116 -0
- package/dist/orchestrator/db/index.js.map +1 -0
- package/dist/orchestrator/db/journal.d.ts +93 -0
- package/dist/orchestrator/db/journal.d.ts.map +1 -0
- package/dist/orchestrator/db/journal.js +91 -0
- package/dist/orchestrator/db/journal.js.map +1 -0
- package/dist/orchestrator/db/liveness.d.ts +97 -0
- package/dist/orchestrator/db/liveness.d.ts.map +1 -0
- package/dist/orchestrator/db/liveness.js +105 -0
- package/dist/orchestrator/db/liveness.js.map +1 -0
- package/dist/orchestrator/db/mission.d.ts +78 -0
- package/dist/orchestrator/db/mission.d.ts.map +1 -0
- package/dist/orchestrator/db/mission.js +99 -0
- package/dist/orchestrator/db/mission.js.map +1 -0
- package/dist/orchestrator/db/schema.d.ts +14 -0
- package/dist/orchestrator/db/schema.d.ts.map +1 -0
- package/dist/orchestrator/db/schema.js +169 -0
- package/dist/orchestrator/db/schema.js.map +1 -0
- package/dist/orchestrator/db/tickets.d.ts +147 -0
- package/dist/orchestrator/db/tickets.d.ts.map +1 -0
- package/dist/orchestrator/db/tickets.js +238 -0
- package/dist/orchestrator/db/tickets.js.map +1 -0
- package/dist/orchestrator/db/verdicts.d.ts +187 -0
- package/dist/orchestrator/db/verdicts.d.ts.map +1 -0
- package/dist/orchestrator/db/verdicts.js +197 -0
- package/dist/orchestrator/db/verdicts.js.map +1 -0
- package/dist/orchestrator/events.d.ts +69 -0
- package/dist/orchestrator/events.d.ts.map +1 -0
- package/dist/orchestrator/events.js +20 -0
- package/dist/orchestrator/events.js.map +1 -0
- package/dist/orchestrator/github-credential-anchor-sender.d.ts +159 -0
- package/dist/orchestrator/github-credential-anchor-sender.d.ts.map +1 -0
- package/dist/orchestrator/github-credential-anchor-sender.js +313 -0
- package/dist/orchestrator/github-credential-anchor-sender.js.map +1 -0
- package/dist/orchestrator/hub-dispatch.d.ts +120 -0
- package/dist/orchestrator/hub-dispatch.d.ts.map +1 -0
- package/dist/orchestrator/hub-dispatch.js +257 -0
- package/dist/orchestrator/hub-dispatch.js.map +1 -0
- package/dist/orchestrator/hub-observer.d.ts +201 -0
- package/dist/orchestrator/hub-observer.d.ts.map +1 -0
- package/dist/orchestrator/hub-observer.js +474 -0
- package/dist/orchestrator/hub-observer.js.map +1 -0
- package/dist/orchestrator/journal-writer.d.ts +80 -0
- package/dist/orchestrator/journal-writer.d.ts.map +1 -0
- package/dist/orchestrator/journal-writer.js +113 -0
- package/dist/orchestrator/journal-writer.js.map +1 -0
- package/dist/orchestrator/mcp/server.d.ts +136 -0
- package/dist/orchestrator/mcp/server.d.ts.map +1 -0
- package/dist/orchestrator/mcp/server.js +582 -0
- package/dist/orchestrator/mcp/server.js.map +1 -0
- package/dist/orchestrator/mcp/stdio.d.ts +22 -0
- package/dist/orchestrator/mcp/stdio.d.ts.map +1 -0
- package/dist/orchestrator/mcp/stdio.js +51 -0
- package/dist/orchestrator/mcp/stdio.js.map +1 -0
- package/dist/orchestrator/review.d.ts +131 -0
- package/dist/orchestrator/review.d.ts.map +1 -0
- package/dist/orchestrator/review.js +322 -0
- package/dist/orchestrator/review.js.map +1 -0
- package/dist/tui/app.d.ts +33 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +71 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/components.d.ts +110 -0
- package/dist/tui/components.d.ts.map +1 -0
- package/dist/tui/components.js +118 -0
- package/dist/tui/components.js.map +1 -0
- package/dist/tui/index.d.ts +30 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +95 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/keymap.d.ts +33 -0
- package/dist/tui/keymap.d.ts.map +1 -0
- package/dist/tui/keymap.js +49 -0
- package/dist/tui/keymap.js.map +1 -0
- package/dist/tui/nav.d.ts +29 -0
- package/dist/tui/nav.d.ts.map +1 -0
- package/dist/tui/nav.js +39 -0
- package/dist/tui/nav.js.map +1 -0
- package/dist/tui/sanitize.d.ts +25 -0
- package/dist/tui/sanitize.d.ts.map +1 -0
- package/dist/tui/sanitize.js +36 -0
- package/dist/tui/sanitize.js.map +1 -0
- package/dist/tui/theme.d.ts +32 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +63 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/tui/views/agents.d.ts +67 -0
- package/dist/tui/views/agents.d.ts.map +1 -0
- package/dist/tui/views/agents.js +231 -0
- package/dist/tui/views/agents.js.map +1 -0
- package/dist/tui/views/index.d.ts +93 -0
- package/dist/tui/views/index.d.ts.map +1 -0
- package/dist/tui/views/index.js +150 -0
- package/dist/tui/views/index.js.map +1 -0
- package/dist/tui/views/registry.d.ts +22 -0
- package/dist/tui/views/registry.d.ts.map +1 -0
- package/dist/tui/views/registry.js +110 -0
- package/dist/tui/views/registry.js.map +1 -0
- package/dist/utils/agent/backoff.d.ts +31 -0
- package/dist/utils/agent/backoff.d.ts.map +1 -0
- package/dist/utils/agent/backoff.js +51 -0
- package/dist/utils/agent/backoff.js.map +1 -0
- package/dist/utils/agent/markers.d.ts +87 -0
- package/dist/utils/agent/markers.d.ts.map +1 -0
- package/dist/utils/agent/markers.js +147 -0
- package/dist/utils/agent/markers.js.map +1 -0
- package/dist/utils/agent/review.d.ts +67 -0
- package/dist/utils/agent/review.d.ts.map +1 -0
- package/dist/utils/agent/review.js +305 -0
- package/dist/utils/agent/review.js.map +1 -0
- package/dist/utils/agent/spawn-agent.d.ts +117 -0
- package/dist/utils/agent/spawn-agent.d.ts.map +1 -0
- package/dist/utils/agent/spawn-agent.js +177 -0
- package/dist/utils/agent/spawn-agent.js.map +1 -0
- package/dist/utils/agent/task.d.ts +101 -0
- package/dist/utils/agent/task.d.ts.map +1 -0
- package/dist/utils/agent/task.js +357 -0
- package/dist/utils/agent/task.js.map +1 -0
- package/dist/utils/agent/verify.d.ts +47 -0
- package/dist/utils/agent/verify.d.ts.map +1 -0
- package/dist/utils/agent/verify.js +144 -0
- package/dist/utils/agent/verify.js.map +1 -0
- package/dist/utils/agent-detector.d.ts +48 -0
- package/dist/utils/agent-detector.d.ts.map +1 -0
- package/dist/utils/agent-detector.js +74 -0
- package/dist/utils/agent-detector.js.map +1 -0
- package/dist/utils/agent-profile-stage.d.ts +70 -0
- package/dist/utils/agent-profile-stage.d.ts.map +1 -0
- package/dist/utils/agent-profile-stage.js +153 -0
- package/dist/utils/agent-profile-stage.js.map +1 -0
- package/dist/utils/agent-profiles.d.ts +27 -0
- package/dist/utils/agent-profiles.d.ts.map +1 -0
- package/dist/utils/agent-profiles.js +61 -0
- package/dist/utils/agent-profiles.js.map +1 -0
- package/dist/utils/checkpoint-api.d.ts +1 -1
- package/dist/utils/checkpoint-api.js +1 -1
- package/dist/utils/checkpoint-env.d.ts +1 -1
- package/dist/utils/checkpoint-env.js +2 -2
- package/dist/utils/checkpoint-env.js.map +1 -1
- package/dist/utils/checkpoint-scaffold.d.ts +1 -1
- package/dist/utils/checkpoint-scaffold.js +1 -1
- package/dist/utils/cli-kit/browser.d.ts +24 -0
- package/dist/utils/cli-kit/browser.d.ts.map +1 -0
- package/dist/utils/cli-kit/browser.js +58 -0
- package/dist/utils/cli-kit/browser.js.map +1 -0
- package/dist/utils/cli-kit/claim-polling.d.ts +18 -0
- package/dist/utils/cli-kit/claim-polling.d.ts.map +1 -0
- package/dist/utils/{claim-polling.js → cli-kit/claim-polling.js} +19 -26
- package/dist/utils/cli-kit/claim-polling.js.map +1 -0
- package/dist/utils/cli-kit/diagnostics.d.ts +9 -0
- package/dist/utils/cli-kit/diagnostics.d.ts.map +1 -0
- package/dist/utils/cli-kit/diagnostics.js +11 -0
- package/dist/utils/cli-kit/diagnostics.js.map +1 -0
- package/dist/utils/cli-kit/fs-safe.d.ts +14 -0
- package/dist/utils/cli-kit/fs-safe.d.ts.map +1 -0
- package/dist/utils/cli-kit/fs-safe.js +20 -0
- package/dist/utils/cli-kit/fs-safe.js.map +1 -0
- package/dist/utils/cli-kit/index.d.ts +15 -0
- package/dist/utils/cli-kit/index.d.ts.map +1 -0
- package/dist/utils/cli-kit/index.js +10 -0
- package/dist/utils/cli-kit/index.js.map +1 -0
- package/dist/utils/cli-kit/json-file.d.ts +21 -0
- package/dist/utils/cli-kit/json-file.d.ts.map +1 -0
- package/dist/utils/cli-kit/json-file.js +51 -0
- package/dist/utils/cli-kit/json-file.js.map +1 -0
- package/dist/utils/cli-kit/marker-block.d.ts +26 -0
- package/dist/utils/cli-kit/marker-block.d.ts.map +1 -0
- package/dist/utils/cli-kit/marker-block.js +61 -0
- package/dist/utils/cli-kit/marker-block.js.map +1 -0
- package/dist/utils/cli-kit/paths.d.ts +15 -0
- package/dist/utils/cli-kit/paths.d.ts.map +1 -0
- package/dist/utils/cli-kit/paths.js +21 -0
- package/dist/utils/cli-kit/paths.js.map +1 -0
- package/dist/utils/cli-kit/secure-storage.d.ts +14 -0
- package/dist/utils/cli-kit/secure-storage.d.ts.map +1 -0
- package/dist/utils/cli-kit/secure-storage.js +20 -0
- package/dist/utils/cli-kit/secure-storage.js.map +1 -0
- package/dist/utils/cli-kit/step-report.d.ts +16 -0
- package/dist/utils/cli-kit/step-report.d.ts.map +1 -0
- package/dist/utils/cli-kit/step-report.js +36 -0
- package/dist/utils/cli-kit/step-report.js.map +1 -0
- package/dist/utils/dco/agent-metadata.d.ts +1 -1
- package/dist/utils/dco/agent-metadata.js +1 -1
- package/dist/utils/dco/agent-metadata.js.map +1 -1
- package/dist/utils/dco/claude-config.d.ts +18 -14
- package/dist/utils/dco/claude-config.d.ts.map +1 -1
- package/dist/utils/dco/claude-config.js +31 -97
- package/dist/utils/dco/claude-config.js.map +1 -1
- package/dist/utils/dco/dispatch.d.ts +134 -0
- package/dist/utils/dco/dispatch.d.ts.map +1 -0
- package/dist/utils/dco/dispatch.js +399 -0
- package/dist/utils/dco/dispatch.js.map +1 -0
- package/dist/utils/dco/fix.d.ts +122 -0
- package/dist/utils/dco/fix.d.ts.map +1 -0
- package/dist/utils/dco/fix.js +560 -0
- package/dist/utils/dco/fix.js.map +1 -0
- package/dist/utils/dco/git-config.d.ts.map +1 -1
- package/dist/utils/dco/git-config.js +5 -3
- package/dist/utils/dco/git-config.js.map +1 -1
- package/dist/utils/dco/github.d.ts +101 -0
- package/dist/utils/dco/github.d.ts.map +1 -1
- package/dist/utils/dco/github.js +133 -0
- package/dist/utils/dco/github.js.map +1 -1
- package/dist/utils/dco/paths.d.ts +1 -8
- package/dist/utils/dco/paths.d.ts.map +1 -1
- package/dist/utils/dco/paths.js +3 -12
- package/dist/utils/dco/paths.js.map +1 -1
- package/dist/utils/dco/render.d.ts +1 -1
- package/dist/utils/dco/render.d.ts.map +1 -1
- package/dist/utils/dco/render.js +4 -21
- package/dist/utils/dco/render.js.map +1 -1
- package/dist/utils/dco/resolve-agent.d.ts +54 -0
- package/dist/utils/dco/resolve-agent.d.ts.map +1 -0
- package/dist/utils/dco/resolve-agent.js +164 -0
- package/dist/utils/dco/resolve-agent.js.map +1 -0
- package/dist/utils/dco/setup.d.ts +10 -7
- package/dist/utils/dco/setup.d.ts.map +1 -1
- package/dist/utils/dco/setup.js +264 -200
- package/dist/utils/dco/setup.js.map +1 -1
- package/dist/utils/dco/signing-key-writer.d.ts +40 -0
- package/dist/utils/dco/signing-key-writer.d.ts.map +1 -0
- package/dist/utils/dco/signing-key-writer.js +76 -0
- package/dist/utils/dco/signing-key-writer.js.map +1 -0
- package/dist/utils/dco/ssh-key.d.ts +50 -0
- package/dist/utils/dco/ssh-key.d.ts.map +1 -1
- package/dist/utils/dco/ssh-key.js +129 -8
- package/dist/utils/dco/ssh-key.js.map +1 -1
- package/dist/utils/dco/status.d.ts +1 -1
- package/dist/utils/dco/status.d.ts.map +1 -1
- package/dist/utils/dco/status.js +3 -3
- package/dist/utils/dco/status.js.map +1 -1
- package/dist/utils/dco/verify.d.ts +170 -0
- package/dist/utils/dco/verify.d.ts.map +1 -0
- package/dist/utils/dco/verify.js +550 -0
- package/dist/utils/dco/verify.js.map +1 -0
- package/dist/utils/dependency-installer.d.ts +37 -0
- package/dist/utils/dependency-installer.d.ts.map +1 -0
- package/dist/utils/dependency-installer.js +32 -0
- package/dist/utils/dependency-installer.js.map +1 -0
- package/dist/utils/github-credential-stage.d.ts +87 -0
- package/dist/utils/github-credential-stage.d.ts.map +1 -0
- package/dist/utils/github-credential-stage.js +168 -0
- package/dist/utils/github-credential-stage.js.map +1 -0
- package/dist/utils/github-credential.d.ts +160 -0
- package/dist/utils/github-credential.d.ts.map +1 -0
- package/dist/utils/github-credential.js +308 -0
- package/dist/utils/github-credential.js.map +1 -0
- package/dist/utils/gitignore.d.ts +17 -0
- package/dist/utils/gitignore.d.ts.map +1 -0
- package/dist/utils/gitignore.js +40 -0
- package/dist/utils/gitignore.js.map +1 -0
- package/dist/utils/hub-config.d.ts +21 -0
- package/dist/utils/hub-config.d.ts.map +1 -0
- package/dist/utils/hub-config.js +28 -0
- package/dist/utils/hub-config.js.map +1 -0
- package/dist/utils/identity-heal.d.ts +16 -0
- package/dist/utils/identity-heal.d.ts.map +1 -0
- package/dist/utils/identity-heal.js +37 -0
- package/dist/utils/identity-heal.js.map +1 -0
- package/dist/utils/init/pipeline.d.ts +74 -0
- package/dist/utils/init/pipeline.d.ts.map +1 -0
- package/dist/utils/init/pipeline.js +96 -0
- package/dist/utils/init/pipeline.js.map +1 -0
- package/dist/utils/poll.d.ts +15 -1
- package/dist/utils/poll.d.ts.map +1 -1
- package/dist/utils/poll.js +6 -3
- package/dist/utils/poll.js.map +1 -1
- package/dist/utils/register-agent-identity.d.ts +67 -0
- package/dist/utils/register-agent-identity.d.ts.map +1 -0
- package/dist/utils/register-agent-identity.js +34 -0
- package/dist/utils/register-agent-identity.js.map +1 -0
- package/dist/utils/review/did-web-key.d.ts +34 -0
- package/dist/utils/review/did-web-key.d.ts.map +1 -0
- package/dist/utils/review/did-web-key.js +104 -0
- package/dist/utils/review/did-web-key.js.map +1 -0
- package/dist/utils/review/load-registry.d.ts +33 -0
- package/dist/utils/review/load-registry.d.ts.map +1 -0
- package/dist/utils/review/load-registry.js +62 -0
- package/dist/utils/review/load-registry.js.map +1 -0
- package/dist/utils/review/verdict-verify.d.ts +43 -0
- package/dist/utils/review/verdict-verify.d.ts.map +1 -0
- package/dist/utils/review/verdict-verify.js +53 -0
- package/dist/utils/review/verdict-verify.js.map +1 -0
- package/dist/utils/review-registry-writer.d.ts +52 -0
- package/dist/utils/review-registry-writer.d.ts.map +1 -0
- package/dist/utils/review-registry-writer.js +79 -0
- package/dist/utils/review-registry-writer.js.map +1 -0
- package/dist/utils/should-install-dependency.d.ts +17 -0
- package/dist/utils/should-install-dependency.d.ts.map +1 -0
- package/dist/utils/should-install-dependency.js +25 -0
- package/dist/utils/should-install-dependency.js.map +1 -0
- package/dist/utils/tool-readiness.d.ts +57 -0
- package/dist/utils/tool-readiness.d.ts.map +1 -0
- package/dist/utils/tool-readiness.js +114 -0
- package/dist/utils/tool-readiness.js.map +1 -0
- package/dist/utils/which.d.ts +2 -0
- package/dist/utils/which.d.ts.map +1 -0
- package/dist/utils/which.js +22 -0
- package/dist/utils/which.js.map +1 -0
- package/dist/version.d.ts +15 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +29 -0
- package/dist/version.js.map +1 -0
- package/package.json +19 -6
- package/dist/utils/claim-polling.d.ts +0 -21
- package/dist/utils/claim-polling.d.ts.map +0 -1
- package/dist/utils/claim-polling.js.map +0 -1
- package/dist/utils/dco/fs-safe.d.ts +0 -14
- package/dist/utils/dco/fs-safe.d.ts.map +0 -1
- package/dist/utils/dco/fs-safe.js +0 -20
- package/dist/utils/dco/fs-safe.js.map +0 -1
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import { execFile } from "child_process";
|
|
2
|
+
import { readFileSync } from "fs";
|
|
3
|
+
import { promisify } from "util";
|
|
4
|
+
import { FixAttestationSchema, getFixAttestationSigningString, } from "@kya-os/contracts/review";
|
|
5
|
+
import { isGhAuthenticated, isGhInstalled } from "./github.js";
|
|
6
|
+
import { isCommitSigned, resolveSigningIdentity } from "./dispatch.js";
|
|
7
|
+
import { parseEd25519SshPrivateKeyPem, signWithEd25519Seed } from "./ssh-key.js";
|
|
8
|
+
const execFileAsync = promisify(execFile);
|
|
9
|
+
const DEFAULT_COMMIT_MESSAGE = "fix: address signed review findings";
|
|
10
|
+
async function run(cmd, args, cwd) {
|
|
11
|
+
const { stdout } = await execFileAsync(cmd, args, {
|
|
12
|
+
cwd,
|
|
13
|
+
encoding: "utf8",
|
|
14
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
15
|
+
});
|
|
16
|
+
return stdout.trim();
|
|
17
|
+
}
|
|
18
|
+
async function gitSucceeds(args, cwd) {
|
|
19
|
+
try {
|
|
20
|
+
await run("git", args, cwd);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function errorMessage(error) {
|
|
28
|
+
if (error && typeof error === "object" && "stderr" in error) {
|
|
29
|
+
const stderr = String(error.stderr ?? "").trim();
|
|
30
|
+
if (stderr) {
|
|
31
|
+
return stderr;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return error instanceof Error ? error.message : String(error);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse "owner/repo" out of a git remote URL, accepting the two shapes a
|
|
38
|
+
* GitHub `origin` remote actually takes: SSH (`git@github.com:owner/repo.git`)
|
|
39
|
+
* and HTTPS (`https://github.com/owner/repo(.git)`). Returns null for
|
|
40
|
+
* anything else rather than guessing.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* GitHub owner/repo names are case-insensitive (`Acme/Demo` and `acme/demo`
|
|
44
|
+
* name the same repo), but a git remote's casing and a browser-copied PR
|
|
45
|
+
* URL's casing routinely differ from each other and from what a user types
|
|
46
|
+
* for `--repo`. A strict `===` between any two of `originRepo`/`--repo`/a
|
|
47
|
+
* PR URL's repo would then refuse a legitimate same-repo `dco fix` as
|
|
48
|
+
* `wrong-remote`.
|
|
49
|
+
*/
|
|
50
|
+
function repoNamesEqual(a, b) {
|
|
51
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
52
|
+
}
|
|
53
|
+
export function parseOwnerRepoFromRemoteUrl(url) {
|
|
54
|
+
const trimmed = url.trim().replace(/\.git$/, "");
|
|
55
|
+
const sshMatch = /^[\w-]+@[^:/]+:([^/]+\/[^/]+)$/.exec(trimmed);
|
|
56
|
+
if (sshMatch) {
|
|
57
|
+
return sshMatch[1];
|
|
58
|
+
}
|
|
59
|
+
const httpsMatch = /^https?:\/\/[^/]+\/([^/]+\/[^/]+)$/.exec(trimmed);
|
|
60
|
+
if (httpsMatch) {
|
|
61
|
+
return httpsMatch[1];
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The one pattern both `parseOwnerRepoFromPrUrl` and `extractPrNumber` parse
|
|
67
|
+
* a PR URL with. Anchored at both ends (`^`...`$`) and requiring a lowercase
|
|
68
|
+
* `http(s)://` scheme, so the two functions can never disagree on what
|
|
69
|
+
* counts as a "PR URL" — see parseOwnerRepoFromPrUrl's doc comment for why
|
|
70
|
+
* that agreement is the whole point. Trailing content after the number
|
|
71
|
+
* (`/files`, `#issuecomment-1`, `?diff=split`) is tolerated, since a
|
|
72
|
+
* browser-copied PR link routinely carries one of those.
|
|
73
|
+
*/
|
|
74
|
+
const PR_URL_PATTERN = /^https?:\/\/[^/]+\/([^/]+\/[^/]+)\/pull\/(\d+)(?:[/?#].*)?$/;
|
|
75
|
+
/**
|
|
76
|
+
* Parse "owner/repo" out of a full PR URL (`https://github.com/owner/repo/pull/123`).
|
|
77
|
+
* Returns null for a bare PR number (or anything else): a bare number carries
|
|
78
|
+
* no repo of its own, so there is nothing to cross-check it against — every
|
|
79
|
+
* gh call below is scoped to `targetRepo` explicitly regardless.
|
|
80
|
+
*
|
|
81
|
+
* Shares PR_URL_PATTERN with extractPrNumber on purpose, rather than each
|
|
82
|
+
* using its own regex: an input recognized by ONE as URL-shaped but not the
|
|
83
|
+
* OTHER used to let a same-numbered-PR mismatch slip through silently — an
|
|
84
|
+
* uppercase scheme, a missing scheme, or a URL embedded in surrounding text
|
|
85
|
+
* would fail this function's narrower original pattern (skipping the
|
|
86
|
+
* wrong-remote check below, since it only runs when this returns non-null)
|
|
87
|
+
* while still matching extractPrNumber's looser unanchored `/pull/(\d+)`
|
|
88
|
+
* search, so the flow proceeded against this checkout's same-numbered PR
|
|
89
|
+
* with no cross-repo check ever having run. One shared pattern means
|
|
90
|
+
* whatever extractPrNumber accepts as URL-shaped, this function recognizes
|
|
91
|
+
* too, so the check it guards can never be bypassed that way.
|
|
92
|
+
*/
|
|
93
|
+
export function parseOwnerRepoFromPrUrl(pr) {
|
|
94
|
+
const match = PR_URL_PATTERN.exec(pr.trim());
|
|
95
|
+
return match ? match[1] : null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Normalize `pr` (a bare number or a full PR URL) down to just the number,
|
|
99
|
+
* so every `gh pr` call below can be pinned with an explicit `-R targetRepo`
|
|
100
|
+
* instead of a heterogeneous target that sometimes carries its own repo and
|
|
101
|
+
* sometimes relies on ambient resolution. Ambient resolution is NOT
|
|
102
|
+
* guaranteed to agree with `cwd`'s git remote — `GH_REPO` or a `gh repo
|
|
103
|
+
* set-default` override takes precedence over it — so a bare number handed
|
|
104
|
+
* to `gh` unpinned could read a different repo's PR even after step 2's
|
|
105
|
+
* origin check. Returns null for anything that isn't a plain integer or a
|
|
106
|
+
* `.../pull/<number>` URL matching PR_URL_PATTERN.
|
|
107
|
+
*/
|
|
108
|
+
export function extractPrNumber(pr) {
|
|
109
|
+
const trimmed = pr.trim();
|
|
110
|
+
if (/^\d+$/.test(trimmed)) {
|
|
111
|
+
return trimmed;
|
|
112
|
+
}
|
|
113
|
+
const match = PR_URL_PATTERN.exec(trimmed);
|
|
114
|
+
return match ? match[2] : null;
|
|
115
|
+
}
|
|
116
|
+
function parseGhPrView(stdout) {
|
|
117
|
+
const parsed = JSON.parse(stdout);
|
|
118
|
+
if (typeof parsed.number !== "number" ||
|
|
119
|
+
typeof parsed.headRefName !== "string" ||
|
|
120
|
+
typeof parsed.state !== "string" ||
|
|
121
|
+
typeof parsed.url !== "string" ||
|
|
122
|
+
typeof parsed.isCrossRepository !== "boolean") {
|
|
123
|
+
throw new Error("Unexpected response from `gh pr view --json`");
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
number: parsed.number,
|
|
127
|
+
headRefName: parsed.headRefName,
|
|
128
|
+
state: parsed.state,
|
|
129
|
+
url: parsed.url,
|
|
130
|
+
isCrossRepository: parsed.isCrossRepository,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Strip characters that could break out of the marker-bounded structure
|
|
135
|
+
* `buildFixAttestationCommentBody` builds around a value: a backtick would
|
|
136
|
+
* prematurely close/reopen an adjacent code span; `-->` would prematurely
|
|
137
|
+
* close this function's own HTML comment marker, letting whatever follows
|
|
138
|
+
* render as visible PR-comment content instead of staying hidden inside
|
|
139
|
+
* it; and, the other direction, a bare `<!--` would OPEN a new comment
|
|
140
|
+
* mid-line, hiding everything after it in GitHub's rendered view —
|
|
141
|
+
* including the fenced attestation block that's supposed to stay publicly
|
|
142
|
+
* visible and verifiable. Defense in depth alongside
|
|
143
|
+
* `FixAttestationSubjectSchema.repo`'s tighter character-class validation:
|
|
144
|
+
* this also covers `agentName`, a free-text display name with no schema of
|
|
145
|
+
* its own (an agent's `.mcpi/agent.json` name, sourced from a checkout —
|
|
146
|
+
* see resolve-agent.ts's threat model for the same class of hostile-repo
|
|
147
|
+
* risk applied to CLAUDE.md). Exported so `agent/markers.ts`'s review-verdict
|
|
148
|
+
* marker (the same breakout risk, applied to a reviewer DID/repo instead of
|
|
149
|
+
* an agent name/DID) reuses this exact sanitizer rather than a second copy
|
|
150
|
+
* that could drift on which characters it strips.
|
|
151
|
+
*/
|
|
152
|
+
export function sanitizeForMarkdownBlock(value) {
|
|
153
|
+
return value.replace(/`/g, "'").replace(/-->/g, "- >").replace(/<!--/g, "< !--");
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Build the PR comment body posted for a fix attestation: an HTML-comment
|
|
157
|
+
* marker (so a future `dco` run can find and dedupe on it), a one-line
|
|
158
|
+
* human summary, and a fenced `kya-os-fix-attestation` JSON block that
|
|
159
|
+
* round-trips `FixAttestationSchema`. The marker's fields are duplicated
|
|
160
|
+
* from `attestation` in a stable, greppable form so tooling never has to
|
|
161
|
+
* parse the fenced block just to know which commit/PR a comment is about.
|
|
162
|
+
* The fenced JSON block itself carries the RAW, unsanitized values (it's
|
|
163
|
+
* the actual signed data — sanitizing it would make it not round-trip);
|
|
164
|
+
* only the marker and summary lines, which render as live markdown, are
|
|
165
|
+
* sanitized. That includes `agentDid`: `DidStringSchema` only requires a
|
|
166
|
+
* `did:<method>:` prefix followed by any non-whitespace method-specific
|
|
167
|
+
* id, so it's exactly as free-form (and exactly as hostile-repo-sourced,
|
|
168
|
+
* for a locally-registered agent whose name/DID this command reads off
|
|
169
|
+
* disk) as `agentName` is — same breakout risk, same fix.
|
|
170
|
+
*/
|
|
171
|
+
export function buildFixAttestationCommentBody(attestation, agentName) {
|
|
172
|
+
const { subject } = attestation;
|
|
173
|
+
const safeRepo = sanitizeForMarkdownBlock(subject.repo);
|
|
174
|
+
const safeAgentName = sanitizeForMarkdownBlock(agentName);
|
|
175
|
+
const safeAgentDid = sanitizeForMarkdownBlock(attestation.agentDid);
|
|
176
|
+
const marker = `<!-- kya-os-fix:v1 repo=${safeRepo} pr=${subject.prNumber} fixed=${subject.fixedHeadSha} -->`;
|
|
177
|
+
const summary = `Fix pushed by ${safeAgentName} (${safeAgentDid}): commit \`${subject.fixedHeadSha}\` ` +
|
|
178
|
+
`responds to the review of \`${attestation.respondsToHeadSha}\`.`;
|
|
179
|
+
const block = ["```kya-os-fix-attestation", JSON.stringify(attestation, null, 2), "```"].join("\n");
|
|
180
|
+
return [marker, "", summary, "", block, ""].join("\n");
|
|
181
|
+
}
|
|
182
|
+
export async function runDcoFix(cwd, options) {
|
|
183
|
+
const result = { ok: false };
|
|
184
|
+
// Validate --responds-to's shape BEFORE any side effect, including agent
|
|
185
|
+
// resolution: FixAttestationSchema itself only runs at step 8, after
|
|
186
|
+
// checkout/commit/push, and a malformed value (a truncated or
|
|
187
|
+
// uppercase SHA — an easy paste mistake from some git UIs) would
|
|
188
|
+
// otherwise still push the fix and only then report an
|
|
189
|
+
// attestation-failed follow-up action. Same 40-hex-lowercase shape as
|
|
190
|
+
// FixAttestationSubjectSchema.respondsToHeadSha; only checked when an
|
|
191
|
+
// attestation will actually be attempted (the same gate step 8 uses).
|
|
192
|
+
if (options.attest !== false && options.respondsTo && !/^[0-9a-f]{40}$/.test(options.respondsTo)) {
|
|
193
|
+
result.failure = `invalid-responds-to: "${options.respondsTo}" is not a 40-character lowercase hex commit SHA`;
|
|
194
|
+
return result;
|
|
195
|
+
}
|
|
196
|
+
// Step 1: resolve agent identity, slug-derived DID, and signing config
|
|
197
|
+
// exactly as `dco dispatch` does — see resolveSigningIdentity's doc
|
|
198
|
+
// comment for why this is shared rather than re-derived.
|
|
199
|
+
const identityResult = await resolveSigningIdentity(cwd, options.agent);
|
|
200
|
+
if (!identityResult.ok) {
|
|
201
|
+
result.failure = identityResult.failure;
|
|
202
|
+
if (identityResult.agent)
|
|
203
|
+
result.agent = identityResult.agent.slug;
|
|
204
|
+
if (identityResult.did)
|
|
205
|
+
result.did = identityResult.did;
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
const identity = identityResult.identity;
|
|
209
|
+
result.agent = identity.agent.slug;
|
|
210
|
+
result.did = identity.did;
|
|
211
|
+
if (!(await isGhInstalled())) {
|
|
212
|
+
result.failure =
|
|
213
|
+
"gh-not-installed: GitHub CLI (gh) is not installed. Install it from https://cli.github.com and run `gh auth login`.";
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
if (!(await isGhAuthenticated())) {
|
|
218
|
+
result.failure = "gh-not-authenticated: run `gh auth login` first.";
|
|
219
|
+
return result;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
result.failure = `gh-not-authenticated: ${errorMessage(error)}`;
|
|
224
|
+
return result;
|
|
225
|
+
}
|
|
226
|
+
// gh pr checkout (step 3) switches cwd's checked-out branch — a real side
|
|
227
|
+
// effect on the caller's own working directory. Capture what they were on
|
|
228
|
+
// BEFORE steps 2-7 run (below) and reuse the SAME restore in every
|
|
229
|
+
// pre-commit failure path, including the outer catch: a failure that
|
|
230
|
+
// reaches the outer catch (an unexpected error from one of the "should
|
|
231
|
+
// never fail" calls — the post-checkout branch read, `git add -A`, the
|
|
232
|
+
// post-commit sha/signature reads) must restore just as reliably as a
|
|
233
|
+
// named one, or the caller can be left stranded on the PR branch with
|
|
234
|
+
// nothing accomplished. Best-effort only: a failed restore doesn't change
|
|
235
|
+
// the outcome or need reporting. Detached HEAD falls back to the exact
|
|
236
|
+
// commit rather than a branch name; calling this before checkout ever ran
|
|
237
|
+
// is a harmless no-op (checking out the branch already checked out).
|
|
238
|
+
//
|
|
239
|
+
// The capture itself gets its own try/catch, separate from the steps 2-7
|
|
240
|
+
// block below: it runs BEFORE that block starts, so it isn't covered by
|
|
241
|
+
// it, and these two `git rev-parse` calls are the first real git commands
|
|
242
|
+
// this function issues — nothing yet confirms cwd is even a git checkout.
|
|
243
|
+
// If cwd isn't a git repo (or HEAD is somehow unreadable), fail closed
|
|
244
|
+
// with a named result here instead of letting the rejection escape
|
|
245
|
+
// runDcoFix uncaught: there's no branch to restore in that case anyway,
|
|
246
|
+
// since nothing has switched it yet.
|
|
247
|
+
let originalCheckoutTarget;
|
|
248
|
+
try {
|
|
249
|
+
const originalRef = await run("git", ["rev-parse", "--abbrev-ref", "HEAD"], cwd);
|
|
250
|
+
originalCheckoutTarget =
|
|
251
|
+
originalRef === "HEAD" ? await run("git", ["rev-parse", "HEAD"], cwd) : originalRef;
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
result.failure = `not-a-git-repo: could not determine the current branch in ${cwd} (${errorMessage(error)})`;
|
|
255
|
+
return result;
|
|
256
|
+
}
|
|
257
|
+
const restoreOriginalBranch = async () => {
|
|
258
|
+
try {
|
|
259
|
+
await run("git", ["checkout", originalCheckoutTarget], cwd);
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
// Courtesy only — see comment above.
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
// Steps 2-7 all run inside one try/catch, matching dispatch.ts's own
|
|
266
|
+
// belt-and-braces pattern: each step already returns its own NAMED
|
|
267
|
+
// failure for the outcomes worth naming (wrong-remote, pr-not-open,
|
|
268
|
+
// fork-pr-unsupported, checkout-failed, branch-mismatch,
|
|
269
|
+
// nothing-to-commit, commit-failed, unsigned-commit, push-rejected), but
|
|
270
|
+
// a handful of calls here (the post-checkout branch read, `git add -A`,
|
|
271
|
+
// and the post-commit sha/signature reads) are "should never fail once
|
|
272
|
+
// we got this far" operations with no named-failure story of their own.
|
|
273
|
+
// Without this outer catch, an unexpected failure in one of those would
|
|
274
|
+
// reject the whole function instead of degrading to a clean
|
|
275
|
+
// `{ok:false, failure}` — breaking the "every step fails closed" promise
|
|
276
|
+
// this module's doc comment makes.
|
|
277
|
+
let prView;
|
|
278
|
+
let commitSha;
|
|
279
|
+
let targetRepo;
|
|
280
|
+
try {
|
|
281
|
+
// Step 2: cwd must already be a clone of the target repo. Never clone
|
|
282
|
+
// implicitly — the caller (a human or an executor) owns workspace
|
|
283
|
+
// placement, unlike dispatch's cold-start self-heal.
|
|
284
|
+
let originUrl;
|
|
285
|
+
try {
|
|
286
|
+
originUrl = await run("git", ["remote", "get-url", "origin"], cwd);
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
result.failure = `wrong-remote: could not read git remote "origin" in ${cwd} (${errorMessage(error)})`;
|
|
290
|
+
return result;
|
|
291
|
+
}
|
|
292
|
+
const originRepo = parseOwnerRepoFromRemoteUrl(originUrl);
|
|
293
|
+
if (!originRepo) {
|
|
294
|
+
result.failure = `wrong-remote: could not parse an owner/repo from origin "${originUrl}"`;
|
|
295
|
+
return result;
|
|
296
|
+
}
|
|
297
|
+
if (options.repo && !repoNamesEqual(options.repo, originRepo)) {
|
|
298
|
+
result.failure = `wrong-remote: origin is "${originRepo}" but --repo expects "${options.repo}"`;
|
|
299
|
+
return result;
|
|
300
|
+
}
|
|
301
|
+
// Always the git-derived casing, even when --repo was given: the
|
|
302
|
+
// equality check above only ever confirms --repo names the SAME repo
|
|
303
|
+
// as origin (never redirects to a different one), so origin's casing
|
|
304
|
+
// is the canonical one. Using options.repo's as-typed casing here
|
|
305
|
+
// would let the same PR sign a different subject.repo string on every
|
|
306
|
+
// invocation depending on how --repo happened to be capitalized.
|
|
307
|
+
targetRepo = originRepo;
|
|
308
|
+
// `options.pr` may be a full URL to a repo OTHER than targetRepo (`gh pr
|
|
309
|
+
// view <url>` happily reads any repo's PR data, independent of cwd —
|
|
310
|
+
// that is how `dco verify` supports running from anywhere): reject that
|
|
311
|
+
// mismatch up front. Then normalize to a bare number and pin EVERY gh
|
|
312
|
+
// call below — view included — with an explicit `-R targetRepo`, never
|
|
313
|
+
// ambient resolution: `gh`'s own repo resolution prefers `GH_REPO` (or a
|
|
314
|
+
// `gh repo set-default` override) over cwd's git remote, so even after
|
|
315
|
+
// step 2 confirms cwd's origin matches targetRepo, an unpinned call
|
|
316
|
+
// could still read (and, without the pin, act on) a different repo's
|
|
317
|
+
// same-numbered PR.
|
|
318
|
+
const prUrlRepo = parseOwnerRepoFromPrUrl(options.pr);
|
|
319
|
+
if (prUrlRepo && !repoNamesEqual(prUrlRepo, targetRepo)) {
|
|
320
|
+
result.failure = `wrong-remote: the PR URL points at "${prUrlRepo}" but this checkout targets "${targetRepo}"`;
|
|
321
|
+
return result;
|
|
322
|
+
}
|
|
323
|
+
const prNumberArg = extractPrNumber(options.pr);
|
|
324
|
+
if (!prNumberArg) {
|
|
325
|
+
result.failure = `pr-not-found: could not parse a PR number from "${options.pr}"`;
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
// Step 3: land on the PR's actual head branch and refuse a merged/closed
|
|
329
|
+
// PR. One `gh pr view --json` call serves the state gate, the fork
|
|
330
|
+
// check, and the headRefName confirmation after checkout, so there's no
|
|
331
|
+
// second call to drift out of sync with the first.
|
|
332
|
+
try {
|
|
333
|
+
const stdout = await run("gh", [
|
|
334
|
+
"pr",
|
|
335
|
+
"view",
|
|
336
|
+
prNumberArg,
|
|
337
|
+
"-R",
|
|
338
|
+
targetRepo,
|
|
339
|
+
"--json",
|
|
340
|
+
"number,headRefName,state,url,isCrossRepository",
|
|
341
|
+
], cwd);
|
|
342
|
+
prView = parseGhPrView(stdout);
|
|
343
|
+
}
|
|
344
|
+
catch (error) {
|
|
345
|
+
result.failure = `pr-not-found: could not read PR "${options.pr}" (${errorMessage(error)})`;
|
|
346
|
+
return result;
|
|
347
|
+
}
|
|
348
|
+
if (prView.state !== "OPEN") {
|
|
349
|
+
result.failure = `pr-not-open: PR #${prView.number} is ${prView.state.toLowerCase()}, not open`;
|
|
350
|
+
return result;
|
|
351
|
+
}
|
|
352
|
+
// Refuse a fork PR BEFORE checkout: `gh pr checkout` names the local
|
|
353
|
+
// branch after the fork's `headRefName` verbatim (no owner prefix
|
|
354
|
+
// unless it collides with the base repo's default branch), while
|
|
355
|
+
// `origin` still points at THIS repo. `git push origin
|
|
356
|
+
// HEAD:<headRefName>` further down would then push the fork's content
|
|
357
|
+
// to that name on origin — a ref-creation push if the name doesn't
|
|
358
|
+
// already exist there, which git allows unconditionally regardless of
|
|
359
|
+
// write-access scope. That plants PR-author-controlled content on the
|
|
360
|
+
// trusted repo under a name the fork author picked, not the caller.
|
|
361
|
+
// Refusing here removes the vulnerability rather than trying to
|
|
362
|
+
// sanitize an attacker-chosen name.
|
|
363
|
+
if (prView.isCrossRepository) {
|
|
364
|
+
result.failure = `fork-pr-unsupported: PR #${prView.number} is from a fork; dco fix only pushes fixes to same-repo PRs`;
|
|
365
|
+
return result;
|
|
366
|
+
}
|
|
367
|
+
try {
|
|
368
|
+
// `-R targetRepo` makes this explicit rather than relying on gh's
|
|
369
|
+
// ambient cwd-derived repo resolution: targetRepo is the value this
|
|
370
|
+
// whole flow has already validated (against `--repo` and, above,
|
|
371
|
+
// against a URL-form `options.pr`), so every write from here on is
|
|
372
|
+
// pinned to it directly instead of trusting an implicit lookup to
|
|
373
|
+
// agree with it a second time.
|
|
374
|
+
await run("gh", ["pr", "checkout", String(prView.number), "-R", targetRepo], cwd);
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
await restoreOriginalBranch();
|
|
378
|
+
result.failure = `checkout-failed: ${errorMessage(error)}`;
|
|
379
|
+
return result;
|
|
380
|
+
}
|
|
381
|
+
const currentBranch = await run("git", ["rev-parse", "--abbrev-ref", "HEAD"], cwd);
|
|
382
|
+
if (currentBranch !== prView.headRefName) {
|
|
383
|
+
await restoreOriginalBranch();
|
|
384
|
+
result.failure = `branch-mismatch: checked out "${currentBranch}" but PR #${prView.number}'s head branch is "${prView.headRefName}"`;
|
|
385
|
+
return result;
|
|
386
|
+
}
|
|
387
|
+
result.branch = currentBranch;
|
|
388
|
+
// Step 4: require staged changes. This command never invents content to
|
|
389
|
+
// commit — the staged set IS the fix, so an empty stage is refused
|
|
390
|
+
// rather than silently producing an empty commit. A failure here still
|
|
391
|
+
// leaves the caller back on their original branch (see
|
|
392
|
+
// restoreOriginalBranch above): nothing was accomplished, so nothing
|
|
393
|
+
// should look different when they check `git branch`.
|
|
394
|
+
if (options.stageAll) {
|
|
395
|
+
await run("git", ["add", "-A"], cwd);
|
|
396
|
+
}
|
|
397
|
+
const hasStagedChanges = !(await gitSucceeds(["diff", "--cached", "--quiet"], cwd));
|
|
398
|
+
if (!hasStagedChanges) {
|
|
399
|
+
await restoreOriginalBranch();
|
|
400
|
+
// Undo the `result.branch = currentBranch` assignment above too: cwd
|
|
401
|
+
// is back on the caller's original branch now, so reporting the PR's
|
|
402
|
+
// branch here would misstate where they actually ended up.
|
|
403
|
+
result.branch = undefined;
|
|
404
|
+
result.failure =
|
|
405
|
+
"nothing-to-commit: no staged changes to commit (pass --all to stage everything, or stage changes yourself first)";
|
|
406
|
+
return result;
|
|
407
|
+
}
|
|
408
|
+
// Step 5: commit exactly the staged set. Reuses the same signing
|
|
409
|
+
// config, sign-off, and Co-authored-by trailer discipline `dispatch.ts`
|
|
410
|
+
// uses, but DELIBERATELY with NO path scoping (dispatch's
|
|
411
|
+
// `-- DCO-DEMO.md` guard exists because dispatch invents its own demo
|
|
412
|
+
// content; here the staged set IS the boundary — the command commits
|
|
413
|
+
// what the caller staged, never more, so there's nothing left to scope
|
|
414
|
+
// a pathspec against).
|
|
415
|
+
const message = options.message ?? DEFAULT_COMMIT_MESSAGE;
|
|
416
|
+
const coAuthoredTrailer = `Co-authored-by: ${identity.agent.name} <${identity.agent.slug}@agents.knowthat.ai>`;
|
|
417
|
+
// Captured so an unsigned commit (step 6) can be undone back to exactly
|
|
418
|
+
// this point — staged, not yet committed — rather than left dangling.
|
|
419
|
+
const preCommitSha = await run("git", ["rev-parse", "HEAD"], cwd);
|
|
420
|
+
try {
|
|
421
|
+
await run("git", [
|
|
422
|
+
"-c",
|
|
423
|
+
"core.hooksPath=/dev/null",
|
|
424
|
+
...identity.signingConfig,
|
|
425
|
+
"commit",
|
|
426
|
+
"-s",
|
|
427
|
+
"--trailer",
|
|
428
|
+
coAuthoredTrailer,
|
|
429
|
+
"-m",
|
|
430
|
+
message,
|
|
431
|
+
], cwd);
|
|
432
|
+
}
|
|
433
|
+
catch (error) {
|
|
434
|
+
// Nothing was actually committed — this is a pre-commit failure like
|
|
435
|
+
// checkout-failed/branch-mismatch/nothing-to-commit above, not a
|
|
436
|
+
// post-commit one (unsigned-commit, push-rejected) where a real commit
|
|
437
|
+
// now exists on the PR branch and staying put to let the caller
|
|
438
|
+
// inspect it is the right call. Restore for the same reason those
|
|
439
|
+
// three do: leaving the caller on the PR branch with nothing
|
|
440
|
+
// accomplished misstates what happened.
|
|
441
|
+
await restoreOriginalBranch();
|
|
442
|
+
result.branch = undefined;
|
|
443
|
+
result.failure = `commit-failed: ${errorMessage(error)}`;
|
|
444
|
+
return result;
|
|
445
|
+
}
|
|
446
|
+
// Step 6: verify the commit is signed BEFORE pushing anything.
|
|
447
|
+
commitSha = await run("git", ["rev-parse", "HEAD"], cwd);
|
|
448
|
+
result.commitSha = commitSha;
|
|
449
|
+
const rawCommit = await run("git", ["cat-file", "commit", "HEAD"], cwd);
|
|
450
|
+
result.signed = isCommitSigned(rawCommit);
|
|
451
|
+
if (!result.signed) {
|
|
452
|
+
// Telling the caller to fix signing and "try again" is only true if a
|
|
453
|
+
// retry actually can: undo the unsigned commit back to staged changes
|
|
454
|
+
// (step 4's post-condition) rather than leaving it landed with the
|
|
455
|
+
// staged set already consumed, which would make a retry hit
|
|
456
|
+
// nothing-to-commit instead of re-signing anything.
|
|
457
|
+
let undone = false;
|
|
458
|
+
try {
|
|
459
|
+
await run("git", ["reset", "--soft", preCommitSha], cwd);
|
|
460
|
+
undone = true;
|
|
461
|
+
}
|
|
462
|
+
catch {
|
|
463
|
+
// Leave result.commitSha pointing at the unsigned commit that's
|
|
464
|
+
// still there, since the undo didn't happen — same as any other
|
|
465
|
+
// post-commit failure (push-rejected) where a real commit remains
|
|
466
|
+
// on the PR branch for the caller to inspect.
|
|
467
|
+
}
|
|
468
|
+
if (undone) {
|
|
469
|
+
// Nothing is left on the PR branch — the same "nothing was
|
|
470
|
+
// accomplished" case checkout-failed/branch-mismatch/
|
|
471
|
+
// nothing-to-commit/commit-failed already restore for, so this one
|
|
472
|
+
// does too instead of stranding the caller on a branch holding
|
|
473
|
+
// none of their work.
|
|
474
|
+
result.commitSha = undefined;
|
|
475
|
+
await restoreOriginalBranch();
|
|
476
|
+
result.branch = undefined;
|
|
477
|
+
result.failure =
|
|
478
|
+
"unsigned-commit: the commit was NOT signed and has been undone (your changes are still staged). Run `dco setup` in this repo, then try again.";
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
// The undo itself failed, so the unsigned commit is still sitting
|
|
482
|
+
// on the PR branch — staying put (not restoring) matches how
|
|
483
|
+
// push-rejected leaves a real commit in place for the caller to
|
|
484
|
+
// inspect, and the message says so honestly instead of claiming an
|
|
485
|
+
// undo that didn't happen.
|
|
486
|
+
result.failure =
|
|
487
|
+
"unsigned-commit: the commit was created but is NOT signed, and could not be undone automatically. Run `dco setup` in this repo, then `git reset --soft HEAD~1` (or amend the commit) and try again.";
|
|
488
|
+
}
|
|
489
|
+
return result;
|
|
490
|
+
}
|
|
491
|
+
// Step 7: push to the EXISTING branch. Never force, never `-u` a new
|
|
492
|
+
// branch, never `gh pr create`. Hooks disabled here for the same reason
|
|
493
|
+
// the commit step above disables them: `cwd` may be a clone a headless
|
|
494
|
+
// agent pass with full file-system write access just ran in (the
|
|
495
|
+
// `kya-os agent task --watch` fix-round caller of this function — see
|
|
496
|
+
// its own doc comment on `writeCapable` in spawn-agent.ts), and a planted
|
|
497
|
+
// `.git/hooks/pre-push` would otherwise execute with this process's own
|
|
498
|
+
// credentials at push time regardless of what Bash commands were denied
|
|
499
|
+
// during that pass.
|
|
500
|
+
try {
|
|
501
|
+
await run("git", ["-c", "core.hooksPath=/dev/null", "push", "origin", `HEAD:${prView.headRefName}`], cwd);
|
|
502
|
+
}
|
|
503
|
+
catch (error) {
|
|
504
|
+
result.failure = `push-rejected: ${errorMessage(error)}`;
|
|
505
|
+
return result;
|
|
506
|
+
}
|
|
507
|
+
result.pushed = true;
|
|
508
|
+
result.prUrl = prView.url;
|
|
509
|
+
}
|
|
510
|
+
catch (error) {
|
|
511
|
+
await restoreOriginalBranch();
|
|
512
|
+
result.branch = undefined;
|
|
513
|
+
result.failure = errorMessage(error);
|
|
514
|
+
return result;
|
|
515
|
+
}
|
|
516
|
+
// Step 8: sign and post a fix attestation, when requested and there's a
|
|
517
|
+
// reviewed head to answer. Skipped (not failed) when `respondsTo` is
|
|
518
|
+
// absent — signing an attestation that answers nothing would be worse
|
|
519
|
+
// than not posting one. Signing stays entirely inside this function: the
|
|
520
|
+
// seed is recovered from the SAME converted SSH key file
|
|
521
|
+
// `resolveSigningIdentity` already validated exists, never a second copy
|
|
522
|
+
// of key material, and it never leaves this scope.
|
|
523
|
+
result.attested = false;
|
|
524
|
+
if (options.attest !== false && options.respondsTo) {
|
|
525
|
+
try {
|
|
526
|
+
const pem = readFileSync(identity.keyPath, "utf-8");
|
|
527
|
+
const { seed } = parseEd25519SshPrivateKeyPem(pem);
|
|
528
|
+
const subject = {
|
|
529
|
+
repo: targetRepo,
|
|
530
|
+
prNumber: prView.number,
|
|
531
|
+
fixedHeadSha: commitSha,
|
|
532
|
+
};
|
|
533
|
+
const signingString = getFixAttestationSigningString(subject, options.respondsTo);
|
|
534
|
+
const signature = signWithEd25519Seed(seed, Buffer.from(signingString, "utf8")).toString("base64url");
|
|
535
|
+
const attestation = FixAttestationSchema.parse({
|
|
536
|
+
subject,
|
|
537
|
+
respondsToHeadSha: options.respondsTo,
|
|
538
|
+
taskId: options.taskId,
|
|
539
|
+
agentDid: identity.did,
|
|
540
|
+
proof: { alg: "Ed25519", signature },
|
|
541
|
+
});
|
|
542
|
+
const body = buildFixAttestationCommentBody(attestation, identity.agent.name);
|
|
543
|
+
// `-R targetRepo`, same reasoning as the checkout call above: pin the
|
|
544
|
+
// write to the already-validated repo explicitly.
|
|
545
|
+
await run("gh", ["pr", "comment", String(prView.number), "--body", body, "-R", targetRepo], cwd);
|
|
546
|
+
result.attested = true;
|
|
547
|
+
}
|
|
548
|
+
catch (error) {
|
|
549
|
+
// The commit already landed and pushed successfully by this point —
|
|
550
|
+
// an attestation-posting failure is a follow-up action pending, not a
|
|
551
|
+
// reason to report the whole fix as failed.
|
|
552
|
+
result.failure = `attestation-failed: ${errorMessage(error)}`;
|
|
553
|
+
result.ok = true;
|
|
554
|
+
return result;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
result.ok = true;
|
|
558
|
+
return result;
|
|
559
|
+
}
|
|
560
|
+
//# sourceMappingURL=fix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix.js","sourceRoot":"","sources":["../../../src/utils/dco/fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC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C;IAAE,MAAM,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA8CtD"}
|
|
@@ -2,7 +2,7 @@ import { execFile } from "child_process";
|
|
|
2
2
|
import { promisify } from "util";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, realpathSync } from "fs";
|
|
4
4
|
import { isAbsolute, join, resolve, sep } from "path";
|
|
5
|
-
import { writeFileAtomicSafe } from "
|
|
5
|
+
import { writeFileAtomicSafe } from "../cli-kit/index.js";
|
|
6
6
|
const execFileAsync = promisify(execFile);
|
|
7
7
|
/** Resolve symlinks when the path exists; fall back to the input otherwise. */
|
|
8
8
|
function realpathIfExists(path) {
|
|
@@ -72,7 +72,9 @@ export async function getHooksDir(cwd) {
|
|
|
72
72
|
if (hooksPath) {
|
|
73
73
|
// core.hooksPath is relative to the working-tree root, not cwd.
|
|
74
74
|
const topLevel = await git(["rev-parse", "--show-toplevel"], cwd);
|
|
75
|
-
const dir = isAbsolute(hooksPath)
|
|
75
|
+
const dir = isAbsolute(hooksPath)
|
|
76
|
+
? hooksPath
|
|
77
|
+
: resolve(topLevel, hooksPath);
|
|
76
78
|
return { dir, source: "core.hooksPath" };
|
|
77
79
|
}
|
|
78
80
|
// --git-path resolves "hooks" against the COMMON git dir (where git actually
|
|
@@ -92,7 +94,7 @@ export function buildTrailerHook(human, agent) {
|
|
|
92
94
|
const coAuthoredBy = shQuote(`Co-authored-by: ${agent.name} <${agent.email}>`);
|
|
93
95
|
return `#!/bin/sh
|
|
94
96
|
${HOOK_MARKER} v1
|
|
95
|
-
# Managed by \`
|
|
97
|
+
# Managed by \`dco setup\`. Appends the DCO sign-off and agent
|
|
96
98
|
# attribution trailers to commit messages when they are missing.
|
|
97
99
|
|
|
98
100
|
COMMIT_MSG_FILE="$1"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-config.js","sourceRoot":"","sources":["../../../src/utils/dco/git-config.ts"],"names":[],"mappings":"AAAA,O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