crysk 0.6.1 → 0.8.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/README.md +28 -22
- package/dist/SKILL-1q3658n0.md +74 -0
- package/dist/SKILL-25j4q9b8.md +143 -0
- package/dist/SKILL-32cmme3j.md +143 -0
- package/dist/SKILL-4747bhne.md +143 -0
- package/dist/SKILL-4jc3sv23.md +74 -0
- package/dist/SKILL-c0492rch.md +540 -0
- package/dist/SKILL-d1nzkhhr.md +74 -0
- package/dist/SKILL-f8p7kvx0.md +143 -0
- package/dist/SKILL-gxd45g38.md +553 -0
- package/dist/SKILL-rec41991.md +66 -0
- package/dist/SKILL-zze8zj5g.md +536 -0
- package/dist/adjudicator-eckqh14e.md +78 -0
- package/dist/ci-admission-qn797a6c.md +128 -0
- package/dist/cli.js +18608 -18523
- package/dist/consolidate-4xw1pkg7.md +24 -0
- package/dist/deep-review-logic-dgr112y1.md +196 -0
- package/dist/deep-review-logic-fck5z4xe.md +197 -0
- package/dist/deep-review-logic-h1fpamfh.md +192 -0
- package/dist/deep-review-logic-m4vk5683.md +196 -0
- package/dist/deep-review-logic-z63kmgmc.md +157 -0
- package/dist/deep-review-parity-7x7s5d81.md +148 -0
- package/dist/deep-review-parity-9wxmynsc.md +115 -0
- package/dist/deep-review-parity-bwwe7cx6.md +152 -0
- package/dist/deep-review-parity-e50pw3pk.md +117 -0
- package/dist/deep-review-parity-ennmm9m1.md +151 -0
- package/{prompts/default/deep-review-parity.md → dist/deep-review-parity-h7y6y2he.md} +14 -16
- package/dist/deep-review-parity-xg6wy69c.md +151 -0
- package/dist/deep-review-reliability-6h3c4gmw.md +125 -0
- package/dist/deep-review-reliability-dcjab69x.md +122 -0
- package/dist/deep-review-reliability-ec7b5pbk.md +159 -0
- package/dist/deep-review-reliability-hvasvmt9.md +153 -0
- package/dist/deep-review-reliability-mjnayxmt.md +158 -0
- package/dist/deep-review-reliability-mm7fnayf.md +124 -0
- package/dist/deep-review-reliability-xk4xvc2w.md +158 -0
- package/dist/deep-review-resilience-0esd5qeh.md +148 -0
- package/dist/deep-review-resilience-envgcmpy.md +115 -0
- package/dist/deep-review-resilience-fgx8ythf.md +151 -0
- package/dist/deep-review-resilience-mq5qa6ad.md +152 -0
- package/dist/deep-review-resilience-pwh1gawp.md +151 -0
- package/dist/deep-review-resilience-s9n21dkx.md +117 -0
- package/dist/deep-review-resilience-vz4qskea.md +119 -0
- package/dist/deep-review-security-1vwjdc9q.md +205 -0
- package/dist/deep-review-security-x1cc1z00.md +205 -0
- package/dist/index.js +590 -485
- package/dist/opencode-ci-jc8mf4wn.md +106 -0
- package/dist/opencode-ci-qrcv7a99.md +106 -0
- package/dist/opencode-ci-rdpcc7xc.md +106 -0
- package/dist/opencode-ci-yt0k74t0.md +106 -0
- package/dist/review-refuter-7qffwtzz.md +77 -0
- package/dist/verifier-tyh8r45v.md +40 -0
- package/dist/verifier-xf4xj701.md +40 -0
- package/dist/workflow-andv2dvm.yml +158 -0
- package/package.json +1 -1
- package/prompts/consolidate.md +1 -1
- package/prompts/default/PROVENANCE.md +6 -0
- package/prompts/default/deep-review-logic.md +56 -15
- package/prompts/default/deep-review-reliability.md +64 -30
- package/prompts/default/deep-review-resilience.md +71 -37
- package/prompts/default/deep-review-security.md +205 -0
- package/prompts/default/review-refuter.md +1 -1
- package/prompts/verifier.md +40 -0
- package/skills/crysk/SKILL.md +6 -6
- package/skills/crysk-ci-setup/SKILL.md +32 -33
- package/skills/crysk-ci-setup/assets/workflow.yml +5 -10
- package/skills/crysk-ci-setup/references/ci-admission.md +5 -5
- package/skills/crysk-ci-setup/references/opencode-ci.md +6 -6
- package/skills/crysk-loop/SKILL.md +37 -54
- package/skills/crysk-loop/adjudicator.md +10 -18
- package/skills/crysk-pr/SKILL.md +1 -1
- package/src/asset-manifest.ts +6 -6
- package/src/assets.ts +4 -4
- package/src/brand.ts +20 -30
- package/src/ci/gates.ts +155 -192
- package/src/ci/outcome.ts +4 -31
- package/src/ci/platform-limits.ts +135 -0
- package/src/ci/platform-report.ts +212 -126
- package/src/ci/platform.ts +28 -26
- package/src/ci/reporter.ts +25 -26
- package/src/ci/review-admission.ts +1 -2
- package/src/ci/review-levels.ts +12 -53
- package/src/ci/setup.ts +96 -66
- package/src/ci/trace-bundle.ts +11 -27
- package/src/ci/trace-transcripts.ts +4 -6
- package/src/ci/trigger.ts +3 -5
- package/src/cli.ts +6 -5
- package/src/commands/ci-setup-questions.ts +2 -55
- package/src/commands/ci-setup.ts +2 -26
- package/src/commands/triage.ts +131 -38
- package/src/commands/usage.ts +0 -1
- package/src/compare/compare.ts +3 -3
- package/src/compare/floor-test.ts +30 -201
- package/src/compare/hunter-exam.ts +631 -0
- package/src/config/config.ts +6 -30
- package/src/diversity/accounting.ts +0 -26
- package/src/diversity/benchmark.ts +1 -17
- package/src/diversity/identity.ts +0 -14
- package/src/diversity/pipeline-integration.ts +0 -29
- package/src/doctor.ts +3 -6
- package/src/execution/claude-session-trace.ts +7 -2
- package/src/execution/contracts.ts +15 -9
- package/src/execution/harness.ts +165 -187
- package/src/execution/spend-limiter.ts +39 -131
- package/src/execution/usage-facts.ts +397 -0
- package/src/execution/usage-normalized.ts +33 -86
- package/src/harness/materiality-judge.ts +0 -5
- package/src/harness/pipeline-plan.ts +0 -3
- package/src/harness/replay-rows.ts +0 -5
- package/src/harness/route-runner.ts +2 -2
- package/src/harness/single-step.ts +3 -9
- package/src/index.ts +1 -1
- package/src/mcp/preflight.ts +2 -2
- package/src/model/catalog.ts +1 -3
- package/src/model/free-discovery.ts +11 -78
- package/src/model/model-name.ts +16 -5
- package/src/model/profiles/claude.ts +1 -2
- package/src/model/profiles/openai.ts +1 -2
- package/src/model/profiles.ts +2 -3
- package/src/model/provider-capabilities.ts +16 -55
- package/src/model/routing.ts +39 -36
- package/src/pr/admission.ts +6 -6
- package/src/pr/answered-findings.ts +8 -4
- package/src/pr/ci-publish.ts +0 -2
- package/src/pr/discovery.ts +4 -25
- package/src/pr/plan.ts +40 -121
- package/src/pr/pr-status.ts +14 -2
- package/src/pr/pr.ts +1 -1
- package/src/pr/preflight.ts +44 -15
- package/src/pr/publish-outcome.ts +1 -19
- package/src/pr/review-pr.ts +15 -47
- package/src/pr/target.ts +76 -82
- package/src/production-runtime.ts +52 -114
- package/src/progress.ts +0 -54
- package/src/rereview/prepare.ts +4 -1
- package/src/rereview/state.ts +1 -1
- package/src/rereview/verify.ts +15 -9
- package/src/review/boundary.ts +5 -8
- package/src/review/drafts.ts +3 -3
- package/src/review/findings-conformance.ts +1 -1
- package/src/review/findings.ts +0 -4
- package/src/review/pipeline.ts +194 -407
- package/src/review/preflight.ts +175 -201
- package/src/review/prompt-set.ts +1 -2
- package/src/review/report.ts +2 -162
- package/src/review/review.ts +25 -74
- package/src/review/route-preflight.ts +19 -35
- package/src/review/run.ts +37 -73
- package/src/review/size-gate.ts +3 -3
- package/src/review/spec.ts +6 -11
- package/src/review/step-runner.ts +4 -4
- package/src/runner-authority.ts +10 -9
- package/src/security/credential-broker.ts +5 -6
- package/src/server/preflight.ts +0 -1
- package/src/server/server.ts +17 -6
- package/src/store/activity.ts +1 -2
- package/src/store/backfill-preflight.ts +0 -3
- package/src/store/backfill.ts +0 -1
- package/src/store/metrics-preflight.ts +4 -14
- package/src/store/metrics.ts +5 -5
- package/src/store/preflight.ts +0 -13
- package/src/store/store.ts +11 -12
- package/src/transport-registry.ts +6 -30
- package/src/transports/claude-code-cli.ts +149 -215
- package/src/transports/opencode-client.ts +4 -24
- package/src/transports/opencode-sdk.ts +17 -112
- package/src/triage/plain-reply.ts +37 -0
- package/src/ui/activity.ts +1 -6
- package/src/ui/config-edit.ts +14 -67
- package/src/ui/config.ts +3 -8
- package/src/ui/plan.ts +11 -198
- package/src/ui/progress.ts +3 -49
- package/src/ui/result.ts +18 -77
- package/src/ui/review-menu.ts +3 -12
- package/src/ui/select.ts +9 -79
- package/src/updater.ts +1 -1
- package/src/usage.ts +1 -7
- package/prompts/scout.md +0 -140
- package/src/ci/platform-estimate.ts +0 -111
- package/src/review/scout.ts +0 -323
package/src/model/profiles.ts
CHANGED
|
@@ -21,12 +21,11 @@ import { OPENAI_PROFILE } from "./profiles/openai";
|
|
|
21
21
|
|
|
22
22
|
// The roles a profile assigns. `hunter` covers every `hunter.<key>` the
|
|
23
23
|
// profile does not name in `hunters`. `refuter` covers the verifier and the
|
|
24
|
-
// adjudicator too: they run the refuter's
|
|
24
|
+
// adjudicator too: they run as the refuter's agent, under its step key.
|
|
25
25
|
export const PROFILE_ROLES = [
|
|
26
26
|
"hunter",
|
|
27
27
|
"refuter",
|
|
28
28
|
"consolidate",
|
|
29
|
-
"scout",
|
|
30
29
|
"summary",
|
|
31
30
|
"judge",
|
|
32
31
|
] as const;
|
|
@@ -45,7 +44,7 @@ export interface ModelProfile {
|
|
|
45
44
|
readonly id: string;
|
|
46
45
|
// A role the profile leaves out falls back to the fallback profile's.
|
|
47
46
|
readonly roles: Readonly<Partial<Record<ProfileRole, ProfileRoute>>>;
|
|
48
|
-
// Per-hunter overrides, keyed by specialty (`logic`, `
|
|
47
|
+
// Per-hunter overrides, keyed by specialty (`logic`, `security`, ...).
|
|
49
48
|
readonly hunters?: Readonly<Record<string, ProfileRoute>>;
|
|
50
49
|
// The profile's prompt set (S4): the name of a set under
|
|
51
50
|
// `prompts/profiles/<name>/` that holds only the files that differ from the
|
|
@@ -37,8 +37,8 @@ export type CredentialKind =
|
|
|
37
37
|
// <provider> --verbose --refresh`). Authenticates with NOTHING — no OAuth
|
|
38
38
|
// record, no API token — so it is refused at credential projection without
|
|
39
39
|
// a kind of its own. Not metered (`credentialKindBillsMetered` is false),
|
|
40
|
-
// so
|
|
41
|
-
//
|
|
40
|
+
// so usage stamps subscription (truthful zero). Additive: every consumer
|
|
41
|
+
// compares with ===/!== or passes through.
|
|
42
42
|
| "provider_free";
|
|
43
43
|
|
|
44
44
|
export type ExecutableDenialCode = "executable_not_approved";
|
|
@@ -344,7 +344,6 @@ export interface ProviderCapabilityReport {
|
|
|
344
344
|
};
|
|
345
345
|
readonly billing: {
|
|
346
346
|
mode: "subscription" | "metered" | "unknown";
|
|
347
|
-
pricingReady: boolean;
|
|
348
347
|
};
|
|
349
348
|
readonly rateLimitBucketId?: string;
|
|
350
349
|
readonly issues: readonly {
|
|
@@ -649,21 +648,6 @@ export async function produceClaudeCapabilityReport(
|
|
|
649
648
|
},
|
|
650
649
|
billing: {
|
|
651
650
|
mode: CLAUDE_CAPABILITY_STATICS.billingMode,
|
|
652
|
-
// #197. The old `false` reasoned about a model id: this is a
|
|
653
|
-
// BACKEND-wide report produced before any route resolves, and
|
|
654
|
-
// `tokenPricingAvailableFor` needed a provider AND a model to answer.
|
|
655
|
-
// That function and the tables behind it are deleted, and the flag it
|
|
656
|
-
// fed never meant what the comment assumed — `pricingReady` asserts
|
|
657
|
-
// "will this transport tell you what the attempt cost?", which is a
|
|
658
|
-
// backend-wide fact needing no model. The claude-code CLI reports
|
|
659
|
-
// `total_cost_usd`, so the honest answer here is `true`.
|
|
660
|
-
//
|
|
661
|
-
// Kept IDENTICAL to ClaudeCodeCliTransport.capabilities() on purpose:
|
|
662
|
-
// "the transport contradicts the producer in no environment"
|
|
663
|
-
// (test/model/provider-capabilities.test.ts) is a structural guard, and a
|
|
664
|
-
// producer disagreeing with the transport that actually runs the route
|
|
665
|
-
// is the drift it exists to catch.
|
|
666
|
-
pricingReady: true,
|
|
667
651
|
},
|
|
668
652
|
issues,
|
|
669
653
|
};
|
|
@@ -706,9 +690,8 @@ function gateDecisionFromIssues(
|
|
|
706
690
|
};
|
|
707
691
|
}
|
|
708
692
|
|
|
709
|
-
// Exact-binding gate (§11 production runtime):
|
|
710
|
-
//
|
|
711
|
-
// routes require tokenPricingAvailable before spend.
|
|
693
|
+
// Exact-binding gate (§11 production runtime): an unresolved binary, a failed
|
|
694
|
+
// auth probe, an unavailable SDK or an unknown billing mode refuse the route.
|
|
712
695
|
export function exactBindingCapabilityIssues(
|
|
713
696
|
report: ExactBindingCapabilityReport,
|
|
714
697
|
): readonly { code: string; message: string; blocking: boolean }[] {
|
|
@@ -737,46 +720,24 @@ export function exactBindingCapabilityIssues(
|
|
|
737
720
|
blocking: true,
|
|
738
721
|
});
|
|
739
722
|
}
|
|
740
|
-
if (
|
|
741
|
-
report.billing.pricingApplicability === "required" &&
|
|
742
|
-
!report.billing.tokenPricingAvailable
|
|
743
|
-
) {
|
|
744
|
-
issues.push({
|
|
745
|
-
code: "pricing_table_missing",
|
|
746
|
-
message: `token pricing required but unavailable for binding ${label}`,
|
|
747
|
-
blocking: true,
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
723
|
// WHY: this is the enforcement point for the design's "billingMode:
|
|
751
724
|
// 'unknown' is a blocking preflight result"
|
|
752
725
|
// (docs/multi-runtime-model-diversity-design.md:461). The legacy
|
|
753
726
|
// ProviderCapabilityReport has three billing modes and the exact contract
|
|
754
727
|
// has two, so FrozenRuntimeBinding.capabilities() narrows `unknown` into
|
|
755
|
-
// "subscription";
|
|
756
|
-
//
|
|
757
|
-
//
|
|
758
|
-
//
|
|
759
|
-
//
|
|
760
|
-
//
|
|
761
|
-
//
|
|
762
|
-
// the
|
|
763
|
-
//
|
|
764
|
-
|
|
765
|
-
// independence (src/execution/contracts.ts:235-237) for any future
|
|
766
|
-
// producer.
|
|
767
|
-
//
|
|
768
|
-
// #133 does not weaken this: the effective mode only ever replaces
|
|
769
|
-
// `unknown` with `metered`, and a metered route without pricing is caught
|
|
770
|
-
// by pricing_table_missing above instead. Nothing reaches "subscription"
|
|
771
|
-
// that did not already, so `unknown` still ends in a blocking refusal on
|
|
772
|
-
// one branch or the other.
|
|
773
|
-
if (
|
|
774
|
-
report.billing.pricingApplicability !== "required" &&
|
|
775
|
-
!report.billing.cashCostAccountingValid
|
|
776
|
-
) {
|
|
728
|
+
// "subscription"; the producer therefore derives `modeKnown` from the
|
|
729
|
+
// THREE-STATE effective mode (#133's `effectiveBillingMode`, which is the
|
|
730
|
+
// transport's own mode for every kind except `provider_api_token`) and
|
|
731
|
+
// reports false for `unknown`, and this branch is what turns that fact into
|
|
732
|
+
// a refusal. It is reachable through the real producer (see
|
|
733
|
+
// test/production-runtime.test.ts "an unknown legacy billing mode blocks the
|
|
734
|
+
// exact-binding gate through the real producer"). The platform prices a run
|
|
735
|
+
// by the credential class the engine reports, so a route whose class cannot
|
|
736
|
+
// be named is refused before it runs.
|
|
737
|
+
if (!report.billing.modeKnown) {
|
|
777
738
|
issues.push({
|
|
778
|
-
code: "
|
|
779
|
-
message: `
|
|
739
|
+
code: "billing_mode_unknown",
|
|
740
|
+
message: `billing mode is unknown for binding ${label}`,
|
|
780
741
|
blocking: true,
|
|
781
742
|
});
|
|
782
743
|
}
|
package/src/model/routing.ts
CHANGED
|
@@ -174,7 +174,7 @@ export interface ResolveStepRouteInput {
|
|
|
174
174
|
readonly stepKey: string;
|
|
175
175
|
readonly role: string;
|
|
176
176
|
// The `models` key this step reads (`hunter.logic`, `refuter`, `summary`,
|
|
177
|
-
// `
|
|
177
|
+
// `consolidate`). Absent: only `models.default` is consulted.
|
|
178
178
|
readonly modelRole?: string;
|
|
179
179
|
readonly cliModel?: string;
|
|
180
180
|
readonly specModel?: string;
|
|
@@ -387,15 +387,16 @@ export function agentModelRole(agent: {
|
|
|
387
387
|
return undefined;
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
//
|
|
391
|
-
//
|
|
392
|
-
//
|
|
393
|
-
//
|
|
394
|
-
|
|
390
|
+
// The hunter roles of `models` that this review's hunters cannot take. A role
|
|
391
|
+
// of a hunter the product removed (`hunter.parity`) is ignored, not an error:
|
|
392
|
+
// the same file kept working before the removal, so it keeps working. Every
|
|
393
|
+
// other `hunter.<key>` that names no hunter of the spec is a typo.
|
|
394
|
+
const REMOVED_HUNTER_ROLES: readonly string[] = ["hunter.parity"];
|
|
395
|
+
|
|
396
|
+
function unknownHunterRoles(
|
|
395
397
|
models: ModelsConfig | undefined,
|
|
396
398
|
agents: readonly RouteAgent[],
|
|
397
|
-
):
|
|
398
|
-
if (models === undefined) return;
|
|
399
|
+
): { hunters: string[]; unknown: string[] } {
|
|
399
400
|
const hunters = [
|
|
400
401
|
...new Set(
|
|
401
402
|
agents
|
|
@@ -403,9 +404,36 @@ function assertHunterRolesExist(
|
|
|
403
404
|
.map((agent) => agent.specialty ?? agent.key),
|
|
404
405
|
),
|
|
405
406
|
];
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
const unknown = Object.keys(models ?? {}).filter(
|
|
408
|
+
(role) =>
|
|
409
|
+
role.startsWith("hunter.") &&
|
|
410
|
+
isModelRole(role) &&
|
|
411
|
+
!hunters.includes(role.slice("hunter.".length)),
|
|
412
|
+
);
|
|
413
|
+
return { hunters, unknown };
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// The roles of removed hunters the spec does not carry, for the caller to warn
|
|
417
|
+
// about once per run (the config parser cannot: it does not know the spec).
|
|
418
|
+
export function removedHunterRoles(
|
|
419
|
+
models: ModelsConfig | undefined,
|
|
420
|
+
agents: readonly RouteAgent[],
|
|
421
|
+
): string[] {
|
|
422
|
+
return unknownHunterRoles(models, agents).unknown.filter((role) =>
|
|
423
|
+
REMOVED_HUNTER_ROLES.includes(role),
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// `hunter.<key>` is open at parse time (the spec is not loaded yet), so it is
|
|
428
|
+
// checked here, against EVERY hunter the spec declares, not only the ones that
|
|
429
|
+
// fire.
|
|
430
|
+
function assertHunterRolesExist(
|
|
431
|
+
models: ModelsConfig | undefined,
|
|
432
|
+
agents: readonly RouteAgent[],
|
|
433
|
+
): void {
|
|
434
|
+
const { hunters, unknown } = unknownHunterRoles(models, agents);
|
|
435
|
+
for (const role of unknown) {
|
|
436
|
+
if (REMOVED_HUNTER_ROLES.includes(role)) continue;
|
|
409
437
|
throw new InvalidModelError(
|
|
410
438
|
`models.${role} names no hunter in this review: its hunters are ${hunters.join(", ")}`,
|
|
411
439
|
);
|
|
@@ -439,12 +467,6 @@ export interface BuildRoutePlanInput {
|
|
|
439
467
|
};
|
|
440
468
|
// `defaultModel` is the legacy spelling of the profile seat, still passed by
|
|
441
469
|
// callers that predate profiles; it outranks the profile when given.
|
|
442
|
-
readonly scout?: {
|
|
443
|
-
model?: string;
|
|
444
|
-
frontmatterModel?: string;
|
|
445
|
-
defaultModel?: string;
|
|
446
|
-
bundled?: boolean;
|
|
447
|
-
};
|
|
448
470
|
readonly consolidate?: {
|
|
449
471
|
model?: string;
|
|
450
472
|
frontmatterModel?: string;
|
|
@@ -581,25 +603,6 @@ export function buildResolvedRoutePlan(
|
|
|
581
603
|
}),
|
|
582
604
|
);
|
|
583
605
|
}
|
|
584
|
-
if (input.scout) {
|
|
585
|
-
stepRoutes.push(
|
|
586
|
-
resolveStepRoute({
|
|
587
|
-
stepKey: "scout",
|
|
588
|
-
role: "scout",
|
|
589
|
-
modelRole: "scout",
|
|
590
|
-
// `--model` outranks `--scout-model`, as the scout step records it.
|
|
591
|
-
cliModel: input.cliModel ?? input.scout.model,
|
|
592
|
-
...(input.scout.bundled === true
|
|
593
|
-
? {}
|
|
594
|
-
: {
|
|
595
|
-
frontmatterModel:
|
|
596
|
-
input.scout.frontmatterModel ?? input.scout.defaultModel,
|
|
597
|
-
}),
|
|
598
|
-
...profileSeat("scout"),
|
|
599
|
-
models: input.models,
|
|
600
|
-
}),
|
|
601
|
-
);
|
|
602
|
-
}
|
|
603
606
|
if (input.consolidate) {
|
|
604
607
|
stepRoutes.push(
|
|
605
608
|
resolveStepRoute({
|
package/src/pr/admission.ts
CHANGED
|
@@ -209,7 +209,7 @@ export async function reserveCiAdmissionLedger(input: {
|
|
|
209
209
|
priorScore?: number | null;
|
|
210
210
|
blockingCount?: number | null;
|
|
211
211
|
advisoryCount?: number | null;
|
|
212
|
-
// A comment-triggered run (`/
|
|
212
|
+
// A comment-triggered run (`/crysk review`, `/crysk recheck`): its row is
|
|
213
213
|
// marked so the attempt count leaves it out (see countTerminalAttempts).
|
|
214
214
|
forced?: boolean;
|
|
215
215
|
// Test-only seam (default: the real Bun.spawn), threaded to the check-run write.
|
|
@@ -256,7 +256,7 @@ export async function recordCiAdmissionGateSkip(input: {
|
|
|
256
256
|
blockingCount: number | null;
|
|
257
257
|
advisoryCount: number | null;
|
|
258
258
|
// A skip that spent nothing and must not count against ci_max_attempts
|
|
259
|
-
// (a /
|
|
259
|
+
// (a /crysk stop): settled as "gate-skipped", like a size or budget skip.
|
|
260
260
|
unspent?: boolean;
|
|
261
261
|
}): Promise<void> {
|
|
262
262
|
try {
|
|
@@ -399,7 +399,7 @@ export function carriedSuccessDescription(label: string, sha: string): string {
|
|
|
399
399
|
// The text a skip writes when it inherits a finished review's blocking failure, with that review's count.
|
|
400
400
|
export function carriedBlockingDescription(count: number, sha: string): string {
|
|
401
401
|
return clipStatusDescription(
|
|
402
|
-
`${STATUS_CONTEXT}: ${count} blocking finding(s) ${CARRIED_FROM}${sha.slice(0, 7)} — fix and push, or /
|
|
402
|
+
`${STATUS_CONTEXT}: ${count} blocking finding(s) ${CARRIED_FROM}${sha.slice(0, 7)} — fix and push, or /crysk override`,
|
|
403
403
|
);
|
|
404
404
|
}
|
|
405
405
|
|
|
@@ -434,7 +434,7 @@ export function carriedPartialDescription(
|
|
|
434
434
|
): string {
|
|
435
435
|
const suffix = set === undefined ? "" : `, set ${set}`;
|
|
436
436
|
return clipStatusDescription(
|
|
437
|
-
`${STATUS_CONTEXT}: review partial (${failed} of ${total} hunters failed${suffix}) ${CARRIED_FROM}${sha.slice(0, 7)} — /
|
|
437
|
+
`${STATUS_CONTEXT}: review partial (${failed} of ${total} hunters failed${suffix}) ${CARRIED_FROM}${sha.slice(0, 7)} — /crysk review retries it`,
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
440
|
|
|
@@ -608,7 +608,7 @@ function failClosed(label: string): AdmissionStatusDecision {
|
|
|
608
608
|
return {
|
|
609
609
|
state: "failure",
|
|
610
610
|
description: clipStatusDescription(
|
|
611
|
-
`${STATUS_CONTEXT} skipped the review (${label}) and found no earlier verdict — /
|
|
611
|
+
`${STATUS_CONTEXT} skipped the review (${label}) and found no earlier verdict — /crysk review reviews it`,
|
|
612
612
|
),
|
|
613
613
|
};
|
|
614
614
|
}
|
|
@@ -763,7 +763,7 @@ async function findCarriedVerdict(input: {
|
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
765
|
|
|
766
|
-
// WHY the head's override holds: a human's `/
|
|
766
|
+
// WHY the head's override holds: a human's `/crysk override` on this head is the decision for it. A
|
|
767
767
|
// re-run or reopen of the gate on that unchanged head would otherwise write the skip's verdict over it.
|
|
768
768
|
// So where the newest pr-hero status on the head is an override, the skip writes nothing. This holds when
|
|
769
769
|
// the head's statuses can be read.
|
|
@@ -2,6 +2,7 @@ import { liveBlockingFindings } from "#pr/pr-status";
|
|
|
2
2
|
import { parseFindingMarker } from "#pr/preflight";
|
|
3
3
|
import { TIER_UNRECOVERABLE } from "#rereview/classify";
|
|
4
4
|
import { CI_ADJUDICATOR_LOGIN } from "#triage/adjudication";
|
|
5
|
+
import { withPlainAppliedReplies } from "#triage/plain-reply";
|
|
5
6
|
import { parseTriageMarker } from "#triage/triage";
|
|
6
7
|
import { parsePrCommentMarker } from "#watch/preflight";
|
|
7
8
|
|
|
@@ -35,12 +36,15 @@ function isTriageReply(body: string): boolean {
|
|
|
35
36
|
return parseTriageMarker(body) !== null;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
// The logins whose permission the gate must look up: every author of a triage reply
|
|
39
|
+
// The logins whose permission the gate must look up: every author of a triage reply, a plain `applied`
|
|
40
|
+
// reply to a finding included (triage/plain-reply.ts).
|
|
39
41
|
export function triageReplyAuthors(
|
|
40
|
-
comments: readonly AnswerIssueComment
|
|
42
|
+
comments: readonly (AnswerIssueComment & {
|
|
43
|
+
in_reply_to_id?: number | null;
|
|
44
|
+
})[],
|
|
41
45
|
): string[] {
|
|
42
46
|
const authors = new Set<string>();
|
|
43
|
-
for (const comment of comments) {
|
|
47
|
+
for (const comment of withPlainAppliedReplies(comments)) {
|
|
44
48
|
if (isTriageReply(comment.body)) authors.add(comment.user);
|
|
45
49
|
}
|
|
46
50
|
return [...authors];
|
|
@@ -137,7 +141,7 @@ export function answeredBlockingFindings(input: {
|
|
|
137
141
|
verdictAt,
|
|
138
142
|
);
|
|
139
143
|
const reviewComments = trustedComments(
|
|
140
|
-
input.reviewComments,
|
|
144
|
+
withPlainAppliedReplies(input.reviewComments),
|
|
141
145
|
input.writers,
|
|
142
146
|
input.trustedActors,
|
|
143
147
|
input.reviewedHead,
|
package/src/pr/ci-publish.ts
CHANGED
|
@@ -33,7 +33,6 @@ export async function publishCiReviewIfEligible(input: {
|
|
|
33
33
|
prNumber: number;
|
|
34
34
|
headSha: string;
|
|
35
35
|
findings: readonly Finding[];
|
|
36
|
-
costUsdEst: number;
|
|
37
36
|
wallMs: number;
|
|
38
37
|
model: string;
|
|
39
38
|
webUrl: string | undefined;
|
|
@@ -50,7 +49,6 @@ export async function publishCiReviewIfEligible(input: {
|
|
|
50
49
|
prNumber: input.prNumber,
|
|
51
50
|
headSha: input.headSha,
|
|
52
51
|
findings: input.findings,
|
|
53
|
-
costUsdEst: input.costUsdEst,
|
|
54
52
|
wallMs: input.wallMs,
|
|
55
53
|
model: input.model,
|
|
56
54
|
...(input.webUrl === undefined ? {} : { repoWebUrl: input.webUrl }),
|
package/src/pr/discovery.ts
CHANGED
|
@@ -68,17 +68,14 @@ import type { IgnoreFileReadResult } from "../ignore-read";
|
|
|
68
68
|
// hunters run for a re-review is `skipDiscovery` — never a hardcoded
|
|
69
69
|
// `case === "B"` special-case, which would defeat the fix by silently
|
|
70
70
|
// skipping discovery for every case-B re-review regardless of whether this
|
|
71
|
-
// particular one actually has nothing to discover. `agents
|
|
72
|
-
//
|
|
73
|
-
//
|
|
71
|
+
// particular one actually has nothing to discover. `agents` flows through
|
|
72
|
+
// unchanged to `selectActiveHunters` (#review/run), shared with review()'s own
|
|
73
|
+
// copy.
|
|
74
74
|
export function discoveryHunters(params: {
|
|
75
75
|
skipDiscovery: boolean;
|
|
76
76
|
agents: readonly AgentSpec[];
|
|
77
|
-
parityFires: boolean;
|
|
78
77
|
}): AgentSpec[] {
|
|
79
|
-
return params.skipDiscovery
|
|
80
|
-
? []
|
|
81
|
-
: selectActiveHunters(params.agents, params.parityFires);
|
|
78
|
+
return params.skipDiscovery ? [] : selectActiveHunters(params.agents);
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
export interface PrDiscoveryGit {
|
|
@@ -138,11 +135,6 @@ export interface PrDiscoveryResult {
|
|
|
138
135
|
}
|
|
139
136
|
| undefined;
|
|
140
137
|
diffStat: DiffStat;
|
|
141
|
-
// The whole PR range's stat, filtered by the same rules as `diffStat`
|
|
142
|
-
// (merge-base..head, no path restriction). Equal to `diffStat` when discovery
|
|
143
|
-
// read the whole range; the plan divides the two to price a narrowed run
|
|
144
|
-
// (cryskai/platform#12).
|
|
145
|
-
prDiffStat: DiffStat;
|
|
146
138
|
sizeGate: SizeGateVerdict;
|
|
147
139
|
}
|
|
148
140
|
|
|
@@ -432,18 +424,6 @@ export async function resolvePrDiscovery(params: {
|
|
|
432
424
|
}));
|
|
433
425
|
}
|
|
434
426
|
|
|
435
|
-
const prDiffStat =
|
|
436
|
-
discoveryIsPrRange && !skipDiscovery
|
|
437
|
-
? diffStat
|
|
438
|
-
: (
|
|
439
|
-
await computeDiffStatAndSizeGate({
|
|
440
|
-
runGit: git.runGit,
|
|
441
|
-
range: `${diffFromSha}..${headSha}`,
|
|
442
|
-
pathArgs: [],
|
|
443
|
-
gateConfig,
|
|
444
|
-
})
|
|
445
|
-
).diffStat;
|
|
446
|
-
|
|
447
427
|
return {
|
|
448
428
|
prepared,
|
|
449
429
|
skipDiscovery,
|
|
@@ -457,7 +437,6 @@ export async function resolvePrDiscovery(params: {
|
|
|
457
437
|
adjudicationQueue: adjudicationSubjects,
|
|
458
438
|
phaseB,
|
|
459
439
|
diffStat,
|
|
460
|
-
prDiffStat,
|
|
461
440
|
sizeGate,
|
|
462
441
|
};
|
|
463
442
|
}
|