@proofline/sdk 1.0.3 → 2.0.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/dist/schema.d.ts CHANGED
@@ -144,6 +144,26 @@ export interface paths {
144
144
  patch?: never;
145
145
  trace?: never;
146
146
  };
147
+ "/api/v1/organizations/{org_id}/repositories/{repo_id}/coverage-reports": {
148
+ parameters: {
149
+ query?: never;
150
+ header?: never;
151
+ path?: never;
152
+ cookie?: never;
153
+ };
154
+ get?: never;
155
+ put?: never;
156
+ /**
157
+ * Upload coverage reports
158
+ * @description Records the LCOV, Cobertura, JaCoCo or Go coverage reports a CI run produced for one exact commit GitHub has in the repository, for COVERAGE checks that accept uploads. A branch, tag or abbreviated SHA, or a report that cannot be read, gets 422 and stores nothing. Requires a repository-restricted token and live GitHub write access; the same reports for the same commit return the report already recorded.
159
+ */
160
+ post: operations["upload_coverage_reports"];
161
+ delete?: never;
162
+ options?: never;
163
+ head?: never;
164
+ patch?: never;
165
+ trace?: never;
166
+ };
147
167
  "/api/v1/organizations/{org_id}/repositories/{repo_id}/file-reviews": {
148
168
  parameters: {
149
169
  query?: never;
@@ -753,6 +773,15 @@ export interface components {
753
773
  */
754
774
  route?: components["schemas"]["SummaryRoute"] | null;
755
775
  };
776
+ /** @description One file World cited for a check's result. */
777
+ CheckFile: {
778
+ /** @description The repository-relative path. It is repository text. */
779
+ path: components["schemas"]["UntrustedText"];
780
+ /** @description The revision World read the file at. */
781
+ revision: components["schemas"]["CheckFileRevision"];
782
+ };
783
+ /** @description The revision a cited file was read at. */
784
+ CheckFileRevision: "PROPOSED_CODE_REVISION" | "BASE_CODE_REVISION";
756
785
  /**
757
786
  * @description World's lifecycle disclosure for the evaluator version that answered, as
758
787
  * the receipt recorded it. A deployment gate counts only `GATING` results
@@ -760,6 +789,46 @@ export interface components {
760
789
  * evaluates a deployment; the lifecycle alone permits or blocks nothing.
761
790
  */
762
791
  CheckLifecycle: "GATING" | "SHADOW" | "QUARANTINED" | "RETIRED" | "UNKNOWN";
792
+ /**
793
+ * @description What the control plane records as a failure's cause.
794
+ * @enum {string}
795
+ */
796
+ CiFailureAttribution: "CAUSED_BY_CHANGE" | "PRE_EXISTING_ON_BASE" | "FLAKY_OR_INFRASTRUCTURE" | "ENVIRONMENT_STATE" | "UNKNOWN";
797
+ /** @description One failed CI job as the Check states it. */
798
+ CiFailureLine: {
799
+ /**
800
+ * @description The recorded cause: `CAUSED_BY_CHANGE`, `PRE_EXISTING_ON_BASE`,
801
+ * `FLAKY_OR_INFRASTRUCTURE`, `ENVIRONMENT_STATE` or `UNKNOWN`. `UNKNOWN`
802
+ * means the failure was not diagnosed, and `undiagnosed` says why.
803
+ */
804
+ attribution: components["schemas"]["CiFailureAttribution"];
805
+ /**
806
+ * @description The first failed step's name, admitted the same way. Null when no
807
+ * step concluded as failed.
808
+ */
809
+ failed_step?: string | null;
810
+ /**
811
+ * @description The job's name as the diagnosis admitted it: masked, or `<withheld>`.
812
+ * A protected value of the observing review reads as the withheld
813
+ * marker.
814
+ */
815
+ job_name: string;
816
+ /**
817
+ * Format: int64
818
+ * @description The GitHub Actions run attempt the job failed in, from 1. The line
819
+ * is the newest diagnosed attempt of its run.
820
+ */
821
+ run_attempt: number;
822
+ /** @description Whether the job timed out rather than failed. */
823
+ timed_out: boolean;
824
+ /**
825
+ * @description Why the failure was not diagnosed. Set exactly when `attribution` is
826
+ * `UNKNOWN`.
827
+ */
828
+ undiagnosed?: components["schemas"]["CiFailureUndiagnosed"] | null;
829
+ };
830
+ /** @description Why a failed job's attribution is `UNKNOWN`. */
831
+ CiFailureUndiagnosed: "LOG_UNAVAILABLE" | "LOG_TOO_LARGE" | "LOG_NOT_ADMITTED" | "DECISION_UNAVAILABLE" | "SHADOW" | "UNDETERMINED";
763
832
  /**
764
833
  * @description A code assessment's recorded execution status. It is never a verdict on
765
834
  * the change: only `COMPLETED` says the assessment covered what it read.
@@ -838,6 +907,60 @@ export interface components {
838
907
  /** @description The evaluation World recorded, which holds every condition. */
839
908
  world_evaluation_id: string;
840
909
  };
910
+ /**
911
+ * @description An upload refused for its content: a symbolic or unknown commit, or a
912
+ * report that cannot be read. Nothing is stored.
913
+ */
914
+ CoverageRefused: {
915
+ /** @description One sentence naming what was refused and why. */
916
+ detail: string;
917
+ /**
918
+ * Format: uint16
919
+ * @description Always 422.
920
+ */
921
+ status: number;
922
+ /** @description Always `unprocessable coverage upload`. */
923
+ title: string;
924
+ };
925
+ /** @description The coverage reports a CI run produced for one commit. */
926
+ CoverageUploadRequest: {
927
+ /**
928
+ * @description One to 50 reports, each LCOV, Cobertura XML, `JaCoCo` XML or a Go
929
+ * cover profile, in a JSON body of at most 64 MiB.
930
+ */
931
+ reports: components["schemas"]["UploadedReport"][];
932
+ /**
933
+ * @description The full 40-character commit the tests ran on. GitHub must have it in
934
+ * this repository. A merge commit counts for a pull request head that is
935
+ * one of its two parents.
936
+ */
937
+ tested_sha: string;
938
+ };
939
+ /** @description The report the upload recorded, or the one an identical upload recorded. */
940
+ CoverageUploadResponse: {
941
+ /**
942
+ * Format: uint64
943
+ * @description Covered lines among those instrumented lines.
944
+ */
945
+ covered_lines: number;
946
+ /** @description False when the same reports for this commit were already recorded. */
947
+ created: boolean;
948
+ /** @description The format of each report, in upload order. */
949
+ formats: string[];
950
+ /**
951
+ * Format: uint64
952
+ * @description Instrumented lines across the reports, a file two reports name under
953
+ * one path counted once.
954
+ */
955
+ instrumented_lines: number;
956
+ /**
957
+ * Format: uuid
958
+ * @description The recorded report.
959
+ */
960
+ report_id: string;
961
+ /** @description The commit the reports tested, as the upload named it. */
962
+ tested_sha: string;
963
+ };
841
964
  CustomerAssessment: {
842
965
  /** @description The deterministic World checks recorded for this assessment. */
843
966
  checks: components["schemas"]["CustomerChecks"];
@@ -992,6 +1115,12 @@ export interface components {
992
1115
  * this instant, which can precede the assessment.
993
1116
  */
994
1117
  evaluated_at?: string | null;
1118
+ /**
1119
+ * @description The files World cited as evidence for this result, once each in
1120
+ * World's order, with the revision World read each at. Empty when World
1121
+ * cited no file, and on results recorded before World cited files.
1122
+ */
1123
+ files: components["schemas"]["CheckFile"][];
995
1124
  /**
996
1125
  * @description The lifecycle of the evaluator version that answered. It says whether
997
1126
  * a deployment gate could count this result, not whether one did.
@@ -1041,6 +1170,11 @@ export interface components {
1041
1170
  * @description When the code assessment ended. Null while it has not.
1042
1171
  */
1043
1172
  completed_at?: string | null;
1173
+ /**
1174
+ * @description Recorded check coverage counts and fixed cancellation causes, without source text.
1175
+ * Absent coverage does not establish that every check ran.
1176
+ */
1177
+ coverage_details?: string[];
1044
1178
  /**
1045
1179
  * @description The code-only findings the code assessment recorded, `SERIOUS` first.
1046
1180
  * An empty list does not establish deployment safety.
@@ -1224,6 +1358,11 @@ export interface components {
1224
1358
  * or `REINTRODUCED`.
1225
1359
  */
1226
1360
  lifecycle_state: string;
1361
+ /**
1362
+ * @description Earlier occurrences in the author's local reviews linked by exact patch
1363
+ * identity. These links carry no verdict or finding decision.
1364
+ */
1365
+ local_findings?: components["schemas"]["MatchedLocalFinding"][];
1227
1366
  /**
1228
1367
  * @description Where this review's comment gate placed the finding, as it recorded
1229
1368
  * the placement. Null when the review recorded none.
@@ -1659,6 +1798,31 @@ export interface components {
1659
1798
  /** @description `CONSIDERED` or `SKIPPED`. */
1660
1799
  status: string;
1661
1800
  };
1801
+ /** @description A published occurrence of an unresolved series absent from the current run. */
1802
+ EarlierOpenFinding: {
1803
+ /**
1804
+ * Format: uuid
1805
+ * @description The occurrence in the series' first published review.
1806
+ */
1807
+ finding_id: string;
1808
+ /**
1809
+ * Format: uuid
1810
+ * @description The unresolved environment finding series counted for this run.
1811
+ */
1812
+ finding_series_id: string;
1813
+ /**
1814
+ * Format: uuid
1815
+ * @description The first published review containing this occurrence.
1816
+ */
1817
+ review_id: string;
1818
+ /**
1819
+ * Format: int64
1820
+ * @description The earlier pull-request run that contains this occurrence.
1821
+ */
1822
+ run_number: number;
1823
+ /** @description Severity used by the series count; the linked occurrence may be less severe. */
1824
+ severity: string;
1825
+ };
1662
1826
  /** @enum {string} */
1663
1827
  EvidenceView: "REQUIRED_PROPERTIES_ESTABLISHED" | "INCOMPLETE" | "NO_APPLICABLE_OBLIGATIONS";
1664
1828
  /** @enum {string} */
@@ -2186,6 +2350,24 @@ export interface components {
2186
2350
  * @enum {string}
2187
2351
  */
2188
2352
  LocalReverificationOutcome: "RESOLVED_VERIFIED" | "STILL_PRESENT" | "NOT_VERIFIED" | "PENDING";
2353
+ /** @description A local occurrence with the same semantic fingerprint as this finding. */
2354
+ MatchedLocalFinding: {
2355
+ /**
2356
+ * Format: date-time
2357
+ * @description When the local review was requested.
2358
+ */
2359
+ created_at: string;
2360
+ /**
2361
+ * Format: uuid
2362
+ * @description The occurrence in that local review.
2363
+ */
2364
+ finding_id: string;
2365
+ /**
2366
+ * Format: uuid
2367
+ * @description The author's local review, linked by exact patch identity.
2368
+ */
2369
+ review_id: string;
2370
+ };
2189
2371
  NotAssessedView: {
2190
2372
  /**
2191
2373
  * @description The display name of the environment whose assessment is not
@@ -2297,6 +2479,8 @@ export interface components {
2297
2479
  * @description Finding series whose current decision is an unexpired `ACCEPTED_RISK`.
2298
2480
  */
2299
2481
  accepted_risks: number;
2482
+ /** @description Exact published occurrences of earlier unresolved environment findings. */
2483
+ earlier_findings?: components["schemas"]["EarlierOpenFinding"][];
2300
2484
  /** @description Recorded assessment gaps, including explicit policy exclusions. */
2301
2485
  not_assessed: components["schemas"]["NotAssessedView"][];
2302
2486
  /**
@@ -2757,6 +2941,29 @@ export interface components {
2757
2941
  * @description Finding series whose current decision is an unexpired `ACCEPTED_RISK`.
2758
2942
  */
2759
2943
  accepted_risk_count: number;
2944
+ /**
2945
+ * @description Failed CI jobs diagnosed on the reviewed head, the newest diagnosed
2946
+ * attempt of each run, in diagnosis order. The Check states each one;
2947
+ * none is a Proofline open item. Absent when no job was diagnosed.
2948
+ */
2949
+ ci_failures?: components["schemas"]["CiFailureLine"][];
2950
+ /**
2951
+ * Format: uint64
2952
+ * @description Diagnosed failed CI jobs on the reviewed head beyond `ci_failures`.
2953
+ */
2954
+ ci_failures_omitted?: number;
2955
+ /**
2956
+ * Format: uint64
2957
+ * @description Failed CI run attempts on the reviewed head whose diagnosis is queued
2958
+ * or running, so none of their jobs has a line yet.
2959
+ */
2960
+ ci_runs_pending?: number;
2961
+ /**
2962
+ * Format: uint64
2963
+ * @description Failed CI run attempts on the reviewed head whose diagnosis failed or
2964
+ * was cancelled, so none of their jobs has a line.
2965
+ */
2966
+ ci_runs_unfinished?: number;
2760
2967
  /**
2761
2968
  * Format: date-time
2762
2969
  * @description GitHub's update time for the recorded pull request state that
@@ -2768,6 +2975,11 @@ export interface components {
2768
2975
  * GitHub. Null when no pull request state is recorded.
2769
2976
  */
2770
2977
  current_head_sha?: string | null;
2978
+ /**
2979
+ * @description Exact published occurrences of earlier unresolved environment findings.
2980
+ * Absent from observations recorded before destinations were captured.
2981
+ */
2982
+ earlier_findings?: components["schemas"]["EarlierOpenFinding"][];
2771
2983
  /**
2772
2984
  * @description This review's environment assessments that are not `COMPLETED`, ordered
2773
2985
  * by environment key.
@@ -3105,6 +3317,13 @@ export interface components {
3105
3317
  placement: string;
3106
3318
  /** @description Human override beside the original decision, when one was requested. */
3107
3319
  promotion?: components["schemas"]["FindingPromotionView"] | null;
3320
+ /**
3321
+ * Format: uuid
3322
+ * @description The finding that represents this finding's publication group, when an
3323
+ * applied group publishes it in one comment with other findings. Every
3324
+ * member names the same finding, the representative included.
3325
+ */
3326
+ publication_group?: string | null;
3108
3327
  /** @description Recognized safe reason codes; unknown values are represented as `UNRECOGNIZED`. */
3109
3328
  reason_codes: string[];
3110
3329
  /** @description Rule that produced the recorded placement. */
@@ -3503,6 +3722,15 @@ export interface components {
3503
3722
  /** @description The text itself. Render it as plain text only. */
3504
3723
  untrusted_text: string;
3505
3724
  };
3725
+ UploadedReport: {
3726
+ /** @description The report text, exactly as the coverage tool wrote it. */
3727
+ content: string;
3728
+ /**
3729
+ * @description A relative name for the report, such as `web/lcov.info`, unique in
3730
+ * the upload.
3731
+ */
3732
+ name: string;
3733
+ };
3506
3734
  WalkthroughFileView: {
3507
3735
  /**
3508
3736
  * Format: int64
@@ -3834,6 +4062,64 @@ export interface operations {
3834
4062
  };
3835
4063
  };
3836
4064
  };
4065
+ upload_coverage_reports: {
4066
+ parameters: {
4067
+ query?: never;
4068
+ header?: never;
4069
+ path: {
4070
+ org_id: string;
4071
+ repo_id: string;
4072
+ };
4073
+ cookie?: never;
4074
+ };
4075
+ /** @description The coverage reports a CI run produced for one commit. */
4076
+ requestBody: {
4077
+ content: {
4078
+ "application/json": components["schemas"]["CoverageUploadRequest"];
4079
+ };
4080
+ };
4081
+ responses: {
4082
+ /** @description The report the upload recorded, or the one an identical upload recorded. */
4083
+ 200: {
4084
+ headers: {
4085
+ [name: string]: unknown;
4086
+ };
4087
+ content: {
4088
+ "application/json": components["schemas"]["CoverageUploadResponse"];
4089
+ };
4090
+ };
4091
+ /** @description The report the upload recorded, or the one an identical upload recorded. */
4092
+ 201: {
4093
+ headers: {
4094
+ [name: string]: unknown;
4095
+ };
4096
+ content: {
4097
+ "application/json": components["schemas"]["CoverageUploadResponse"];
4098
+ };
4099
+ };
4100
+ /**
4101
+ * @description An upload refused for its content: a symbolic or unknown commit, or a
4102
+ * report that cannot be read. Nothing is stored.
4103
+ */
4104
+ 422: {
4105
+ headers: {
4106
+ [name: string]: unknown;
4107
+ };
4108
+ content: {
4109
+ "application/json": components["schemas"]["CoverageRefused"];
4110
+ };
4111
+ };
4112
+ /** @description An RFC 9457 problem; the HTTP status remains authoritative. */
4113
+ default: {
4114
+ headers: {
4115
+ [name: string]: unknown;
4116
+ };
4117
+ content: {
4118
+ "application/problem+json": components["schemas"]["Problem"];
4119
+ };
4120
+ };
4121
+ };
4122
+ };
3837
4123
  request_file_review: {
3838
4124
  parameters: {
3839
4125
  query?: never;
package/dist/transport.js CHANGED
@@ -1,4 +1,4 @@
1
- const VERSION = "1.0.3";
1
+ const VERSION = "2.0.0";
2
2
  const MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
3
3
  const MAX_RETRIES = 3;
4
4
  const MAX_RETRY_SECONDS = 60;