fallow 3.18.0 → 3.19.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 +1 -1
- package/capabilities.json +139 -4
- package/package.json +11 -10
- package/schema.json +39 -0
- package/scripts/lazy-verify.js +4 -5
- package/scripts/lazy-verify.test.js +9 -5
- package/scripts/verify-binary.js +10 -9
- package/scripts/verify-binary.test.js +6 -6
- package/skills/fallow/SKILL.md +12 -8
- package/skills/fallow/references/cli-reference.md +69 -1
- package/skills/fallow/references/gotchas.md +1 -1
- package/skills/fallow/references/mcp.md +23 -4
- package/skills/fallow/references/node-bindings.md +3 -2
- package/skills/fallow/references/similar-code.md +47 -0
- package/types/output-contract.d.ts +647 -26
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Schemas for the JSON output of fallow commands. Object-shaped envelopes covered by the `FallowOutput` contract carry a top-level `kind` discriminator. Current kind values: `audit`, `explain`, `inspect_target`, `trace`, `review-envelope`, `review-reconcile`, `coverage-setup`, `coverage-analyze`, `list-boundaries`, `list-workspaces`, `health`, `dupes`, `dead-code-grouped`, `impact`, `impact-cross-repo`, `security`, `security-survivors`, `security-blind-spots`, `dead-code`, `combined`, `feature-flags`, `audit-brief`, `decision-surface`, `review-walkthrough-guide`, `review-walkthrough-validation`, `suppression-inventory`, `type-aware-status`. Consumers should branch on `kind` instead of probing for unique field presence. `CodeClimateOutput` is a bare JSON array (per the Code Climate / GitLab Code Quality spec) and stays a sibling root branch discriminated by checking whether the document root is an array. `ErrorOutput` is the `--format json` failure document, emitted on stdout with a non-zero exit; it carries no `kind` and is discriminated by the `error: true` field.
|
|
27
|
+
* Schemas for the JSON output of fallow commands. Object-shaped envelopes covered by the `FallowOutput` contract carry a top-level `kind` discriminator. Current kind values: `audit`, `explain`, `inspect_target`, `trace`, `review-envelope`, `review-reconcile`, `coverage-setup`, `coverage-analyze`, `list-boundaries`, `list-workspaces`, `health`, `dupes`, `dead-code-grouped`, `impact`, `impact-cross-repo`, `security`, `security-survivors`, `security-blind-spots`, `dead-code`, `combined`, `feature-flags`, `audit-brief`, `decision-surface`, `review-walkthrough-guide`, `review-walkthrough-validation`, `suppression-inventory`, `type-aware-status`, `similar-code`, `similar-code-inspect`, `similar-code-review`. Consumers should branch on `kind` instead of probing for unique field presence. `CodeClimateOutput` is a bare JSON array (per the Code Climate / GitLab Code Quality spec) and stays a sibling root branch discriminated by checking whether the document root is an array. `ErrorOutput` is the `--format json` failure document, emitted on stdout with a non-zero exit; it carries no `kind` and is discriminated by the `error: true` field.
|
|
28
28
|
*/
|
|
29
29
|
export type FallowJsonOutput = (FallowOutput | CodeClimateOutput | ErrorOutput)
|
|
30
30
|
/**
|
|
@@ -98,6 +98,12 @@ kind: "review-walkthrough-validation"
|
|
|
98
98
|
kind: "suppression-inventory"
|
|
99
99
|
}) | (TypeAwareStatusOutput & {
|
|
100
100
|
kind: "type-aware-status"
|
|
101
|
+
}) | (SimilarCodeOutput & {
|
|
102
|
+
kind: "similar-code"
|
|
103
|
+
}) | (SimilarCodeInspectOutput & {
|
|
104
|
+
kind: "similar-code-inspect"
|
|
105
|
+
}) | (SimilarCodeReviewOutput & {
|
|
106
|
+
kind: "similar-code-review"
|
|
101
107
|
}))
|
|
102
108
|
/**
|
|
103
109
|
* Schema projection for the audit envelope's exact version.
|
|
@@ -703,10 +709,11 @@ export type UnusedAtRuleKind = ("property-registration" | "layer")
|
|
|
703
709
|
/**
|
|
704
710
|
* The surface through which a design token is consumed. The `theme-var` /
|
|
705
711
|
* `css-var` / `utility` / `apply` kinds are Tailwind v4 `@theme` consumption; the
|
|
706
|
-
* `js-member` / `js-call` kinds are CSS-in-JS consumption (member access
|
|
707
|
-
* imported StyleX/vanilla-extract token binding,
|
|
708
|
-
* call). The kind is the disjoint origin signal that
|
|
709
|
-
* token entry from a CSS-in-JS token entry in the
|
|
712
|
+
* `js-member` / `js-call` kinds are CSS-in-JS consumption (member access through a
|
|
713
|
+
* same-file or imported StyleX/vanilla-extract token binding, a StyleX
|
|
714
|
+
* theme-group call, or a PandaCSS token-path call). The kind is the disjoint origin signal that
|
|
715
|
+
* distinguishes a Tailwind token entry from a CSS-in-JS token entry in the
|
|
716
|
+
* shared `token_consumers` list.
|
|
710
717
|
*/
|
|
711
718
|
export type ConsumerKind = ("theme-var" | "css-var" | "utility" | "apply" | "js-member" | "js-call")
|
|
712
719
|
/**
|
|
@@ -1043,6 +1050,74 @@ export type SuppressionInventoryOrigin = "comment"
|
|
|
1043
1050
|
* Schema projection for the type-aware status envelope's exact version.
|
|
1044
1051
|
*/
|
|
1045
1052
|
export type TypeAwareStatusSchemaVersion = 8
|
|
1053
|
+
/**
|
|
1054
|
+
* Version singleton for raw similar-code output.
|
|
1055
|
+
*/
|
|
1056
|
+
export type SimilarCodeSchemaVersion = "1"
|
|
1057
|
+
/**
|
|
1058
|
+
* Provider families admitted by the version 1 public contract.
|
|
1059
|
+
*/
|
|
1060
|
+
export type SimilarCodeProvider = "official-local-companion"
|
|
1061
|
+
/**
|
|
1062
|
+
* Stable, coarse interpretation of a candidate score.
|
|
1063
|
+
*/
|
|
1064
|
+
export type SimilarCodeSimilarityBand = ("moderate" | "high" | "very-high")
|
|
1065
|
+
/**
|
|
1066
|
+
* Verification state of a raw semantic candidate.
|
|
1067
|
+
*/
|
|
1068
|
+
export type SimilarCodeVerificationStatus = "unverified"
|
|
1069
|
+
/**
|
|
1070
|
+
* Explicit availability state for one optional enrichment source.
|
|
1071
|
+
*/
|
|
1072
|
+
export type SimilarCodeEnrichmentState = ("available" | "unavailable" | "not-requested")
|
|
1073
|
+
/**
|
|
1074
|
+
* Read-only actions supported by the candidate workflow.
|
|
1075
|
+
*/
|
|
1076
|
+
export type SimilarCodeActionType = ("inspect" | "review")
|
|
1077
|
+
/**
|
|
1078
|
+
* Overall trustworthiness of an emitted result set.
|
|
1079
|
+
*/
|
|
1080
|
+
export type SimilarCodeCompletionStatus = ("complete" | "partial")
|
|
1081
|
+
/**
|
|
1082
|
+
* Bounded phase names in the similar-code pipeline.
|
|
1083
|
+
*/
|
|
1084
|
+
export type SimilarCodePhase = ("discovery" | "extraction" | "cache" | "embedding" | "validation" | "comparison" | "enrichment")
|
|
1085
|
+
/**
|
|
1086
|
+
* Completion state for one generation phase.
|
|
1087
|
+
*/
|
|
1088
|
+
export type SimilarCodePhaseStatus = ("complete" | "partial" | "skipped" | "timed-out")
|
|
1089
|
+
/**
|
|
1090
|
+
* Stable reasons why admitted work was skipped or truncated.
|
|
1091
|
+
*/
|
|
1092
|
+
export type SimilarCodeSkipReason = ("below-minimum-lines" | "unsupported-function" | "generated-source" | "function-too-large" | "input-limit" | "source-bytes-limit" | "vector-memory-limit" | "comparison-limit" | "candidate-limit" | "neighbor-limit" | "timeout" | "provider-failure" | "token-truncation" | "enrichment-unavailable")
|
|
1093
|
+
/**
|
|
1094
|
+
* Vector cache outcome for a run.
|
|
1095
|
+
*/
|
|
1096
|
+
export type SimilarCodeCacheStatus = ("disabled" | "hit" | "miss" | "mixed")
|
|
1097
|
+
/**
|
|
1098
|
+
* Non-severity diagnostic domain for similar-code generation.
|
|
1099
|
+
*/
|
|
1100
|
+
export type SimilarCodeDiagnosticDomain = ("workspace" | "extraction" | "provider" | "cache" | "enrichment" | "review")
|
|
1101
|
+
/**
|
|
1102
|
+
* Version singleton for a similar-code inspect packet.
|
|
1103
|
+
*/
|
|
1104
|
+
export type SimilarCodeInspectSchemaVersion = "1"
|
|
1105
|
+
/**
|
|
1106
|
+
* Conservative syntactic side-effect hint for an inspected function.
|
|
1107
|
+
*/
|
|
1108
|
+
export type SimilarCodeSideEffectHint = ("pure-looking" | "may-have-side-effects" | "unknown")
|
|
1109
|
+
/**
|
|
1110
|
+
* Version singleton for reviewed similar-code output.
|
|
1111
|
+
*/
|
|
1112
|
+
export type SimilarCodeReviewSchemaVersion = "1"
|
|
1113
|
+
/**
|
|
1114
|
+
* Domain outcome assigned by review, never by candidate generation.
|
|
1115
|
+
*/
|
|
1116
|
+
export type SimilarCodeDomainOutcome = ("same-responsibility" | "related-but-distinct" | "intentional-duplication" | "unrelated" | "needs-human-review")
|
|
1117
|
+
/**
|
|
1118
|
+
* How review matched an external verdict to the current candidate.
|
|
1119
|
+
*/
|
|
1120
|
+
export type SimilarCodeVerdictMatch = ("candidate-id" | "review-key" | "unverified" | "ambiguous-review-key")
|
|
1046
1121
|
/**
|
|
1047
1122
|
* Discriminator value for [`CodeClimateIssue::kind`].
|
|
1048
1123
|
*/
|
|
@@ -7759,15 +7834,17 @@ near_duplicate_theme_tokens?: NearDuplicateThemeToken[]
|
|
|
7759
7834
|
*/
|
|
7760
7835
|
near_duplicate_css_in_js_tokens?: NearDuplicateThemeToken[]
|
|
7761
7836
|
/**
|
|
7762
|
-
* A location-aware reverse index of Tailwind v4
|
|
7763
|
-
*
|
|
7764
|
-
*
|
|
7765
|
-
*
|
|
7766
|
-
*
|
|
7767
|
-
*
|
|
7768
|
-
*
|
|
7769
|
-
*
|
|
7770
|
-
*
|
|
7837
|
+
* A location-aware reverse index of design-token consumers. Tailwind v4
|
|
7838
|
+
* entries cover `@theme` tokens consumed through `var()` reads, `@apply`
|
|
7839
|
+
* bodies, or generated utilities. CSS-in-JS entries cover supported StyleX,
|
|
7840
|
+
* vanilla-extract, PandaCSS, styled-components, and Emotion definitions and
|
|
7841
|
+
* their member or call consumers. Every entry includes the defining site,
|
|
7842
|
+
* located consumer samples, and the full `consumer_count` as a static lower
|
|
7843
|
+
* bound. Tailwind entries use the same gated candidate set as
|
|
7844
|
+
* `unused_theme_tokens`; CSS-in-JS entries require supported direct imports.
|
|
7845
|
+
* Partial-scope runs omit the index. Sorted by token and empty when no
|
|
7846
|
+
* eligible token definitions are found. A zero count is evidence for
|
|
7847
|
+
* investigation, not deletion proof.
|
|
7771
7848
|
*/
|
|
7772
7849
|
token_consumers?: TokenConsumers[]
|
|
7773
7850
|
/**
|
|
@@ -8602,13 +8679,14 @@ actions: CssCandidateAction[]
|
|
|
8602
8679
|
* `apply`), built from the same gated candidate set as `unused_theme_tokens`
|
|
8603
8680
|
* (v4 + non-plugin + non-published + whole-scope), so a `consumer_count: 0`
|
|
8604
8681
|
* corroborates the `unused_theme_tokens` "nothing consumes this" finding.
|
|
8605
|
-
* - CSS-in-JS tokens (kind `js-member` / `js-call`) from StyleX `defineVars
|
|
8606
|
-
* vanilla-extract `createTheme` family definitions,
|
|
8607
|
-
* consumed via cross-module member
|
|
8682
|
+
* - CSS-in-JS tokens (kind `js-member` / `js-call`) from StyleX `defineVars` /
|
|
8683
|
+
* `unstable_defineVarsNested`, vanilla-extract `createTheme` family definitions,
|
|
8684
|
+
* and PandaCSS `defineTokens`, consumed via same-file or cross-module member
|
|
8685
|
+
* access, StyleX theme-group calls, or PandaCSS `token('...')` calls. NOTE:
|
|
8608
8686
|
* CSS-in-JS has NO corroborating dead-token finding (there is no
|
|
8609
8687
|
* `unused_theme_tokens` analogue), so a CSS-in-JS `consumer_count: 0` is a weaker
|
|
8610
|
-
* signal than the Tailwind case (and
|
|
8611
|
-
*
|
|
8688
|
+
* signal than the Tailwind case (and unresolved dynamic imports or computed
|
|
8689
|
+
* accesses are not counted).
|
|
8612
8690
|
*
|
|
8613
8691
|
* This is DESCRIPTIVE context (a blast-radius lookup), not a finding, so it
|
|
8614
8692
|
* deliberately carries no `actions` array (unlike the cleanup-candidate types in
|
|
@@ -8620,14 +8698,14 @@ export interface TokenConsumers {
|
|
|
8620
8698
|
/**
|
|
8621
8699
|
* The token identity. For a Tailwind `@theme` token this is the full custom
|
|
8622
8700
|
* property as authored, INCLUDING the `--` prefix (`--color-brand`). For a
|
|
8623
|
-
* CSS-in-JS token (kind `js-member`) this is the binding-qualified dotted
|
|
8701
|
+
* CSS-in-JS token (kind `js-member` / `js-call`) this is the binding-qualified dotted
|
|
8624
8702
|
* access path, NO `--` prefix (`vars.color.primary`), matching how consumers
|
|
8625
8703
|
* read it. The presence of the `--` prefix distinguishes the two origins.
|
|
8626
8704
|
*/
|
|
8627
8705
|
token: string
|
|
8628
8706
|
/**
|
|
8629
8707
|
* For a Tailwind token, the v4 theme namespace (`color`, `radius`,
|
|
8630
|
-
* `font-weight`, ...). For a CSS-in-JS token (kind `js-member`), the defining
|
|
8708
|
+
* `font-weight`, ...). For a CSS-in-JS token (kind `js-member` / `js-call`), the defining
|
|
8631
8709
|
* export BINDING the token set is accessed through (`vars`), which identifies
|
|
8632
8710
|
* the token set, NOT a semantic group. (The field is thus overloaded by
|
|
8633
8711
|
* origin; branch on `consumers[].kind` or the `token` shape.)
|
|
@@ -8646,9 +8724,10 @@ definition_path: string
|
|
|
8646
8724
|
definition_line: number
|
|
8647
8725
|
/**
|
|
8648
8726
|
* The FULL number of consumer locations found, a STATIC LOWER BOUND: a
|
|
8649
|
-
* computed class name (`bg-${color}`)
|
|
8650
|
-
*
|
|
8651
|
-
*
|
|
8727
|
+
* computed class name (`bg-${color}`), unresolved import, dynamic token
|
|
8728
|
+
* structure, or computed CSS-in-JS access is not counted. This is the
|
|
8729
|
+
* aggregate over every consumer, computed BEFORE
|
|
8730
|
+
* [`consumers`](Self::consumers) is capped to a sample.
|
|
8652
8731
|
*/
|
|
8653
8732
|
consumer_count: number
|
|
8654
8733
|
/**
|
|
@@ -8660,8 +8739,8 @@ consumer_count: number
|
|
|
8660
8739
|
consumers: TokenConsumerLocation[]
|
|
8661
8740
|
}
|
|
8662
8741
|
/**
|
|
8663
|
-
* Where one Tailwind
|
|
8664
|
-
* One entry in a [`TokenConsumers::consumers`] sample.
|
|
8742
|
+
* Where one Tailwind or CSS-in-JS design token is consumed, and through which
|
|
8743
|
+
* surface. One entry in a [`TokenConsumers::consumers`] sample.
|
|
8665
8744
|
*/
|
|
8666
8745
|
export interface TokenConsumerLocation {
|
|
8667
8746
|
/**
|
|
@@ -13183,6 +13262,548 @@ backend_version?: (string | null)
|
|
|
13183
13262
|
*/
|
|
13184
13263
|
remediation?: (string | null)
|
|
13185
13264
|
}
|
|
13265
|
+
/**
|
|
13266
|
+
* Raw `fallow similar-code --format json` output.
|
|
13267
|
+
*/
|
|
13268
|
+
export interface SimilarCodeOutput {
|
|
13269
|
+
schema_version: SimilarCodeSchemaVersion
|
|
13270
|
+
version: ToolVersion
|
|
13271
|
+
elapsed_ms: ElapsedMs
|
|
13272
|
+
generation: SimilarCodeGeneration
|
|
13273
|
+
/**
|
|
13274
|
+
* Deterministically ordered unverified candidates.
|
|
13275
|
+
*/
|
|
13276
|
+
candidates: SimilarCodeCandidate[]
|
|
13277
|
+
completion: SimilarCodeCompletion
|
|
13278
|
+
/**
|
|
13279
|
+
* Non-severity diagnostics in deterministic order.
|
|
13280
|
+
*/
|
|
13281
|
+
diagnostics: SimilarCodeDiagnostic[]
|
|
13282
|
+
}
|
|
13283
|
+
/**
|
|
13284
|
+
* Complete provenance needed to reproduce candidate generation.
|
|
13285
|
+
*/
|
|
13286
|
+
export interface SimilarCodeGeneration {
|
|
13287
|
+
/**
|
|
13288
|
+
* Version of extraction and normalization semantics used for both IDs.
|
|
13289
|
+
*/
|
|
13290
|
+
extraction_semantics_version: number
|
|
13291
|
+
/**
|
|
13292
|
+
* Version of the calculation that produces model embeddings.
|
|
13293
|
+
*/
|
|
13294
|
+
embedding_semantics_version: number
|
|
13295
|
+
provider: SimilarCodeProviderProvenance
|
|
13296
|
+
model: SimilarCodeModelProvenance
|
|
13297
|
+
parameters: SimilarCodeGenerationParameters
|
|
13298
|
+
scope: SimilarCodeScopeProvenance
|
|
13299
|
+
/**
|
|
13300
|
+
* Minimum cosine similarity admitted into the candidate set.
|
|
13301
|
+
*/
|
|
13302
|
+
threshold: number
|
|
13303
|
+
/**
|
|
13304
|
+
* Minimum source line count admitted into function extraction.
|
|
13305
|
+
*/
|
|
13306
|
+
min_lines: number
|
|
13307
|
+
}
|
|
13308
|
+
/**
|
|
13309
|
+
* Immutable local provider provenance for one generation run.
|
|
13310
|
+
*/
|
|
13311
|
+
export interface SimilarCodeProviderProvenance {
|
|
13312
|
+
provider: SimilarCodeProvider
|
|
13313
|
+
/**
|
|
13314
|
+
* Exact companion package version.
|
|
13315
|
+
*/
|
|
13316
|
+
companion_version: string
|
|
13317
|
+
/**
|
|
13318
|
+
* Companion protocol version negotiated for this run.
|
|
13319
|
+
*/
|
|
13320
|
+
protocol_version: number
|
|
13321
|
+
/**
|
|
13322
|
+
* Whether source content left the local machine. Version 1 requires false.
|
|
13323
|
+
*/
|
|
13324
|
+
source_left_machine: boolean
|
|
13325
|
+
}
|
|
13326
|
+
/**
|
|
13327
|
+
* Immutable model artifact provenance.
|
|
13328
|
+
*/
|
|
13329
|
+
export interface SimilarCodeModelProvenance {
|
|
13330
|
+
/**
|
|
13331
|
+
* Stable model identifier.
|
|
13332
|
+
*/
|
|
13333
|
+
model_id: string
|
|
13334
|
+
/**
|
|
13335
|
+
* Immutable model revision.
|
|
13336
|
+
*/
|
|
13337
|
+
revision: string
|
|
13338
|
+
/**
|
|
13339
|
+
* SHA-256 digest of the exact model artifact bytes.
|
|
13340
|
+
*/
|
|
13341
|
+
artifact_sha256: string
|
|
13342
|
+
/**
|
|
13343
|
+
* SPDX license identifier or reviewed license label.
|
|
13344
|
+
*/
|
|
13345
|
+
license: string
|
|
13346
|
+
/**
|
|
13347
|
+
* Embedding vector dimensions.
|
|
13348
|
+
*/
|
|
13349
|
+
dimensions: number
|
|
13350
|
+
}
|
|
13351
|
+
/**
|
|
13352
|
+
* Parameters that materially affect generated embeddings and scores.
|
|
13353
|
+
*/
|
|
13354
|
+
export interface SimilarCodeGenerationParameters {
|
|
13355
|
+
/**
|
|
13356
|
+
* Numeric representation used for model inference.
|
|
13357
|
+
*/
|
|
13358
|
+
dtype: string
|
|
13359
|
+
/**
|
|
13360
|
+
* Pooling strategy applied to model output.
|
|
13361
|
+
*/
|
|
13362
|
+
pooling: string
|
|
13363
|
+
/**
|
|
13364
|
+
* Whether vectors were normalized before comparison.
|
|
13365
|
+
*/
|
|
13366
|
+
normalized: boolean
|
|
13367
|
+
/**
|
|
13368
|
+
* Maximum inference batch size used by the run.
|
|
13369
|
+
*/
|
|
13370
|
+
batch_size: number
|
|
13371
|
+
/**
|
|
13372
|
+
* Maximum tokenizer length before deterministic truncation.
|
|
13373
|
+
*/
|
|
13374
|
+
max_tokens: number
|
|
13375
|
+
/**
|
|
13376
|
+
* Digest over the complete effective generation parameter set.
|
|
13377
|
+
*/
|
|
13378
|
+
parameter_sha256: string
|
|
13379
|
+
}
|
|
13380
|
+
/**
|
|
13381
|
+
* Effective endpoint scope used for corpus admission and pair retention.
|
|
13382
|
+
*/
|
|
13383
|
+
export interface SimilarCodeScopeProvenance {
|
|
13384
|
+
/**
|
|
13385
|
+
* Whether file, changed-file, diff, or workspace scoping was active.
|
|
13386
|
+
*/
|
|
13387
|
+
active: boolean
|
|
13388
|
+
/**
|
|
13389
|
+
* Sorted project-root-relative paths satisfying every active predicate.
|
|
13390
|
+
*/
|
|
13391
|
+
paths: string[]
|
|
13392
|
+
}
|
|
13393
|
+
/**
|
|
13394
|
+
* One unverified semantic similar-code candidate.
|
|
13395
|
+
*/
|
|
13396
|
+
export interface SimilarCodeCandidate {
|
|
13397
|
+
/**
|
|
13398
|
+
* Snapshot-stable opaque candidate identity.
|
|
13399
|
+
*/
|
|
13400
|
+
candidate_id: string
|
|
13401
|
+
/**
|
|
13402
|
+
* Content-stable key used for safe line-movement rebinding.
|
|
13403
|
+
*/
|
|
13404
|
+
review_key: string
|
|
13405
|
+
left: SimilarCodeLocation
|
|
13406
|
+
right: SimilarCodeLocation
|
|
13407
|
+
/**
|
|
13408
|
+
* Cosine similarity reported by the pinned provider and model.
|
|
13409
|
+
*/
|
|
13410
|
+
similarity: number
|
|
13411
|
+
similarity_band: SimilarCodeSimilarityBand
|
|
13412
|
+
verification_status: SimilarCodeVerificationStatus
|
|
13413
|
+
enrichment: SimilarCodeEnrichmentAvailability
|
|
13414
|
+
/**
|
|
13415
|
+
* Read-only inspect and review affordances.
|
|
13416
|
+
*/
|
|
13417
|
+
actions: SimilarCodeAction[]
|
|
13418
|
+
}
|
|
13419
|
+
/**
|
|
13420
|
+
* Exact named location of one candidate function.
|
|
13421
|
+
*/
|
|
13422
|
+
export interface SimilarCodeLocation {
|
|
13423
|
+
/**
|
|
13424
|
+
* Project-root-relative, forward-slash path.
|
|
13425
|
+
*/
|
|
13426
|
+
path: string
|
|
13427
|
+
/**
|
|
13428
|
+
* Extracted function or method name.
|
|
13429
|
+
*/
|
|
13430
|
+
name: string
|
|
13431
|
+
/**
|
|
13432
|
+
* One-based inclusive start line.
|
|
13433
|
+
*/
|
|
13434
|
+
start_line: number
|
|
13435
|
+
/**
|
|
13436
|
+
* One-based inclusive start column.
|
|
13437
|
+
*/
|
|
13438
|
+
start_column: number
|
|
13439
|
+
/**
|
|
13440
|
+
* One-based inclusive end line.
|
|
13441
|
+
*/
|
|
13442
|
+
end_line: number
|
|
13443
|
+
/**
|
|
13444
|
+
* One-based inclusive end column.
|
|
13445
|
+
*/
|
|
13446
|
+
end_column: number
|
|
13447
|
+
/**
|
|
13448
|
+
* SHA-256 digest of the exact extracted function source.
|
|
13449
|
+
*/
|
|
13450
|
+
source_sha256: string
|
|
13451
|
+
}
|
|
13452
|
+
/**
|
|
13453
|
+
* Availability of every supported source-grounded enrichment.
|
|
13454
|
+
*/
|
|
13455
|
+
export interface SimilarCodeEnrichmentAvailability {
|
|
13456
|
+
graph_relationship: SimilarCodeEnrichmentState
|
|
13457
|
+
entry_point_reachability: SimilarCodeEnrichmentState
|
|
13458
|
+
callers: SimilarCodeEnrichmentState
|
|
13459
|
+
callees: SimilarCodeEnrichmentState
|
|
13460
|
+
ownership: SimilarCodeEnrichmentState
|
|
13461
|
+
churn: SimilarCodeEnrichmentState
|
|
13462
|
+
tests: SimilarCodeEnrichmentState
|
|
13463
|
+
deterministic_clone_coverage: SimilarCodeEnrichmentState
|
|
13464
|
+
runtime: SimilarCodeEnrichmentState
|
|
13465
|
+
}
|
|
13466
|
+
/**
|
|
13467
|
+
* Read-only follow-up exposed for a candidate.
|
|
13468
|
+
*/
|
|
13469
|
+
export interface SimilarCodeAction {
|
|
13470
|
+
action: SimilarCodeActionType
|
|
13471
|
+
/**
|
|
13472
|
+
* Human-readable description of the read-only operation.
|
|
13473
|
+
*/
|
|
13474
|
+
description: string
|
|
13475
|
+
/**
|
|
13476
|
+
* Explicit mutation guarantee. Version 1 requires this to be true.
|
|
13477
|
+
*/
|
|
13478
|
+
read_only: boolean
|
|
13479
|
+
}
|
|
13480
|
+
/**
|
|
13481
|
+
* Typed completion, limit, skip, and cache accounting.
|
|
13482
|
+
*/
|
|
13483
|
+
export interface SimilarCodeCompletion {
|
|
13484
|
+
status: SimilarCodeCompletionStatus
|
|
13485
|
+
/**
|
|
13486
|
+
* Per-phase completion in pipeline order.
|
|
13487
|
+
*/
|
|
13488
|
+
phases: SimilarCodePhaseCompletion[]
|
|
13489
|
+
limits: SimilarCodeLimits
|
|
13490
|
+
/**
|
|
13491
|
+
* Aggregated skips in phase and reason order.
|
|
13492
|
+
*/
|
|
13493
|
+
skips: SimilarCodeSkip[]
|
|
13494
|
+
cache: SimilarCodeCacheSummary
|
|
13495
|
+
/**
|
|
13496
|
+
* Aggregate model inference wall time reported by the local provider.
|
|
13497
|
+
*/
|
|
13498
|
+
provider_inference_ms: number
|
|
13499
|
+
}
|
|
13500
|
+
/**
|
|
13501
|
+
* Accounting for one bounded generation phase.
|
|
13502
|
+
*/
|
|
13503
|
+
export interface SimilarCodePhaseCompletion {
|
|
13504
|
+
phase: SimilarCodePhase
|
|
13505
|
+
status: SimilarCodePhaseStatus
|
|
13506
|
+
/**
|
|
13507
|
+
* Number of admitted inputs processed by this phase.
|
|
13508
|
+
*/
|
|
13509
|
+
processed: number
|
|
13510
|
+
/**
|
|
13511
|
+
* Total admitted inputs known to this phase, when available.
|
|
13512
|
+
*/
|
|
13513
|
+
total?: (number | null)
|
|
13514
|
+
/**
|
|
13515
|
+
* Stable explanation when the phase did not complete.
|
|
13516
|
+
*/
|
|
13517
|
+
reason?: (string | null)
|
|
13518
|
+
}
|
|
13519
|
+
/**
|
|
13520
|
+
* Effective resource limits for a similar-code run.
|
|
13521
|
+
*/
|
|
13522
|
+
export interface SimilarCodeLimits {
|
|
13523
|
+
/**
|
|
13524
|
+
* Maximum source files admitted.
|
|
13525
|
+
*/
|
|
13526
|
+
max_files: number
|
|
13527
|
+
/**
|
|
13528
|
+
* Maximum extracted functions admitted.
|
|
13529
|
+
*/
|
|
13530
|
+
max_functions: number
|
|
13531
|
+
/**
|
|
13532
|
+
* Maximum aggregate normalized source bytes admitted.
|
|
13533
|
+
*/
|
|
13534
|
+
max_source_bytes: number
|
|
13535
|
+
/**
|
|
13536
|
+
* Maximum normalized bytes admitted for one function.
|
|
13537
|
+
*/
|
|
13538
|
+
max_function_bytes: number
|
|
13539
|
+
/**
|
|
13540
|
+
* Maximum embedding batch size.
|
|
13541
|
+
*/
|
|
13542
|
+
max_batch_size: number
|
|
13543
|
+
/**
|
|
13544
|
+
* Maximum vector bytes retained for comparison.
|
|
13545
|
+
*/
|
|
13546
|
+
max_vector_bytes: number
|
|
13547
|
+
/**
|
|
13548
|
+
* Maximum pair comparisons performed.
|
|
13549
|
+
*/
|
|
13550
|
+
max_comparisons: number
|
|
13551
|
+
/**
|
|
13552
|
+
* Maximum candidates returned.
|
|
13553
|
+
*/
|
|
13554
|
+
max_candidates: number
|
|
13555
|
+
/**
|
|
13556
|
+
* Maximum returned neighbors per function.
|
|
13557
|
+
*/
|
|
13558
|
+
max_neighbors_per_function: number
|
|
13559
|
+
/**
|
|
13560
|
+
* End-to-end timeout in milliseconds.
|
|
13561
|
+
*/
|
|
13562
|
+
timeout_ms: number
|
|
13563
|
+
}
|
|
13564
|
+
/**
|
|
13565
|
+
* Count of skipped work for a stable reason.
|
|
13566
|
+
*/
|
|
13567
|
+
export interface SimilarCodeSkip {
|
|
13568
|
+
phase: SimilarCodePhase
|
|
13569
|
+
reason: SimilarCodeSkipReason
|
|
13570
|
+
/**
|
|
13571
|
+
* Number of inputs skipped for this phase and reason.
|
|
13572
|
+
*/
|
|
13573
|
+
count: number
|
|
13574
|
+
}
|
|
13575
|
+
/**
|
|
13576
|
+
* Privacy-safe cache accounting. Source fragments are never represented.
|
|
13577
|
+
*/
|
|
13578
|
+
export interface SimilarCodeCacheSummary {
|
|
13579
|
+
status: SimilarCodeCacheStatus
|
|
13580
|
+
/**
|
|
13581
|
+
* Valid vector cache hits.
|
|
13582
|
+
*/
|
|
13583
|
+
hits: number
|
|
13584
|
+
/**
|
|
13585
|
+
* Vector cache misses.
|
|
13586
|
+
*/
|
|
13587
|
+
misses: number
|
|
13588
|
+
/**
|
|
13589
|
+
* Newly written vector cache entries.
|
|
13590
|
+
*/
|
|
13591
|
+
writes: number
|
|
13592
|
+
/**
|
|
13593
|
+
* Corrupt or incompatible entries ignored safely.
|
|
13594
|
+
*/
|
|
13595
|
+
invalid_entries: number
|
|
13596
|
+
}
|
|
13597
|
+
/**
|
|
13598
|
+
* Actionable diagnostic without a severity or gate implication.
|
|
13599
|
+
*/
|
|
13600
|
+
export interface SimilarCodeDiagnostic {
|
|
13601
|
+
domain: SimilarCodeDiagnosticDomain
|
|
13602
|
+
/**
|
|
13603
|
+
* Stable machine-readable code.
|
|
13604
|
+
*/
|
|
13605
|
+
code: string
|
|
13606
|
+
/**
|
|
13607
|
+
* Bounded human-readable explanation.
|
|
13608
|
+
*/
|
|
13609
|
+
message: string
|
|
13610
|
+
/**
|
|
13611
|
+
* Optional project-root-relative path.
|
|
13612
|
+
*/
|
|
13613
|
+
path?: (string | null)
|
|
13614
|
+
}
|
|
13615
|
+
/**
|
|
13616
|
+
* `fallow similar-code inspect --format json` output.
|
|
13617
|
+
*/
|
|
13618
|
+
export interface SimilarCodeInspectOutput {
|
|
13619
|
+
schema_version: SimilarCodeInspectSchemaVersion
|
|
13620
|
+
version: ToolVersion
|
|
13621
|
+
elapsed_ms: ElapsedMs
|
|
13622
|
+
generation: SimilarCodeGeneration
|
|
13623
|
+
candidate: SimilarCodeCandidate
|
|
13624
|
+
packet: SimilarCodeInspectPacket
|
|
13625
|
+
completion: SimilarCodeCompletion
|
|
13626
|
+
/**
|
|
13627
|
+
* Non-severity diagnostics in deterministic order.
|
|
13628
|
+
*/
|
|
13629
|
+
diagnostics: SimilarCodeDiagnostic[]
|
|
13630
|
+
}
|
|
13631
|
+
/**
|
|
13632
|
+
* Bounded source-grounded packet for one immutable candidate.
|
|
13633
|
+
*/
|
|
13634
|
+
export interface SimilarCodeInspectPacket {
|
|
13635
|
+
/**
|
|
13636
|
+
* Candidate identity this packet describes.
|
|
13637
|
+
*/
|
|
13638
|
+
candidate_id: string
|
|
13639
|
+
/**
|
|
13640
|
+
* Content-stable review key this packet describes.
|
|
13641
|
+
*/
|
|
13642
|
+
review_key: string
|
|
13643
|
+
availability: SimilarCodeEnrichmentAvailability
|
|
13644
|
+
/**
|
|
13645
|
+
* Graph relationship label, when relationship evidence is available.
|
|
13646
|
+
*/
|
|
13647
|
+
graph_relationship?: (string | null)
|
|
13648
|
+
left: SimilarCodeSideEvidence
|
|
13649
|
+
right: SimilarCodeSideEvidence
|
|
13650
|
+
}
|
|
13651
|
+
/**
|
|
13652
|
+
* Bounded evidence for one side of an inspect packet.
|
|
13653
|
+
*/
|
|
13654
|
+
export interface SimilarCodeSideEvidence {
|
|
13655
|
+
/**
|
|
13656
|
+
* Bounded source window included only in inspect output, never raw output or cache.
|
|
13657
|
+
*/
|
|
13658
|
+
source_window?: (string | null)
|
|
13659
|
+
/**
|
|
13660
|
+
* Declared parameter count when extraction supplied it.
|
|
13661
|
+
*/
|
|
13662
|
+
parameter_count?: (number | null)
|
|
13663
|
+
/**
|
|
13664
|
+
* Whether the inspected function is declared async.
|
|
13665
|
+
*/
|
|
13666
|
+
is_async?: (boolean | null)
|
|
13667
|
+
/**
|
|
13668
|
+
* Whether the inspected function is a generator.
|
|
13669
|
+
*/
|
|
13670
|
+
is_generator?: (boolean | null)
|
|
13671
|
+
/**
|
|
13672
|
+
* Whether the inspected function contains an await expression.
|
|
13673
|
+
*/
|
|
13674
|
+
has_await?: (boolean | null)
|
|
13675
|
+
/**
|
|
13676
|
+
* Whether the inspected function contains a throw expression.
|
|
13677
|
+
*/
|
|
13678
|
+
has_throw?: (boolean | null)
|
|
13679
|
+
/**
|
|
13680
|
+
* Conservative syntactic side-effect classification.
|
|
13681
|
+
*/
|
|
13682
|
+
side_effect_hint?: (SimilarCodeSideEffectHint | null)
|
|
13683
|
+
/**
|
|
13684
|
+
* Whether the function is reachable from a configured entry point.
|
|
13685
|
+
*/
|
|
13686
|
+
entry_point_reachable?: (boolean | null)
|
|
13687
|
+
/**
|
|
13688
|
+
* Bounded, deterministically ordered direct callers.
|
|
13689
|
+
*/
|
|
13690
|
+
callers: SimilarCodeNamedReference[]
|
|
13691
|
+
/**
|
|
13692
|
+
* Bounded, deterministically ordered direct callees.
|
|
13693
|
+
*/
|
|
13694
|
+
callees: SimilarCodeNamedReference[]
|
|
13695
|
+
/**
|
|
13696
|
+
* Bounded, deterministically ordered ownership labels.
|
|
13697
|
+
*/
|
|
13698
|
+
owners: string[]
|
|
13699
|
+
/**
|
|
13700
|
+
* Recent commit count in the configured churn window.
|
|
13701
|
+
*/
|
|
13702
|
+
churn_commits?: (number | null)
|
|
13703
|
+
/**
|
|
13704
|
+
* Bounded, root-relative related test paths.
|
|
13705
|
+
*/
|
|
13706
|
+
tests: string[]
|
|
13707
|
+
/**
|
|
13708
|
+
* Fraction covered by deterministic clone groups, from zero through one.
|
|
13709
|
+
*/
|
|
13710
|
+
deterministic_clone_coverage?: (number | null)
|
|
13711
|
+
/**
|
|
13712
|
+
* Runtime observation count when compatible runtime evidence is present.
|
|
13713
|
+
*/
|
|
13714
|
+
runtime_observations?: (number | null)
|
|
13715
|
+
}
|
|
13716
|
+
/**
|
|
13717
|
+
* One named graph reference used in an inspect packet.
|
|
13718
|
+
*/
|
|
13719
|
+
export interface SimilarCodeNamedReference {
|
|
13720
|
+
/**
|
|
13721
|
+
* Project-root-relative, forward-slash path.
|
|
13722
|
+
*/
|
|
13723
|
+
path: string
|
|
13724
|
+
/**
|
|
13725
|
+
* Referenced symbol name.
|
|
13726
|
+
*/
|
|
13727
|
+
name: string
|
|
13728
|
+
/**
|
|
13729
|
+
* One-based source line.
|
|
13730
|
+
*/
|
|
13731
|
+
line: number
|
|
13732
|
+
}
|
|
13733
|
+
/**
|
|
13734
|
+
* `fallow similar-code review --format json` output.
|
|
13735
|
+
*/
|
|
13736
|
+
export interface SimilarCodeReviewOutput {
|
|
13737
|
+
schema_version: SimilarCodeReviewSchemaVersion
|
|
13738
|
+
version: ToolVersion
|
|
13739
|
+
elapsed_ms: ElapsedMs
|
|
13740
|
+
generation: SimilarCodeGeneration
|
|
13741
|
+
review: SimilarCodeReviewProvenance
|
|
13742
|
+
/**
|
|
13743
|
+
* Raw candidates joined with verdicts in candidate order.
|
|
13744
|
+
*/
|
|
13745
|
+
candidates: SimilarCodeReviewedCandidate[]
|
|
13746
|
+
completion: SimilarCodeCompletion
|
|
13747
|
+
/**
|
|
13748
|
+
* Non-severity diagnostics in deterministic order.
|
|
13749
|
+
*/
|
|
13750
|
+
diagnostics: SimilarCodeDiagnostic[]
|
|
13751
|
+
}
|
|
13752
|
+
/**
|
|
13753
|
+
* Digests that make the review join reproducible without exposing source.
|
|
13754
|
+
*/
|
|
13755
|
+
export interface SimilarCodeReviewProvenance {
|
|
13756
|
+
/**
|
|
13757
|
+
* SHA-256 digest of the exact candidate JSON input bytes.
|
|
13758
|
+
*/
|
|
13759
|
+
candidates_sha256: string
|
|
13760
|
+
/**
|
|
13761
|
+
* SHA-256 digest of the exact verdict JSON input bytes.
|
|
13762
|
+
*/
|
|
13763
|
+
verdicts_sha256: string
|
|
13764
|
+
}
|
|
13765
|
+
/**
|
|
13766
|
+
* One candidate joined with its separate verdict, if safely matched.
|
|
13767
|
+
*/
|
|
13768
|
+
export interface SimilarCodeReviewedCandidate {
|
|
13769
|
+
candidate: SimilarCodeCandidate
|
|
13770
|
+
/**
|
|
13771
|
+
* Safely matched external verdict, absent when still unverified.
|
|
13772
|
+
*/
|
|
13773
|
+
verdict?: (SimilarCodeVerdict | null)
|
|
13774
|
+
verdict_match: SimilarCodeVerdictMatch
|
|
13775
|
+
outcome: SimilarCodeDomainOutcome
|
|
13776
|
+
}
|
|
13777
|
+
/**
|
|
13778
|
+
* Separate verdict input for one immutable candidate.
|
|
13779
|
+
*/
|
|
13780
|
+
export interface SimilarCodeVerdict {
|
|
13781
|
+
/**
|
|
13782
|
+
* Snapshot identity from the raw candidate.
|
|
13783
|
+
*/
|
|
13784
|
+
candidate_id: string
|
|
13785
|
+
/**
|
|
13786
|
+
* Content-stable identity from the raw candidate.
|
|
13787
|
+
*/
|
|
13788
|
+
review_key: string
|
|
13789
|
+
/**
|
|
13790
|
+
* Whether the pair is useful enough to review. Null means undecided.
|
|
13791
|
+
*/
|
|
13792
|
+
candidate_worthy?: (boolean | null)
|
|
13793
|
+
/**
|
|
13794
|
+
* Whether the two functions behave equivalently. Null means undecided.
|
|
13795
|
+
*/
|
|
13796
|
+
behaviorally_equivalent?: (boolean | null)
|
|
13797
|
+
/**
|
|
13798
|
+
* Whether consolidation is safe. Null means undecided.
|
|
13799
|
+
*/
|
|
13800
|
+
refactor_safe?: (boolean | null)
|
|
13801
|
+
outcome: SimilarCodeDomainOutcome
|
|
13802
|
+
/**
|
|
13803
|
+
* Bounded explanation grounded in the inspected sources.
|
|
13804
|
+
*/
|
|
13805
|
+
rationale: string
|
|
13806
|
+
}
|
|
13186
13807
|
/**
|
|
13187
13808
|
* Single CodeClimate-compatible issue inside [`CodeClimateOutput`].
|
|
13188
13809
|
*/
|