@allocator-one/harness-cli 1.16.0 → 1.17.1

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/spec/openapi.json CHANGED
@@ -18411,6 +18411,3417 @@
18411
18411
  "summary": "Retry a terminal review execution",
18412
18412
  "tags": []
18413
18413
  }
18414
+ },
18415
+ "/api/v1/code/blobs/batch": {
18416
+ "post": {
18417
+ "callbacks": {},
18418
+ "deprecated": false,
18419
+ "description": "Requires the `harness:write` scope. Several blobs in one body of at most the policy's `max_batch_bytes`, framed as `<sha256>\\n<length>\\n<bytes>` records back to back (optionally gzip-compressed). Each blob is stored, found already stored, or rejected with the reason a single upload would give.",
18420
+ "parameters": [],
18421
+ "requestBody": {
18422
+ "content": {
18423
+ "application/octet-stream": {
18424
+ "schema": {
18425
+ "description": "`<sha256>\\n<length>\\n<bytes>` records",
18426
+ "format": "binary",
18427
+ "type": "string"
18428
+ }
18429
+ }
18430
+ },
18431
+ "required": true
18432
+ },
18433
+ "responses": {
18434
+ "200": {
18435
+ "content": {
18436
+ "application/json": {
18437
+ "schema": {
18438
+ "properties": {
18439
+ "data": {
18440
+ "properties": {
18441
+ "existing": {
18442
+ "items": {
18443
+ "pattern": "^[0-9a-f]{64}$",
18444
+ "type": "string"
18445
+ },
18446
+ "type": "array"
18447
+ },
18448
+ "rejected": {
18449
+ "items": {
18450
+ "properties": {
18451
+ "error": {
18452
+ "type": "string"
18453
+ },
18454
+ "sha256": {
18455
+ "pattern": "^[0-9a-f]{64}$",
18456
+ "type": "string"
18457
+ }
18458
+ },
18459
+ "type": "object"
18460
+ },
18461
+ "type": "array"
18462
+ },
18463
+ "stored": {
18464
+ "items": {
18465
+ "pattern": "^[0-9a-f]{64}$",
18466
+ "type": "string"
18467
+ },
18468
+ "type": "array"
18469
+ }
18470
+ },
18471
+ "type": "object"
18472
+ },
18473
+ "meta": {
18474
+ "properties": {
18475
+ "contract": {
18476
+ "enum": [
18477
+ "1.2"
18478
+ ],
18479
+ "type": "string"
18480
+ }
18481
+ },
18482
+ "type": "object"
18483
+ }
18484
+ },
18485
+ "type": "object"
18486
+ }
18487
+ }
18488
+ },
18489
+ "description": "Success"
18490
+ },
18491
+ "400": {
18492
+ "content": {
18493
+ "application/json": {
18494
+ "schema": {
18495
+ "properties": {
18496
+ "details": {
18497
+ "additionalProperties": true,
18498
+ "type": "object"
18499
+ },
18500
+ "error": {
18501
+ "type": "string"
18502
+ },
18503
+ "message": {
18504
+ "type": "string"
18505
+ },
18506
+ "request_id": {
18507
+ "nullable": true,
18508
+ "type": "string"
18509
+ }
18510
+ },
18511
+ "type": "object"
18512
+ }
18513
+ }
18514
+ },
18515
+ "description": "The framing is invalid (`malformed_batch`)"
18516
+ },
18517
+ "401": {
18518
+ "description": "Missing or invalid token"
18519
+ },
18520
+ "403": {
18521
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
18522
+ },
18523
+ "404": {
18524
+ "description": "Not found"
18525
+ },
18526
+ "413": {
18527
+ "content": {
18528
+ "application/json": {
18529
+ "schema": {
18530
+ "properties": {
18531
+ "details": {
18532
+ "additionalProperties": true,
18533
+ "type": "object"
18534
+ },
18535
+ "error": {
18536
+ "type": "string"
18537
+ },
18538
+ "message": {
18539
+ "type": "string"
18540
+ },
18541
+ "request_id": {
18542
+ "nullable": true,
18543
+ "type": "string"
18544
+ }
18545
+ },
18546
+ "type": "object"
18547
+ }
18548
+ }
18549
+ },
18550
+ "description": "The body exceeds the size limit (`payload_too_large`), or carries more than 5,000 records, repeated contents included (`too_many_records`)"
18551
+ },
18552
+ "422": {
18553
+ "content": {
18554
+ "application/json": {
18555
+ "schema": {
18556
+ "properties": {
18557
+ "details": {
18558
+ "additionalProperties": true,
18559
+ "type": "object"
18560
+ },
18561
+ "error": {
18562
+ "type": "string"
18563
+ },
18564
+ "message": {
18565
+ "type": "string"
18566
+ },
18567
+ "request_id": {
18568
+ "nullable": true,
18569
+ "type": "string"
18570
+ }
18571
+ },
18572
+ "type": "object"
18573
+ }
18574
+ }
18575
+ },
18576
+ "description": "`quota_exceeded`: the organization is at a code index limit, named in `details.quota` and `details.limit`"
18577
+ }
18578
+ },
18579
+ "summary": "Upload a batch of blobs",
18580
+ "tags": []
18581
+ }
18582
+ },
18583
+ "/api/v1/code/blobs/{sha256}": {
18584
+ "put": {
18585
+ "callbacks": {},
18586
+ "deprecated": false,
18587
+ "description": "Requires the `harness:write` scope. One file's content, at most the policy's `max_file_bytes`, as raw bytes (optionally gzip-compressed with `Content-Encoding: gzip`). Blobs are deduplicated within the organization only. Only content an open sync of the organization names is accepted, so open the sync first. Content the policy refuses is never stored, and every entry naming it is skipped, so no base or sync waits for it. Re-sending a stored blob while an open sync still names it answers 204.",
18588
+ "parameters": [
18589
+ {
18590
+ "description": "The content's lowercase hex SHA-256",
18591
+ "in": "path",
18592
+ "name": "sha256",
18593
+ "required": true,
18594
+ "schema": {
18595
+ "pattern": "^[0-9a-f]{64}$",
18596
+ "type": "string"
18597
+ }
18598
+ }
18599
+ ],
18600
+ "requestBody": {
18601
+ "content": {
18602
+ "application/octet-stream": {
18603
+ "schema": {
18604
+ "description": "The file's bytes",
18605
+ "format": "binary",
18606
+ "type": "string"
18607
+ }
18608
+ }
18609
+ },
18610
+ "required": true
18611
+ },
18612
+ "responses": {
18613
+ "200": {
18614
+ "description": "Success"
18615
+ },
18616
+ "201": {
18617
+ "description": "Stored"
18618
+ },
18619
+ "204": {
18620
+ "description": "Already stored"
18621
+ },
18622
+ "400": {
18623
+ "description": "Bad request"
18624
+ },
18625
+ "401": {
18626
+ "description": "Missing or invalid token"
18627
+ },
18628
+ "403": {
18629
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
18630
+ },
18631
+ "404": {
18632
+ "description": "Not found"
18633
+ },
18634
+ "409": {
18635
+ "content": {
18636
+ "application/json": {
18637
+ "schema": {
18638
+ "properties": {
18639
+ "details": {
18640
+ "additionalProperties": true,
18641
+ "type": "object"
18642
+ },
18643
+ "error": {
18644
+ "type": "string"
18645
+ },
18646
+ "message": {
18647
+ "type": "string"
18648
+ },
18649
+ "request_id": {
18650
+ "nullable": true,
18651
+ "type": "string"
18652
+ }
18653
+ },
18654
+ "type": "object"
18655
+ }
18656
+ }
18657
+ },
18658
+ "description": "`unexpected_blob`: no open sync of the organization names this content"
18659
+ },
18660
+ "413": {
18661
+ "content": {
18662
+ "application/json": {
18663
+ "schema": {
18664
+ "properties": {
18665
+ "details": {
18666
+ "additionalProperties": true,
18667
+ "type": "object"
18668
+ },
18669
+ "error": {
18670
+ "type": "string"
18671
+ },
18672
+ "message": {
18673
+ "type": "string"
18674
+ },
18675
+ "request_id": {
18676
+ "nullable": true,
18677
+ "type": "string"
18678
+ }
18679
+ },
18680
+ "type": "object"
18681
+ }
18682
+ }
18683
+ },
18684
+ "description": "Larger than `max_file_bytes` (`payload_too_large`)"
18685
+ },
18686
+ "422": {
18687
+ "content": {
18688
+ "application/json": {
18689
+ "schema": {
18690
+ "properties": {
18691
+ "details": {
18692
+ "additionalProperties": true,
18693
+ "type": "object"
18694
+ },
18695
+ "error": {
18696
+ "type": "string"
18697
+ },
18698
+ "message": {
18699
+ "type": "string"
18700
+ },
18701
+ "request_id": {
18702
+ "nullable": true,
18703
+ "type": "string"
18704
+ }
18705
+ },
18706
+ "type": "object"
18707
+ }
18708
+ }
18709
+ },
18710
+ "description": "`invalid_sha256`, `hash_mismatch`, a policy refusal (`binary`, `secret_content`), or `quota_exceeded`: the organization is at a code index limit, named in `details.quota` and `details.limit`"
18711
+ }
18712
+ },
18713
+ "summary": "Upload a blob",
18714
+ "tags": []
18715
+ }
18716
+ },
18717
+ "/api/v1/code/policy": {
18718
+ "get": {
18719
+ "callbacks": {},
18720
+ "deprecated": false,
18721
+ "description": "Requires the `harness:read` scope. What the CLI may upload and how it must scan: the per-file byte limit, the denied path globs and content patterns, the indexed extensions and languages, the binary rule and the batch byte limit, with the organization it applies to. The policy's digest is on every base status; a write scanned under another one is refused with 409 `stale_policy`. A base also leaves out what the commit's root `.harnesscodeignore` names: one glob per line, trimmed, with lines starting `#` or `!` skipped (no negation); `*`, `**` and `?` are the only wildcards, matched case-sensitively; a leading `/` anchors, a trailing `/` is dropped and a match covers descendants; globs over 256 bytes or with more than 8 `*` are dropped, and only the first 64 KiB and 1,000 globs count.",
18722
+ "parameters": [],
18723
+ "responses": {
18724
+ "200": {
18725
+ "content": {
18726
+ "application/json": {
18727
+ "schema": {
18728
+ "properties": {
18729
+ "data": {
18730
+ "properties": {
18731
+ "binary_detection": {
18732
+ "type": "boolean"
18733
+ },
18734
+ "binary_rule": {
18735
+ "type": "string"
18736
+ },
18737
+ "content_patterns": {
18738
+ "description": "Each one a regex from harness-cli's reviewed list, verbatim, or a literal marker; a client refuses any other before it scans, so a new regex ships in a harness-cli release first",
18739
+ "items": {
18740
+ "type": "string"
18741
+ },
18742
+ "type": "array"
18743
+ },
18744
+ "deny_glob_case": {
18745
+ "description": "How `deny_globs` match: folding ASCII letters only. Absent means case-sensitive; a client refuses a mode it does not know",
18746
+ "enum": [
18747
+ "ascii_insensitive"
18748
+ ],
18749
+ "type": "string"
18750
+ },
18751
+ "deny_globs": {
18752
+ "description": "Globs whose only wildcards are `**/`, `/**`, `*` and `?`; everything else is literal. One without a slash matches the basename at any depth; one with a slash, the whole path",
18753
+ "items": {
18754
+ "type": "string"
18755
+ },
18756
+ "type": "array"
18757
+ },
18758
+ "include_extensions": {
18759
+ "items": {
18760
+ "type": "string"
18761
+ },
18762
+ "type": "array"
18763
+ },
18764
+ "languages": {
18765
+ "items": {
18766
+ "type": "string"
18767
+ },
18768
+ "type": "array"
18769
+ },
18770
+ "max_batch_bytes": {
18771
+ "type": "integer"
18772
+ },
18773
+ "max_file_bytes": {
18774
+ "type": "integer"
18775
+ },
18776
+ "org_id": {
18777
+ "format": "uuid",
18778
+ "type": "string"
18779
+ },
18780
+ "org_name": {
18781
+ "type": "string"
18782
+ },
18783
+ "policy_digest": {
18784
+ "description": "The digest every scanned write names; see `stale_policy`",
18785
+ "type": "string"
18786
+ }
18787
+ },
18788
+ "type": "object"
18789
+ },
18790
+ "meta": {
18791
+ "properties": {
18792
+ "contract": {
18793
+ "enum": [
18794
+ "1.2"
18795
+ ],
18796
+ "type": "string"
18797
+ }
18798
+ },
18799
+ "type": "object"
18800
+ }
18801
+ },
18802
+ "type": "object"
18803
+ }
18804
+ }
18805
+ },
18806
+ "description": "Success"
18807
+ },
18808
+ "400": {
18809
+ "description": "Bad request"
18810
+ },
18811
+ "401": {
18812
+ "description": "Missing or invalid token"
18813
+ },
18814
+ "403": {
18815
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
18816
+ },
18817
+ "404": {
18818
+ "description": "Not found"
18819
+ },
18820
+ "422": {
18821
+ "description": "Validation error"
18822
+ }
18823
+ },
18824
+ "summary": "Get the code upload policy",
18825
+ "tags": []
18826
+ }
18827
+ },
18828
+ "/api/v1/code/repositories": {
18829
+ "put": {
18830
+ "callbacks": {},
18831
+ "deprecated": false,
18832
+ "description": "Requires the `harness:write` scope. Connecting a repository the organization has not connected yet also needs Harness administrator standing (403 `forbidden`); resolving one already connected does not. Returns the organization's repository named by its normalized remote (`github.com/<owner>/<name>`), connecting it first when needed. Only a repository the organization's GitHub connection shares is connected: any other is refused with 422 `repository_not_connected`, whose message names the connection to share it through. A newly connected repository's default branch is indexed by the server.",
18833
+ "parameters": [],
18834
+ "requestBody": {
18835
+ "content": {
18836
+ "application/json": {
18837
+ "schema": {
18838
+ "additionalProperties": false,
18839
+ "properties": {
18840
+ "default_branch": {
18841
+ "type": "string"
18842
+ },
18843
+ "repo_key": {
18844
+ "description": "The normalized remote, e.g. `github.com/acme/app`",
18845
+ "type": "string"
18846
+ }
18847
+ },
18848
+ "required": [
18849
+ "repo_key"
18850
+ ],
18851
+ "type": "object"
18852
+ }
18853
+ }
18854
+ },
18855
+ "required": true
18856
+ },
18857
+ "responses": {
18858
+ "200": {
18859
+ "content": {
18860
+ "application/json": {
18861
+ "schema": {
18862
+ "properties": {
18863
+ "data": {
18864
+ "properties": {
18865
+ "repo_key": {
18866
+ "type": "string"
18867
+ },
18868
+ "repository_id": {
18869
+ "format": "uuid",
18870
+ "type": "string"
18871
+ }
18872
+ },
18873
+ "type": "object"
18874
+ },
18875
+ "meta": {
18876
+ "properties": {
18877
+ "contract": {
18878
+ "enum": [
18879
+ "1.2"
18880
+ ],
18881
+ "type": "string"
18882
+ }
18883
+ },
18884
+ "type": "object"
18885
+ }
18886
+ },
18887
+ "type": "object"
18888
+ }
18889
+ }
18890
+ },
18891
+ "description": "Success"
18892
+ },
18893
+ "400": {
18894
+ "description": "Bad request"
18895
+ },
18896
+ "401": {
18897
+ "description": "Missing or invalid token"
18898
+ },
18899
+ "403": {
18900
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
18901
+ },
18902
+ "404": {
18903
+ "description": "Not found"
18904
+ },
18905
+ "422": {
18906
+ "content": {
18907
+ "application/json": {
18908
+ "schema": {
18909
+ "properties": {
18910
+ "details": {
18911
+ "additionalProperties": true,
18912
+ "type": "object"
18913
+ },
18914
+ "error": {
18915
+ "type": "string"
18916
+ },
18917
+ "message": {
18918
+ "type": "string"
18919
+ },
18920
+ "request_id": {
18921
+ "nullable": true,
18922
+ "type": "string"
18923
+ }
18924
+ },
18925
+ "type": "object"
18926
+ }
18927
+ }
18928
+ },
18929
+ "description": "Invalid `repo_key`, `repository_not_connected`, or `quota_exceeded`: the organization is at a code index limit, named in `details.quota` and `details.limit`"
18930
+ }
18931
+ },
18932
+ "summary": "Connect or resolve a repository",
18933
+ "tags": []
18934
+ }
18935
+ },
18936
+ "/api/v1/code/repositories/{repository_id}": {
18937
+ "delete": {
18938
+ "callbacks": {},
18939
+ "deprecated": false,
18940
+ "description": "Requires the `harness:write` scope AND Harness administrator standing in the organization the credential is bound to — this is a settings write, gated exactly as the settings UI is. Deletes the repository with its views, bases and syncs, and the blobs and facts no other repository of the organization uses. Answers with the counts removed.",
18941
+ "parameters": [
18942
+ {
18943
+ "description": "The repository's id",
18944
+ "in": "path",
18945
+ "name": "repository_id",
18946
+ "required": true,
18947
+ "schema": {
18948
+ "format": "uuid",
18949
+ "type": "string"
18950
+ }
18951
+ }
18952
+ ],
18953
+ "responses": {
18954
+ "200": {
18955
+ "content": {
18956
+ "application/json": {
18957
+ "schema": {
18958
+ "properties": {
18959
+ "data": {
18960
+ "properties": {
18961
+ "deleted": {
18962
+ "properties": {
18963
+ "bases": {
18964
+ "type": "integer"
18965
+ },
18966
+ "blobs": {
18967
+ "type": "integer"
18968
+ },
18969
+ "facts": {
18970
+ "type": "integer"
18971
+ },
18972
+ "repositories": {
18973
+ "type": "integer"
18974
+ },
18975
+ "views": {
18976
+ "type": "integer"
18977
+ }
18978
+ },
18979
+ "type": "object"
18980
+ }
18981
+ },
18982
+ "type": "object"
18983
+ },
18984
+ "meta": {
18985
+ "properties": {
18986
+ "contract": {
18987
+ "enum": [
18988
+ "1.2"
18989
+ ],
18990
+ "type": "string"
18991
+ }
18992
+ },
18993
+ "type": "object"
18994
+ }
18995
+ },
18996
+ "type": "object"
18997
+ }
18998
+ }
18999
+ },
19000
+ "description": "Success"
19001
+ },
19002
+ "400": {
19003
+ "description": "Bad request"
19004
+ },
19005
+ "401": {
19006
+ "description": "Missing or invalid token"
19007
+ },
19008
+ "403": {
19009
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
19010
+ },
19011
+ "404": {
19012
+ "description": "Not found"
19013
+ },
19014
+ "422": {
19015
+ "description": "Validation error"
19016
+ }
19017
+ },
19018
+ "summary": "Remove a repository from the code index",
19019
+ "tags": []
19020
+ }
19021
+ },
19022
+ "/api/v1/code/repositories/{repository_id}/bases/{sha}": {
19023
+ "get": {
19024
+ "callbacks": {},
19025
+ "deprecated": false,
19026
+ "description": "Requires the `harness:write` scope. Where the commit's base stands under the current upload policy. The server builds a base from the organization's GitHub connection: asking for one it has not built yet queues the build and answers `fetching`. It is `complete` once built, `ready` once indexed, and `failed` (with `error`) when the build failed; asking again retries it. Sync an overlay once the base is `complete` or `ready`.",
19027
+ "parameters": [
19028
+ {
19029
+ "description": "The repository's id",
19030
+ "in": "path",
19031
+ "name": "repository_id",
19032
+ "required": true,
19033
+ "schema": {
19034
+ "format": "uuid",
19035
+ "type": "string"
19036
+ }
19037
+ },
19038
+ {
19039
+ "description": "The commit's full SHA-1",
19040
+ "in": "path",
19041
+ "name": "sha",
19042
+ "required": true,
19043
+ "schema": {
19044
+ "pattern": "^[0-9a-f]{40}$",
19045
+ "type": "string"
19046
+ }
19047
+ },
19048
+ {
19049
+ "description": "`true` adds `skipped`: every file the base left out, with the reason",
19050
+ "in": "query",
19051
+ "name": "skipped",
19052
+ "required": false,
19053
+ "schema": {
19054
+ "type": "boolean"
19055
+ }
19056
+ }
19057
+ ],
19058
+ "responses": {
19059
+ "200": {
19060
+ "content": {
19061
+ "application/json": {
19062
+ "schema": {
19063
+ "properties": {
19064
+ "data": {
19065
+ "properties": {
19066
+ "blobs_missing": {
19067
+ "type": "integer"
19068
+ },
19069
+ "error": {
19070
+ "additionalProperties": true,
19071
+ "description": "Why the build failed",
19072
+ "nullable": true,
19073
+ "type": "object"
19074
+ },
19075
+ "excluded_count": {
19076
+ "type": "integer"
19077
+ },
19078
+ "file_count": {
19079
+ "type": "integer"
19080
+ },
19081
+ "policy_digest": {
19082
+ "type": "string"
19083
+ },
19084
+ "skipped": {
19085
+ "description": "Files in an indexed language the base left out whole, never stored",
19086
+ "items": {
19087
+ "properties": {
19088
+ "path": {
19089
+ "type": "string"
19090
+ },
19091
+ "reason": {
19092
+ "enum": [
19093
+ "excluded_path",
19094
+ "ignored",
19095
+ "secret_content",
19096
+ "binary",
19097
+ "too_large",
19098
+ "symlink"
19099
+ ],
19100
+ "type": "string"
19101
+ }
19102
+ },
19103
+ "type": "object"
19104
+ },
19105
+ "type": "array"
19106
+ },
19107
+ "state": {
19108
+ "enum": [
19109
+ "fetching",
19110
+ "complete",
19111
+ "ready",
19112
+ "failed"
19113
+ ],
19114
+ "type": "string"
19115
+ }
19116
+ },
19117
+ "type": "object"
19118
+ },
19119
+ "meta": {
19120
+ "properties": {
19121
+ "contract": {
19122
+ "enum": [
19123
+ "1.2"
19124
+ ],
19125
+ "type": "string"
19126
+ }
19127
+ },
19128
+ "type": "object"
19129
+ }
19130
+ },
19131
+ "type": "object"
19132
+ }
19133
+ }
19134
+ },
19135
+ "description": "Success"
19136
+ },
19137
+ "400": {
19138
+ "description": "Bad request"
19139
+ },
19140
+ "401": {
19141
+ "description": "Missing or invalid token"
19142
+ },
19143
+ "403": {
19144
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
19145
+ },
19146
+ "404": {
19147
+ "description": "Not found"
19148
+ },
19149
+ "422": {
19150
+ "description": "Validation error"
19151
+ }
19152
+ },
19153
+ "summary": "Get a commit's base",
19154
+ "tags": []
19155
+ }
19156
+ },
19157
+ "/api/v1/code/repositories/{repository_id}/views/{view_key}": {
19158
+ "put": {
19159
+ "callbacks": {},
19160
+ "deprecated": false,
19161
+ "description": "Requires the `harness:write` scope. A view is one worktree's overlay on a base and belongs to whoever created it: other members read it, but only its creator or a Harness administrator writes to it (403 `not_view_owner`). Answers with the view's status. A JSON body may be sent gzip-compressed with `Content-Encoding: gzip`; the size limit applies to it inflated.",
19162
+ "parameters": [
19163
+ {
19164
+ "description": "The repository's id",
19165
+ "in": "path",
19166
+ "name": "repository_id",
19167
+ "required": true,
19168
+ "schema": {
19169
+ "format": "uuid",
19170
+ "type": "string"
19171
+ }
19172
+ },
19173
+ {
19174
+ "description": "The worktree's key, 1–128 bytes, chosen by the client",
19175
+ "in": "path",
19176
+ "name": "view_key",
19177
+ "required": true,
19178
+ "schema": {
19179
+ "maxLength": 128,
19180
+ "minLength": 1,
19181
+ "type": "string"
19182
+ }
19183
+ }
19184
+ ],
19185
+ "requestBody": {
19186
+ "content": {
19187
+ "application/json": {
19188
+ "schema": {
19189
+ "additionalProperties": false,
19190
+ "properties": {
19191
+ "label": {
19192
+ "description": "A display label, updated on every call",
19193
+ "type": "string"
19194
+ },
19195
+ "session": {
19196
+ "description": "The client session that created the view",
19197
+ "type": "string"
19198
+ }
19199
+ },
19200
+ "type": "object"
19201
+ }
19202
+ }
19203
+ },
19204
+ "required": false
19205
+ },
19206
+ "responses": {
19207
+ "200": {
19208
+ "content": {
19209
+ "application/json": {
19210
+ "schema": {
19211
+ "properties": {
19212
+ "data": {
19213
+ "properties": {
19214
+ "active": {
19215
+ "description": "The version queries answer from; null before the first is indexed",
19216
+ "nullable": true,
19217
+ "properties": {
19218
+ "base_commit": {
19219
+ "pattern": "^[0-9a-f]{40}$",
19220
+ "type": "string"
19221
+ },
19222
+ "indexed_at": {
19223
+ "format": "date-time",
19224
+ "type": "string"
19225
+ },
19226
+ "overlay_digest": {
19227
+ "type": "string"
19228
+ },
19229
+ "version": {
19230
+ "type": "integer"
19231
+ }
19232
+ },
19233
+ "type": "object"
19234
+ },
19235
+ "kind": {
19236
+ "description": "A CLI worktree's overlay, or the repository's default branch, kept by the server",
19237
+ "enum": [
19238
+ "worktree",
19239
+ "default_branch"
19240
+ ],
19241
+ "type": "string"
19242
+ },
19243
+ "last_sync_at": {
19244
+ "format": "date-time",
19245
+ "nullable": true,
19246
+ "type": "string"
19247
+ },
19248
+ "pending": {
19249
+ "description": "A later sync still queued, indexing or failed",
19250
+ "nullable": true,
19251
+ "properties": {
19252
+ "error": {
19253
+ "description": "Why indexing failed",
19254
+ "nullable": true,
19255
+ "properties": {
19256
+ "failures": {
19257
+ "description": "For a refresh, how many times it has failed",
19258
+ "type": "integer"
19259
+ },
19260
+ "files": {
19261
+ "description": "For `regressed`, how many files would lose their facts",
19262
+ "type": "integer"
19263
+ },
19264
+ "message": {
19265
+ "type": "string"
19266
+ },
19267
+ "reason": {
19268
+ "description": "`regressed`: a refresh that would leave files without the facts the active version has; the view keeps that version",
19269
+ "type": "string"
19270
+ },
19271
+ "retry_at": {
19272
+ "description": "For a refresh, when the server tries it again",
19273
+ "format": "date-time",
19274
+ "type": "string"
19275
+ }
19276
+ },
19277
+ "type": "object"
19278
+ },
19279
+ "progress": {
19280
+ "description": "Files processed so far (parsed or failed) of those the sync must parse, updated after each batch; null before indexing starts",
19281
+ "nullable": true,
19282
+ "properties": {
19283
+ "done": {
19284
+ "type": "integer"
19285
+ },
19286
+ "total": {
19287
+ "type": "integer"
19288
+ }
19289
+ },
19290
+ "type": "object"
19291
+ },
19292
+ "state": {
19293
+ "type": "string"
19294
+ },
19295
+ "version": {
19296
+ "type": "integer"
19297
+ }
19298
+ },
19299
+ "type": "object"
19300
+ },
19301
+ "repository_id": {
19302
+ "format": "uuid",
19303
+ "type": "string"
19304
+ },
19305
+ "view_id": {
19306
+ "format": "uuid",
19307
+ "type": "string"
19308
+ },
19309
+ "view_key": {
19310
+ "type": "string"
19311
+ }
19312
+ },
19313
+ "type": "object"
19314
+ },
19315
+ "meta": {
19316
+ "properties": {
19317
+ "contract": {
19318
+ "enum": [
19319
+ "1.2"
19320
+ ],
19321
+ "type": "string"
19322
+ }
19323
+ },
19324
+ "type": "object"
19325
+ }
19326
+ },
19327
+ "type": "object"
19328
+ }
19329
+ }
19330
+ },
19331
+ "description": "Success"
19332
+ },
19333
+ "400": {
19334
+ "description": "Bad request"
19335
+ },
19336
+ "401": {
19337
+ "description": "Missing or invalid token"
19338
+ },
19339
+ "403": {
19340
+ "content": {
19341
+ "application/json": {
19342
+ "schema": {
19343
+ "properties": {
19344
+ "details": {
19345
+ "additionalProperties": true,
19346
+ "type": "object"
19347
+ },
19348
+ "error": {
19349
+ "type": "string"
19350
+ },
19351
+ "message": {
19352
+ "type": "string"
19353
+ },
19354
+ "request_id": {
19355
+ "nullable": true,
19356
+ "type": "string"
19357
+ }
19358
+ },
19359
+ "type": "object"
19360
+ }
19361
+ }
19362
+ },
19363
+ "description": "`not_view_owner`: another member's view; sync your own `view_key`; `code_index_disabled` while the code index is off"
19364
+ },
19365
+ "404": {
19366
+ "description": "Not found"
19367
+ },
19368
+ "422": {
19369
+ "content": {
19370
+ "application/json": {
19371
+ "schema": {
19372
+ "properties": {
19373
+ "details": {
19374
+ "additionalProperties": true,
19375
+ "type": "object"
19376
+ },
19377
+ "error": {
19378
+ "type": "string"
19379
+ },
19380
+ "message": {
19381
+ "type": "string"
19382
+ },
19383
+ "request_id": {
19384
+ "nullable": true,
19385
+ "type": "string"
19386
+ }
19387
+ },
19388
+ "type": "object"
19389
+ }
19390
+ }
19391
+ },
19392
+ "description": "Invalid `view_key` (the key `default` is the server's), or `quota_exceeded`: the organization is at a code index limit, named in `details.quota` and `details.limit`"
19393
+ }
19394
+ },
19395
+ "summary": "Create or resolve a worktree view",
19396
+ "tags": []
19397
+ }
19398
+ },
19399
+ "/api/v1/code/views/{view_id}": {
19400
+ "get": {
19401
+ "callbacks": {},
19402
+ "deprecated": false,
19403
+ "description": "Requires the `harness:read` scope. Its active version, with that version's base commit and overlay digest, and any sync still pending.",
19404
+ "parameters": [
19405
+ {
19406
+ "description": "The view's id",
19407
+ "in": "path",
19408
+ "name": "view_id",
19409
+ "required": true,
19410
+ "schema": {
19411
+ "format": "uuid",
19412
+ "type": "string"
19413
+ }
19414
+ }
19415
+ ],
19416
+ "responses": {
19417
+ "200": {
19418
+ "content": {
19419
+ "application/json": {
19420
+ "schema": {
19421
+ "properties": {
19422
+ "data": {
19423
+ "properties": {
19424
+ "active": {
19425
+ "description": "The version queries answer from; null before the first is indexed",
19426
+ "nullable": true,
19427
+ "properties": {
19428
+ "base_commit": {
19429
+ "pattern": "^[0-9a-f]{40}$",
19430
+ "type": "string"
19431
+ },
19432
+ "indexed_at": {
19433
+ "format": "date-time",
19434
+ "type": "string"
19435
+ },
19436
+ "overlay_digest": {
19437
+ "type": "string"
19438
+ },
19439
+ "version": {
19440
+ "type": "integer"
19441
+ }
19442
+ },
19443
+ "type": "object"
19444
+ },
19445
+ "kind": {
19446
+ "description": "A CLI worktree's overlay, or the repository's default branch, kept by the server",
19447
+ "enum": [
19448
+ "worktree",
19449
+ "default_branch"
19450
+ ],
19451
+ "type": "string"
19452
+ },
19453
+ "last_sync_at": {
19454
+ "format": "date-time",
19455
+ "nullable": true,
19456
+ "type": "string"
19457
+ },
19458
+ "pending": {
19459
+ "description": "A later sync still queued, indexing or failed",
19460
+ "nullable": true,
19461
+ "properties": {
19462
+ "error": {
19463
+ "description": "Why indexing failed",
19464
+ "nullable": true,
19465
+ "properties": {
19466
+ "failures": {
19467
+ "description": "For a refresh, how many times it has failed",
19468
+ "type": "integer"
19469
+ },
19470
+ "files": {
19471
+ "description": "For `regressed`, how many files would lose their facts",
19472
+ "type": "integer"
19473
+ },
19474
+ "message": {
19475
+ "type": "string"
19476
+ },
19477
+ "reason": {
19478
+ "description": "`regressed`: a refresh that would leave files without the facts the active version has; the view keeps that version",
19479
+ "type": "string"
19480
+ },
19481
+ "retry_at": {
19482
+ "description": "For a refresh, when the server tries it again",
19483
+ "format": "date-time",
19484
+ "type": "string"
19485
+ }
19486
+ },
19487
+ "type": "object"
19488
+ },
19489
+ "progress": {
19490
+ "description": "Files processed so far (parsed or failed) of those the sync must parse, updated after each batch; null before indexing starts",
19491
+ "nullable": true,
19492
+ "properties": {
19493
+ "done": {
19494
+ "type": "integer"
19495
+ },
19496
+ "total": {
19497
+ "type": "integer"
19498
+ }
19499
+ },
19500
+ "type": "object"
19501
+ },
19502
+ "state": {
19503
+ "type": "string"
19504
+ },
19505
+ "version": {
19506
+ "type": "integer"
19507
+ }
19508
+ },
19509
+ "type": "object"
19510
+ },
19511
+ "repository_id": {
19512
+ "format": "uuid",
19513
+ "type": "string"
19514
+ },
19515
+ "view_id": {
19516
+ "format": "uuid",
19517
+ "type": "string"
19518
+ },
19519
+ "view_key": {
19520
+ "type": "string"
19521
+ }
19522
+ },
19523
+ "type": "object"
19524
+ },
19525
+ "meta": {
19526
+ "properties": {
19527
+ "contract": {
19528
+ "enum": [
19529
+ "1.2"
19530
+ ],
19531
+ "type": "string"
19532
+ }
19533
+ },
19534
+ "type": "object"
19535
+ }
19536
+ },
19537
+ "type": "object"
19538
+ }
19539
+ }
19540
+ },
19541
+ "description": "Success"
19542
+ },
19543
+ "400": {
19544
+ "description": "Bad request"
19545
+ },
19546
+ "401": {
19547
+ "description": "Missing or invalid token"
19548
+ },
19549
+ "403": {
19550
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
19551
+ },
19552
+ "404": {
19553
+ "description": "Not found"
19554
+ },
19555
+ "422": {
19556
+ "description": "Validation error"
19557
+ }
19558
+ },
19559
+ "summary": "Get a view's status",
19560
+ "tags": []
19561
+ }
19562
+ },
19563
+ "/api/v1/code/views/{view_id}/affected": {
19564
+ "post": {
19565
+ "callbacks": {},
19566
+ "deprecated": false,
19567
+ "description": "Requires the `harness:read` scope. The symbols that transitively depend on the given symbols, or on every symbol the given paths declare, up to `depth`. Calls are followed, and an import, alias, use or require only when it names a module. A type use is listed under `type_dependents` and not followed unless `include_types`. A read of a value asked for is impact at depth 1. A dependent declared at module level is listed with `via_level: \"module_level\"` and not expanded. An ambiguous reference is listed under `possible` and not followed unless `include_ambiguous`. The body is at most 256 KiB. A JSON body may be sent gzip-compressed with `Content-Encoding: gzip`; the size limit applies to it inflated. `meta.truncation` says whether the answer was cut, the cap that applied and, when a larger request would show more, the parameters to send next (`next`). `not_tracked` names the references the symbol's language doesn't record, so an empty list isn't read as none. A view with no indexed version yet answers 400.",
19568
+ "parameters": [
19569
+ {
19570
+ "description": "The view's id",
19571
+ "in": "path",
19572
+ "name": "view_id",
19573
+ "required": true,
19574
+ "schema": {
19575
+ "format": "uuid",
19576
+ "type": "string"
19577
+ }
19578
+ }
19579
+ ],
19580
+ "requestBody": {
19581
+ "content": {
19582
+ "application/json": {
19583
+ "schema": {
19584
+ "additionalProperties": false,
19585
+ "properties": {
19586
+ "depth": {
19587
+ "default": 3,
19588
+ "maximum": 6,
19589
+ "minimum": 1,
19590
+ "type": "integer"
19591
+ },
19592
+ "include_ambiguous": {
19593
+ "default": false,
19594
+ "type": "boolean"
19595
+ },
19596
+ "include_types": {
19597
+ "default": false,
19598
+ "type": "boolean"
19599
+ },
19600
+ "paths": {
19601
+ "description": "Files whose symbols seed it",
19602
+ "items": {
19603
+ "type": "string"
19604
+ },
19605
+ "type": "array"
19606
+ },
19607
+ "symbol_ids": {
19608
+ "description": "Symbol ids from search",
19609
+ "items": {
19610
+ "type": "string"
19611
+ },
19612
+ "type": "array"
19613
+ }
19614
+ },
19615
+ "type": "object"
19616
+ }
19617
+ }
19618
+ },
19619
+ "required": true
19620
+ },
19621
+ "responses": {
19622
+ "200": {
19623
+ "content": {
19624
+ "application/json": {
19625
+ "schema": {
19626
+ "properties": {
19627
+ "data": {
19628
+ "properties": {
19629
+ "files": {
19630
+ "items": {
19631
+ "type": "string"
19632
+ },
19633
+ "type": "array"
19634
+ },
19635
+ "not_tracked": {
19636
+ "description": "The references to the symbols asked about that their language doesn't record, in full or in part",
19637
+ "items": {
19638
+ "properties": {
19639
+ "language": {
19640
+ "type": "string"
19641
+ },
19642
+ "partial": {
19643
+ "type": "boolean"
19644
+ },
19645
+ "reason": {
19646
+ "type": "string"
19647
+ },
19648
+ "reference_kind": {
19649
+ "type": "string"
19650
+ }
19651
+ },
19652
+ "type": "object"
19653
+ },
19654
+ "type": "array"
19655
+ },
19656
+ "possible": {
19657
+ "items": {
19658
+ "additionalProperties": true,
19659
+ "properties": {
19660
+ "at": {
19661
+ "additionalProperties": true,
19662
+ "description": "A file and its line and byte span at the view's version",
19663
+ "properties": {
19664
+ "end_byte": {
19665
+ "type": "integer"
19666
+ },
19667
+ "end_line": {
19668
+ "type": "integer"
19669
+ },
19670
+ "path": {
19671
+ "type": "string"
19672
+ },
19673
+ "start_byte": {
19674
+ "type": "integer"
19675
+ },
19676
+ "start_line": {
19677
+ "type": "integer"
19678
+ },
19679
+ "truncated": {
19680
+ "description": "The snippet was cut to its budget",
19681
+ "type": "boolean"
19682
+ }
19683
+ },
19684
+ "type": "object"
19685
+ },
19686
+ "binding": {
19687
+ "enum": [
19688
+ "resolved",
19689
+ "ambiguous"
19690
+ ],
19691
+ "type": "string"
19692
+ },
19693
+ "distance": {
19694
+ "type": "integer"
19695
+ },
19696
+ "kind": {
19697
+ "type": "string"
19698
+ },
19699
+ "name": {
19700
+ "type": "string"
19701
+ },
19702
+ "relation": {
19703
+ "enum": [
19704
+ "read",
19705
+ "type"
19706
+ ],
19707
+ "type": "string"
19708
+ },
19709
+ "score": {
19710
+ "description": "For an ambiguous binding, the product of the scores along the way",
19711
+ "type": "number"
19712
+ },
19713
+ "symbol_id": {
19714
+ "type": "string"
19715
+ },
19716
+ "via": {
19717
+ "additionalProperties": true,
19718
+ "description": "A file and its line and byte span at the view's version",
19719
+ "properties": {
19720
+ "end_byte": {
19721
+ "type": "integer"
19722
+ },
19723
+ "end_line": {
19724
+ "type": "integer"
19725
+ },
19726
+ "path": {
19727
+ "type": "string"
19728
+ },
19729
+ "start_byte": {
19730
+ "type": "integer"
19731
+ },
19732
+ "start_line": {
19733
+ "type": "integer"
19734
+ },
19735
+ "truncated": {
19736
+ "description": "The snippet was cut to its budget",
19737
+ "type": "boolean"
19738
+ }
19739
+ },
19740
+ "type": "object"
19741
+ },
19742
+ "via_level": {
19743
+ "enum": [
19744
+ "module_level"
19745
+ ],
19746
+ "type": "string"
19747
+ }
19748
+ },
19749
+ "type": "object"
19750
+ },
19751
+ "type": "array"
19752
+ },
19753
+ "symbols": {
19754
+ "items": {
19755
+ "additionalProperties": true,
19756
+ "properties": {
19757
+ "at": {
19758
+ "additionalProperties": true,
19759
+ "description": "A file and its line and byte span at the view's version",
19760
+ "properties": {
19761
+ "end_byte": {
19762
+ "type": "integer"
19763
+ },
19764
+ "end_line": {
19765
+ "type": "integer"
19766
+ },
19767
+ "path": {
19768
+ "type": "string"
19769
+ },
19770
+ "start_byte": {
19771
+ "type": "integer"
19772
+ },
19773
+ "start_line": {
19774
+ "type": "integer"
19775
+ },
19776
+ "truncated": {
19777
+ "description": "The snippet was cut to its budget",
19778
+ "type": "boolean"
19779
+ }
19780
+ },
19781
+ "type": "object"
19782
+ },
19783
+ "binding": {
19784
+ "enum": [
19785
+ "resolved",
19786
+ "ambiguous"
19787
+ ],
19788
+ "type": "string"
19789
+ },
19790
+ "distance": {
19791
+ "type": "integer"
19792
+ },
19793
+ "kind": {
19794
+ "type": "string"
19795
+ },
19796
+ "name": {
19797
+ "type": "string"
19798
+ },
19799
+ "relation": {
19800
+ "enum": [
19801
+ "read",
19802
+ "type"
19803
+ ],
19804
+ "type": "string"
19805
+ },
19806
+ "score": {
19807
+ "description": "For an ambiguous binding, the product of the scores along the way",
19808
+ "type": "number"
19809
+ },
19810
+ "symbol_id": {
19811
+ "type": "string"
19812
+ },
19813
+ "via": {
19814
+ "additionalProperties": true,
19815
+ "description": "A file and its line and byte span at the view's version",
19816
+ "properties": {
19817
+ "end_byte": {
19818
+ "type": "integer"
19819
+ },
19820
+ "end_line": {
19821
+ "type": "integer"
19822
+ },
19823
+ "path": {
19824
+ "type": "string"
19825
+ },
19826
+ "start_byte": {
19827
+ "type": "integer"
19828
+ },
19829
+ "start_line": {
19830
+ "type": "integer"
19831
+ },
19832
+ "truncated": {
19833
+ "description": "The snippet was cut to its budget",
19834
+ "type": "boolean"
19835
+ }
19836
+ },
19837
+ "type": "object"
19838
+ },
19839
+ "via_level": {
19840
+ "enum": [
19841
+ "module_level"
19842
+ ],
19843
+ "type": "string"
19844
+ }
19845
+ },
19846
+ "type": "object"
19847
+ },
19848
+ "type": "array"
19849
+ },
19850
+ "type_dependents": {
19851
+ "items": {
19852
+ "additionalProperties": true,
19853
+ "properties": {
19854
+ "at": {
19855
+ "additionalProperties": true,
19856
+ "description": "A file and its line and byte span at the view's version",
19857
+ "properties": {
19858
+ "end_byte": {
19859
+ "type": "integer"
19860
+ },
19861
+ "end_line": {
19862
+ "type": "integer"
19863
+ },
19864
+ "path": {
19865
+ "type": "string"
19866
+ },
19867
+ "start_byte": {
19868
+ "type": "integer"
19869
+ },
19870
+ "start_line": {
19871
+ "type": "integer"
19872
+ },
19873
+ "truncated": {
19874
+ "description": "The snippet was cut to its budget",
19875
+ "type": "boolean"
19876
+ }
19877
+ },
19878
+ "type": "object"
19879
+ },
19880
+ "binding": {
19881
+ "enum": [
19882
+ "resolved",
19883
+ "ambiguous"
19884
+ ],
19885
+ "type": "string"
19886
+ },
19887
+ "distance": {
19888
+ "type": "integer"
19889
+ },
19890
+ "kind": {
19891
+ "type": "string"
19892
+ },
19893
+ "name": {
19894
+ "type": "string"
19895
+ },
19896
+ "relation": {
19897
+ "enum": [
19898
+ "read",
19899
+ "type"
19900
+ ],
19901
+ "type": "string"
19902
+ },
19903
+ "score": {
19904
+ "description": "For an ambiguous binding, the product of the scores along the way",
19905
+ "type": "number"
19906
+ },
19907
+ "symbol_id": {
19908
+ "type": "string"
19909
+ },
19910
+ "via": {
19911
+ "additionalProperties": true,
19912
+ "description": "A file and its line and byte span at the view's version",
19913
+ "properties": {
19914
+ "end_byte": {
19915
+ "type": "integer"
19916
+ },
19917
+ "end_line": {
19918
+ "type": "integer"
19919
+ },
19920
+ "path": {
19921
+ "type": "string"
19922
+ },
19923
+ "start_byte": {
19924
+ "type": "integer"
19925
+ },
19926
+ "start_line": {
19927
+ "type": "integer"
19928
+ },
19929
+ "truncated": {
19930
+ "description": "The snippet was cut to its budget",
19931
+ "type": "boolean"
19932
+ }
19933
+ },
19934
+ "type": "object"
19935
+ },
19936
+ "via_level": {
19937
+ "enum": [
19938
+ "module_level"
19939
+ ],
19940
+ "type": "string"
19941
+ }
19942
+ },
19943
+ "type": "object"
19944
+ },
19945
+ "type": "array"
19946
+ }
19947
+ },
19948
+ "type": "object"
19949
+ },
19950
+ "meta": {
19951
+ "properties": {
19952
+ "contract": {
19953
+ "enum": [
19954
+ "1.3"
19955
+ ],
19956
+ "type": "string"
19957
+ },
19958
+ "truncation": {
19959
+ "additionalProperties": true,
19960
+ "description": "Whether the answer was cut and how: the caps that applied, what was left out (e.g. `lists`, `depth_limited`, `items_without_text`, `candidates_dropped`) and, when a larger request would show more, the parameters to send next.",
19961
+ "properties": {
19962
+ "budget_tokens": {
19963
+ "type": "integer"
19964
+ },
19965
+ "candidates_dropped": {
19966
+ "type": "integer"
19967
+ },
19968
+ "definition_truncated": {
19969
+ "type": "boolean"
19970
+ },
19971
+ "depth": {
19972
+ "type": "integer"
19973
+ },
19974
+ "depth_limited": {
19975
+ "description": "Dependents not yet listed remain past the depth asked for",
19976
+ "type": "boolean"
19977
+ },
19978
+ "hint": {
19979
+ "type": "string"
19980
+ },
19981
+ "items_unavailable": {
19982
+ "description": "Items whose indexed content couldn't be read",
19983
+ "type": "integer"
19984
+ },
19985
+ "items_without_text": {
19986
+ "description": "Items the budget left as citations without text",
19987
+ "type": "integer"
19988
+ },
19989
+ "limit": {
19990
+ "type": "integer"
19991
+ },
19992
+ "limits": {
19993
+ "additionalProperties": {
19994
+ "type": "integer"
19995
+ },
19996
+ "type": "object"
19997
+ },
19998
+ "lists": {
19999
+ "description": "The answer's lists the caps cut",
20000
+ "items": {
20001
+ "type": "string"
20002
+ },
20003
+ "type": "array"
20004
+ },
20005
+ "next": {
20006
+ "additionalProperties": true,
20007
+ "description": "The request parameters to send for more: `limit`, `depth` or `budget_tokens`",
20008
+ "type": "object"
20009
+ },
20010
+ "references_cut": {
20011
+ "type": "boolean"
20012
+ },
20013
+ "seeds_dropped": {
20014
+ "type": "integer"
20015
+ },
20016
+ "truncated": {
20017
+ "type": "boolean"
20018
+ }
20019
+ },
20020
+ "required": [
20021
+ "truncated"
20022
+ ],
20023
+ "type": "object"
20024
+ },
20025
+ "view": {
20026
+ "properties": {
20027
+ "active": {
20028
+ "description": "The version queries answer from; null before the first is indexed",
20029
+ "nullable": true,
20030
+ "properties": {
20031
+ "base_commit": {
20032
+ "pattern": "^[0-9a-f]{40}$",
20033
+ "type": "string"
20034
+ },
20035
+ "indexed_at": {
20036
+ "format": "date-time",
20037
+ "type": "string"
20038
+ },
20039
+ "overlay_digest": {
20040
+ "type": "string"
20041
+ },
20042
+ "version": {
20043
+ "type": "integer"
20044
+ }
20045
+ },
20046
+ "type": "object"
20047
+ },
20048
+ "kind": {
20049
+ "description": "A CLI worktree's overlay, or the repository's default branch, kept by the server",
20050
+ "enum": [
20051
+ "worktree",
20052
+ "default_branch"
20053
+ ],
20054
+ "type": "string"
20055
+ },
20056
+ "last_sync_at": {
20057
+ "format": "date-time",
20058
+ "nullable": true,
20059
+ "type": "string"
20060
+ },
20061
+ "pending": {
20062
+ "description": "A later sync still queued, indexing or failed",
20063
+ "nullable": true,
20064
+ "properties": {
20065
+ "error": {
20066
+ "description": "Why indexing failed",
20067
+ "nullable": true,
20068
+ "properties": {
20069
+ "failures": {
20070
+ "description": "For a refresh, how many times it has failed",
20071
+ "type": "integer"
20072
+ },
20073
+ "files": {
20074
+ "description": "For `regressed`, how many files would lose their facts",
20075
+ "type": "integer"
20076
+ },
20077
+ "message": {
20078
+ "type": "string"
20079
+ },
20080
+ "reason": {
20081
+ "description": "`regressed`: a refresh that would leave files without the facts the active version has; the view keeps that version",
20082
+ "type": "string"
20083
+ },
20084
+ "retry_at": {
20085
+ "description": "For a refresh, when the server tries it again",
20086
+ "format": "date-time",
20087
+ "type": "string"
20088
+ }
20089
+ },
20090
+ "type": "object"
20091
+ },
20092
+ "progress": {
20093
+ "description": "Files processed so far (parsed or failed) of those the sync must parse, updated after each batch; null before indexing starts",
20094
+ "nullable": true,
20095
+ "properties": {
20096
+ "done": {
20097
+ "type": "integer"
20098
+ },
20099
+ "total": {
20100
+ "type": "integer"
20101
+ }
20102
+ },
20103
+ "type": "object"
20104
+ },
20105
+ "state": {
20106
+ "type": "string"
20107
+ },
20108
+ "version": {
20109
+ "type": "integer"
20110
+ }
20111
+ },
20112
+ "type": "object"
20113
+ },
20114
+ "repository_id": {
20115
+ "format": "uuid",
20116
+ "type": "string"
20117
+ },
20118
+ "view_id": {
20119
+ "format": "uuid",
20120
+ "type": "string"
20121
+ },
20122
+ "view_key": {
20123
+ "type": "string"
20124
+ }
20125
+ },
20126
+ "type": "object"
20127
+ }
20128
+ },
20129
+ "type": "object"
20130
+ }
20131
+ },
20132
+ "type": "object"
20133
+ }
20134
+ }
20135
+ },
20136
+ "description": "Success"
20137
+ },
20138
+ "400": {
20139
+ "description": "Bad request"
20140
+ },
20141
+ "401": {
20142
+ "description": "Missing or invalid token"
20143
+ },
20144
+ "403": {
20145
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
20146
+ },
20147
+ "404": {
20148
+ "description": "Not found"
20149
+ },
20150
+ "413": {
20151
+ "content": {
20152
+ "application/json": {
20153
+ "schema": {
20154
+ "properties": {
20155
+ "details": {
20156
+ "additionalProperties": true,
20157
+ "type": "object"
20158
+ },
20159
+ "error": {
20160
+ "type": "string"
20161
+ },
20162
+ "message": {
20163
+ "type": "string"
20164
+ },
20165
+ "request_id": {
20166
+ "nullable": true,
20167
+ "type": "string"
20168
+ }
20169
+ },
20170
+ "type": "object"
20171
+ }
20172
+ }
20173
+ },
20174
+ "description": "The body exceeds the size limit (`payload_too_large`)"
20175
+ },
20176
+ "422": {
20177
+ "description": "Validation error"
20178
+ }
20179
+ },
20180
+ "summary": "Find what a change affects",
20181
+ "tags": []
20182
+ }
20183
+ },
20184
+ "/api/v1/code/views/{view_id}/context": {
20185
+ "get": {
20186
+ "callbacks": {},
20187
+ "deprecated": false,
20188
+ "description": "Requires the `harness:read` scope. The symbol's definition first, then what it calls and what calls it, ranked by how directly they bear on it, packed into the budget at about 4 characters a token. Every item cites its file and byte span; the definition always keeps text, and an item that doesn't fit stays a citation without it. `meta.truncation` says whether the answer was cut, the cap that applied and, when a larger request would show more, the parameters to send next (`next`). `not_tracked` names the references the symbol's language doesn't record, so an empty list isn't read as none. A view with no indexed version yet answers 400.",
20189
+ "parameters": [
20190
+ {
20191
+ "description": "The view's id",
20192
+ "in": "path",
20193
+ "name": "view_id",
20194
+ "required": true,
20195
+ "schema": {
20196
+ "format": "uuid",
20197
+ "type": "string"
20198
+ }
20199
+ },
20200
+ {
20201
+ "description": "The symbol to explain",
20202
+ "in": "query",
20203
+ "name": "symbol_id",
20204
+ "required": false,
20205
+ "schema": {
20206
+ "type": "string"
20207
+ }
20208
+ },
20209
+ {
20210
+ "description": "Without `symbol_id`, a name whose best match is used",
20211
+ "in": "query",
20212
+ "name": "q",
20213
+ "required": false,
20214
+ "schema": {
20215
+ "type": "string"
20216
+ }
20217
+ },
20218
+ {
20219
+ "description": "The token budget, 100 to 32,000 (default 2,000)",
20220
+ "in": "query",
20221
+ "name": "budget_tokens",
20222
+ "required": false,
20223
+ "schema": {
20224
+ "type": "integer"
20225
+ }
20226
+ }
20227
+ ],
20228
+ "responses": {
20229
+ "200": {
20230
+ "content": {
20231
+ "application/json": {
20232
+ "schema": {
20233
+ "properties": {
20234
+ "data": {
20235
+ "properties": {
20236
+ "budget_tokens": {
20237
+ "type": "integer"
20238
+ },
20239
+ "items": {
20240
+ "items": {
20241
+ "additionalProperties": true,
20242
+ "description": "A cited window with its role (`definition`, `callee`, `caller`, …) and, when it fits, its text",
20243
+ "type": "object"
20244
+ },
20245
+ "type": "array"
20246
+ },
20247
+ "not_tracked": {
20248
+ "description": "The references to the symbols asked about that their language doesn't record, in full or in part",
20249
+ "items": {
20250
+ "properties": {
20251
+ "language": {
20252
+ "type": "string"
20253
+ },
20254
+ "partial": {
20255
+ "type": "boolean"
20256
+ },
20257
+ "reason": {
20258
+ "type": "string"
20259
+ },
20260
+ "reference_kind": {
20261
+ "type": "string"
20262
+ }
20263
+ },
20264
+ "type": "object"
20265
+ },
20266
+ "type": "array"
20267
+ },
20268
+ "symbol": {
20269
+ "properties": {
20270
+ "kind": {
20271
+ "type": "string"
20272
+ },
20273
+ "name": {
20274
+ "type": "string"
20275
+ },
20276
+ "symbol_id": {
20277
+ "type": "string"
20278
+ }
20279
+ },
20280
+ "type": "object"
20281
+ },
20282
+ "token_estimate": {
20283
+ "type": "string"
20284
+ },
20285
+ "used_tokens": {
20286
+ "type": "integer"
20287
+ }
20288
+ },
20289
+ "type": "object"
20290
+ },
20291
+ "meta": {
20292
+ "properties": {
20293
+ "contract": {
20294
+ "enum": [
20295
+ "1.3"
20296
+ ],
20297
+ "type": "string"
20298
+ },
20299
+ "truncation": {
20300
+ "additionalProperties": true,
20301
+ "description": "Whether the answer was cut and how: the caps that applied, what was left out (e.g. `lists`, `depth_limited`, `items_without_text`, `candidates_dropped`) and, when a larger request would show more, the parameters to send next.",
20302
+ "properties": {
20303
+ "budget_tokens": {
20304
+ "type": "integer"
20305
+ },
20306
+ "candidates_dropped": {
20307
+ "type": "integer"
20308
+ },
20309
+ "definition_truncated": {
20310
+ "type": "boolean"
20311
+ },
20312
+ "depth": {
20313
+ "type": "integer"
20314
+ },
20315
+ "depth_limited": {
20316
+ "description": "Dependents not yet listed remain past the depth asked for",
20317
+ "type": "boolean"
20318
+ },
20319
+ "hint": {
20320
+ "type": "string"
20321
+ },
20322
+ "items_unavailable": {
20323
+ "description": "Items whose indexed content couldn't be read",
20324
+ "type": "integer"
20325
+ },
20326
+ "items_without_text": {
20327
+ "description": "Items the budget left as citations without text",
20328
+ "type": "integer"
20329
+ },
20330
+ "limit": {
20331
+ "type": "integer"
20332
+ },
20333
+ "limits": {
20334
+ "additionalProperties": {
20335
+ "type": "integer"
20336
+ },
20337
+ "type": "object"
20338
+ },
20339
+ "lists": {
20340
+ "description": "The answer's lists the caps cut",
20341
+ "items": {
20342
+ "type": "string"
20343
+ },
20344
+ "type": "array"
20345
+ },
20346
+ "next": {
20347
+ "additionalProperties": true,
20348
+ "description": "The request parameters to send for more: `limit`, `depth` or `budget_tokens`",
20349
+ "type": "object"
20350
+ },
20351
+ "references_cut": {
20352
+ "type": "boolean"
20353
+ },
20354
+ "seeds_dropped": {
20355
+ "type": "integer"
20356
+ },
20357
+ "truncated": {
20358
+ "type": "boolean"
20359
+ }
20360
+ },
20361
+ "required": [
20362
+ "truncated"
20363
+ ],
20364
+ "type": "object"
20365
+ },
20366
+ "view": {
20367
+ "properties": {
20368
+ "active": {
20369
+ "description": "The version queries answer from; null before the first is indexed",
20370
+ "nullable": true,
20371
+ "properties": {
20372
+ "base_commit": {
20373
+ "pattern": "^[0-9a-f]{40}$",
20374
+ "type": "string"
20375
+ },
20376
+ "indexed_at": {
20377
+ "format": "date-time",
20378
+ "type": "string"
20379
+ },
20380
+ "overlay_digest": {
20381
+ "type": "string"
20382
+ },
20383
+ "version": {
20384
+ "type": "integer"
20385
+ }
20386
+ },
20387
+ "type": "object"
20388
+ },
20389
+ "kind": {
20390
+ "description": "A CLI worktree's overlay, or the repository's default branch, kept by the server",
20391
+ "enum": [
20392
+ "worktree",
20393
+ "default_branch"
20394
+ ],
20395
+ "type": "string"
20396
+ },
20397
+ "last_sync_at": {
20398
+ "format": "date-time",
20399
+ "nullable": true,
20400
+ "type": "string"
20401
+ },
20402
+ "pending": {
20403
+ "description": "A later sync still queued, indexing or failed",
20404
+ "nullable": true,
20405
+ "properties": {
20406
+ "error": {
20407
+ "description": "Why indexing failed",
20408
+ "nullable": true,
20409
+ "properties": {
20410
+ "failures": {
20411
+ "description": "For a refresh, how many times it has failed",
20412
+ "type": "integer"
20413
+ },
20414
+ "files": {
20415
+ "description": "For `regressed`, how many files would lose their facts",
20416
+ "type": "integer"
20417
+ },
20418
+ "message": {
20419
+ "type": "string"
20420
+ },
20421
+ "reason": {
20422
+ "description": "`regressed`: a refresh that would leave files without the facts the active version has; the view keeps that version",
20423
+ "type": "string"
20424
+ },
20425
+ "retry_at": {
20426
+ "description": "For a refresh, when the server tries it again",
20427
+ "format": "date-time",
20428
+ "type": "string"
20429
+ }
20430
+ },
20431
+ "type": "object"
20432
+ },
20433
+ "progress": {
20434
+ "description": "Files processed so far (parsed or failed) of those the sync must parse, updated after each batch; null before indexing starts",
20435
+ "nullable": true,
20436
+ "properties": {
20437
+ "done": {
20438
+ "type": "integer"
20439
+ },
20440
+ "total": {
20441
+ "type": "integer"
20442
+ }
20443
+ },
20444
+ "type": "object"
20445
+ },
20446
+ "state": {
20447
+ "type": "string"
20448
+ },
20449
+ "version": {
20450
+ "type": "integer"
20451
+ }
20452
+ },
20453
+ "type": "object"
20454
+ },
20455
+ "repository_id": {
20456
+ "format": "uuid",
20457
+ "type": "string"
20458
+ },
20459
+ "view_id": {
20460
+ "format": "uuid",
20461
+ "type": "string"
20462
+ },
20463
+ "view_key": {
20464
+ "type": "string"
20465
+ }
20466
+ },
20467
+ "type": "object"
20468
+ }
20469
+ },
20470
+ "type": "object"
20471
+ }
20472
+ },
20473
+ "type": "object"
20474
+ }
20475
+ }
20476
+ },
20477
+ "description": "Success"
20478
+ },
20479
+ "400": {
20480
+ "description": "Bad request"
20481
+ },
20482
+ "401": {
20483
+ "description": "Missing or invalid token"
20484
+ },
20485
+ "403": {
20486
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
20487
+ },
20488
+ "404": {
20489
+ "description": "Not found"
20490
+ },
20491
+ "422": {
20492
+ "description": "Validation error"
20493
+ }
20494
+ },
20495
+ "summary": "Pack cited source for a symbol",
20496
+ "tags": []
20497
+ }
20498
+ },
20499
+ "/api/v1/code/views/{view_id}/symbols": {
20500
+ "get": {
20501
+ "callbacks": {},
20502
+ "deprecated": false,
20503
+ "description": "Requires the `harness:read` scope. Symbols at the view's active version, best first: exact names, then a fused ranking of name prefix and fuzzy name similarity. `meta.truncation` says whether the answer was cut, the cap that applied and, when a larger request would show more, the parameters to send next (`next`). A view with no indexed version yet answers 400.",
20504
+ "parameters": [
20505
+ {
20506
+ "description": "The view's id",
20507
+ "in": "path",
20508
+ "name": "view_id",
20509
+ "required": true,
20510
+ "schema": {
20511
+ "format": "uuid",
20512
+ "type": "string"
20513
+ }
20514
+ },
20515
+ {
20516
+ "description": "The name to search for",
20517
+ "in": "query",
20518
+ "name": "q",
20519
+ "required": false,
20520
+ "schema": {
20521
+ "type": "string"
20522
+ }
20523
+ },
20524
+ {
20525
+ "description": "Only symbols of this kind, e.g. `function` or `module`",
20526
+ "in": "query",
20527
+ "name": "kind",
20528
+ "required": false,
20529
+ "schema": {
20530
+ "type": "string"
20531
+ }
20532
+ },
20533
+ {
20534
+ "description": "Only symbols declared under this path",
20535
+ "in": "query",
20536
+ "name": "path_prefix",
20537
+ "required": false,
20538
+ "schema": {
20539
+ "type": "string"
20540
+ }
20541
+ },
20542
+ {
20543
+ "description": "At most this many symbols, up to 100 (default 20)",
20544
+ "in": "query",
20545
+ "name": "limit",
20546
+ "required": false,
20547
+ "schema": {
20548
+ "type": "integer"
20549
+ }
20550
+ }
20551
+ ],
20552
+ "responses": {
20553
+ "200": {
20554
+ "content": {
20555
+ "application/json": {
20556
+ "schema": {
20557
+ "properties": {
20558
+ "data": {
20559
+ "items": {
20560
+ "properties": {
20561
+ "at": {
20562
+ "additionalProperties": true,
20563
+ "description": "A file and its line and byte span at the view's version",
20564
+ "properties": {
20565
+ "end_byte": {
20566
+ "type": "integer"
20567
+ },
20568
+ "end_line": {
20569
+ "type": "integer"
20570
+ },
20571
+ "path": {
20572
+ "type": "string"
20573
+ },
20574
+ "start_byte": {
20575
+ "type": "integer"
20576
+ },
20577
+ "start_line": {
20578
+ "type": "integer"
20579
+ },
20580
+ "truncated": {
20581
+ "description": "The snippet was cut to its budget",
20582
+ "type": "boolean"
20583
+ }
20584
+ },
20585
+ "type": "object"
20586
+ },
20587
+ "kind": {
20588
+ "type": "string"
20589
+ },
20590
+ "language": {
20591
+ "type": "string"
20592
+ },
20593
+ "name": {
20594
+ "type": "string"
20595
+ },
20596
+ "path": {
20597
+ "type": "string"
20598
+ },
20599
+ "qualified_name": {
20600
+ "type": "string"
20601
+ },
20602
+ "range": {
20603
+ "properties": {
20604
+ "end_line": {
20605
+ "type": "integer"
20606
+ },
20607
+ "start_line": {
20608
+ "type": "integer"
20609
+ }
20610
+ },
20611
+ "type": "object"
20612
+ },
20613
+ "symbol_id": {
20614
+ "type": "string"
20615
+ }
20616
+ },
20617
+ "type": "object"
20618
+ },
20619
+ "type": "array"
20620
+ },
20621
+ "meta": {
20622
+ "properties": {
20623
+ "contract": {
20624
+ "enum": [
20625
+ "1.3"
20626
+ ],
20627
+ "type": "string"
20628
+ },
20629
+ "truncation": {
20630
+ "additionalProperties": true,
20631
+ "description": "Whether the answer was cut and how: the caps that applied, what was left out (e.g. `lists`, `depth_limited`, `items_without_text`, `candidates_dropped`) and, when a larger request would show more, the parameters to send next.",
20632
+ "properties": {
20633
+ "budget_tokens": {
20634
+ "type": "integer"
20635
+ },
20636
+ "candidates_dropped": {
20637
+ "type": "integer"
20638
+ },
20639
+ "definition_truncated": {
20640
+ "type": "boolean"
20641
+ },
20642
+ "depth": {
20643
+ "type": "integer"
20644
+ },
20645
+ "depth_limited": {
20646
+ "description": "Dependents not yet listed remain past the depth asked for",
20647
+ "type": "boolean"
20648
+ },
20649
+ "hint": {
20650
+ "type": "string"
20651
+ },
20652
+ "items_unavailable": {
20653
+ "description": "Items whose indexed content couldn't be read",
20654
+ "type": "integer"
20655
+ },
20656
+ "items_without_text": {
20657
+ "description": "Items the budget left as citations without text",
20658
+ "type": "integer"
20659
+ },
20660
+ "limit": {
20661
+ "type": "integer"
20662
+ },
20663
+ "limits": {
20664
+ "additionalProperties": {
20665
+ "type": "integer"
20666
+ },
20667
+ "type": "object"
20668
+ },
20669
+ "lists": {
20670
+ "description": "The answer's lists the caps cut",
20671
+ "items": {
20672
+ "type": "string"
20673
+ },
20674
+ "type": "array"
20675
+ },
20676
+ "next": {
20677
+ "additionalProperties": true,
20678
+ "description": "The request parameters to send for more: `limit`, `depth` or `budget_tokens`",
20679
+ "type": "object"
20680
+ },
20681
+ "references_cut": {
20682
+ "type": "boolean"
20683
+ },
20684
+ "seeds_dropped": {
20685
+ "type": "integer"
20686
+ },
20687
+ "truncated": {
20688
+ "type": "boolean"
20689
+ }
20690
+ },
20691
+ "required": [
20692
+ "truncated"
20693
+ ],
20694
+ "type": "object"
20695
+ },
20696
+ "view": {
20697
+ "properties": {
20698
+ "active": {
20699
+ "description": "The version queries answer from; null before the first is indexed",
20700
+ "nullable": true,
20701
+ "properties": {
20702
+ "base_commit": {
20703
+ "pattern": "^[0-9a-f]{40}$",
20704
+ "type": "string"
20705
+ },
20706
+ "indexed_at": {
20707
+ "format": "date-time",
20708
+ "type": "string"
20709
+ },
20710
+ "overlay_digest": {
20711
+ "type": "string"
20712
+ },
20713
+ "version": {
20714
+ "type": "integer"
20715
+ }
20716
+ },
20717
+ "type": "object"
20718
+ },
20719
+ "kind": {
20720
+ "description": "A CLI worktree's overlay, or the repository's default branch, kept by the server",
20721
+ "enum": [
20722
+ "worktree",
20723
+ "default_branch"
20724
+ ],
20725
+ "type": "string"
20726
+ },
20727
+ "last_sync_at": {
20728
+ "format": "date-time",
20729
+ "nullable": true,
20730
+ "type": "string"
20731
+ },
20732
+ "pending": {
20733
+ "description": "A later sync still queued, indexing or failed",
20734
+ "nullable": true,
20735
+ "properties": {
20736
+ "error": {
20737
+ "description": "Why indexing failed",
20738
+ "nullable": true,
20739
+ "properties": {
20740
+ "failures": {
20741
+ "description": "For a refresh, how many times it has failed",
20742
+ "type": "integer"
20743
+ },
20744
+ "files": {
20745
+ "description": "For `regressed`, how many files would lose their facts",
20746
+ "type": "integer"
20747
+ },
20748
+ "message": {
20749
+ "type": "string"
20750
+ },
20751
+ "reason": {
20752
+ "description": "`regressed`: a refresh that would leave files without the facts the active version has; the view keeps that version",
20753
+ "type": "string"
20754
+ },
20755
+ "retry_at": {
20756
+ "description": "For a refresh, when the server tries it again",
20757
+ "format": "date-time",
20758
+ "type": "string"
20759
+ }
20760
+ },
20761
+ "type": "object"
20762
+ },
20763
+ "progress": {
20764
+ "description": "Files processed so far (parsed or failed) of those the sync must parse, updated after each batch; null before indexing starts",
20765
+ "nullable": true,
20766
+ "properties": {
20767
+ "done": {
20768
+ "type": "integer"
20769
+ },
20770
+ "total": {
20771
+ "type": "integer"
20772
+ }
20773
+ },
20774
+ "type": "object"
20775
+ },
20776
+ "state": {
20777
+ "type": "string"
20778
+ },
20779
+ "version": {
20780
+ "type": "integer"
20781
+ }
20782
+ },
20783
+ "type": "object"
20784
+ },
20785
+ "repository_id": {
20786
+ "format": "uuid",
20787
+ "type": "string"
20788
+ },
20789
+ "view_id": {
20790
+ "format": "uuid",
20791
+ "type": "string"
20792
+ },
20793
+ "view_key": {
20794
+ "type": "string"
20795
+ }
20796
+ },
20797
+ "type": "object"
20798
+ }
20799
+ },
20800
+ "type": "object"
20801
+ }
20802
+ },
20803
+ "type": "object"
20804
+ }
20805
+ }
20806
+ },
20807
+ "description": "Success"
20808
+ },
20809
+ "400": {
20810
+ "description": "Bad request"
20811
+ },
20812
+ "401": {
20813
+ "description": "Missing or invalid token"
20814
+ },
20815
+ "403": {
20816
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
20817
+ },
20818
+ "404": {
20819
+ "description": "Not found"
20820
+ },
20821
+ "422": {
20822
+ "description": "Validation error"
20823
+ }
20824
+ },
20825
+ "summary": "Search a view's symbols",
20826
+ "tags": []
20827
+ }
20828
+ },
20829
+ "/api/v1/code/views/{view_id}/symbols/{symbol_id}": {
20830
+ "get": {
20831
+ "callbacks": {},
20832
+ "deprecated": false,
20833
+ "description": "Requires the `harness:read` scope. The symbol's definition, cut to the budget, and its references both ways, with how each one bound: `resolved`, `ambiguous` (ranked candidates) or `unresolved`. Callers are split into those bound to it, possible ones and name-only ones; a type or module also lists its members' callers. `meta.truncation` says whether the answer was cut, the cap that applied and, when a larger request would show more, the parameters to send next (`next`). `not_tracked` names the references the symbol's language doesn't record, so an empty list isn't read as none. A view with no indexed version yet answers 400.",
20834
+ "parameters": [
20835
+ {
20836
+ "description": "The view's id",
20837
+ "in": "path",
20838
+ "name": "view_id",
20839
+ "required": true,
20840
+ "schema": {
20841
+ "format": "uuid",
20842
+ "type": "string"
20843
+ }
20844
+ },
20845
+ {
20846
+ "description": "A symbol id from search, explain, affected or context; opaque, and stable across versions. A Swift id also names where its declaration starts, since overloads can share a name: once the declaration moves, it is not found and a new search gives its current id",
20847
+ "in": "path",
20848
+ "name": "symbol_id",
20849
+ "required": true,
20850
+ "schema": {
20851
+ "type": "string"
20852
+ }
20853
+ },
20854
+ {
20855
+ "description": "The definition snippet's token budget, up to 16,000 (default 4,000)",
20856
+ "in": "query",
20857
+ "name": "budget_tokens",
20858
+ "required": false,
20859
+ "schema": {
20860
+ "type": "integer"
20861
+ }
20862
+ }
20863
+ ],
20864
+ "responses": {
20865
+ "200": {
20866
+ "content": {
20867
+ "application/json": {
20868
+ "schema": {
20869
+ "properties": {
20870
+ "data": {
20871
+ "properties": {
20872
+ "definition": {
20873
+ "additionalProperties": true,
20874
+ "description": "A file and its line and byte span at the view's version",
20875
+ "properties": {
20876
+ "end_byte": {
20877
+ "type": "integer"
20878
+ },
20879
+ "end_line": {
20880
+ "type": "integer"
20881
+ },
20882
+ "path": {
20883
+ "type": "string"
20884
+ },
20885
+ "start_byte": {
20886
+ "type": "integer"
20887
+ },
20888
+ "start_line": {
20889
+ "type": "integer"
20890
+ },
20891
+ "truncated": {
20892
+ "description": "The snippet was cut to its budget",
20893
+ "type": "boolean"
20894
+ }
20895
+ },
20896
+ "type": "object"
20897
+ },
20898
+ "edges": {
20899
+ "properties": {
20900
+ "called_by": {
20901
+ "items": {
20902
+ "additionalProperties": true,
20903
+ "type": "object"
20904
+ },
20905
+ "type": "array"
20906
+ },
20907
+ "calls": {
20908
+ "items": {
20909
+ "additionalProperties": true,
20910
+ "type": "object"
20911
+ },
20912
+ "type": "array"
20913
+ },
20914
+ "member_callers": {
20915
+ "items": {
20916
+ "additionalProperties": true,
20917
+ "type": "object"
20918
+ },
20919
+ "type": "array"
20920
+ },
20921
+ "name_only_callers": {
20922
+ "items": {
20923
+ "additionalProperties": true,
20924
+ "type": "object"
20925
+ },
20926
+ "type": "array"
20927
+ },
20928
+ "possible_callers": {
20929
+ "items": {
20930
+ "additionalProperties": true,
20931
+ "type": "object"
20932
+ },
20933
+ "type": "array"
20934
+ },
20935
+ "references": {
20936
+ "items": {
20937
+ "additionalProperties": true,
20938
+ "type": "object"
20939
+ },
20940
+ "type": "array"
20941
+ }
20942
+ },
20943
+ "type": "object"
20944
+ },
20945
+ "not_tracked": {
20946
+ "description": "The references to the symbols asked about that their language doesn't record, in full or in part",
20947
+ "items": {
20948
+ "properties": {
20949
+ "language": {
20950
+ "type": "string"
20951
+ },
20952
+ "partial": {
20953
+ "type": "boolean"
20954
+ },
20955
+ "reason": {
20956
+ "type": "string"
20957
+ },
20958
+ "reference_kind": {
20959
+ "type": "string"
20960
+ }
20961
+ },
20962
+ "type": "object"
20963
+ },
20964
+ "type": "array"
20965
+ },
20966
+ "symbol": {
20967
+ "properties": {
20968
+ "at": {
20969
+ "additionalProperties": true,
20970
+ "description": "A file and its line and byte span at the view's version",
20971
+ "properties": {
20972
+ "end_byte": {
20973
+ "type": "integer"
20974
+ },
20975
+ "end_line": {
20976
+ "type": "integer"
20977
+ },
20978
+ "path": {
20979
+ "type": "string"
20980
+ },
20981
+ "start_byte": {
20982
+ "type": "integer"
20983
+ },
20984
+ "start_line": {
20985
+ "type": "integer"
20986
+ },
20987
+ "truncated": {
20988
+ "description": "The snippet was cut to its budget",
20989
+ "type": "boolean"
20990
+ }
20991
+ },
20992
+ "type": "object"
20993
+ },
20994
+ "kind": {
20995
+ "type": "string"
20996
+ },
20997
+ "language": {
20998
+ "type": "string"
20999
+ },
21000
+ "name": {
21001
+ "type": "string"
21002
+ },
21003
+ "path": {
21004
+ "type": "string"
21005
+ },
21006
+ "qualified_name": {
21007
+ "type": "string"
21008
+ },
21009
+ "range": {
21010
+ "properties": {
21011
+ "end_line": {
21012
+ "type": "integer"
21013
+ },
21014
+ "start_line": {
21015
+ "type": "integer"
21016
+ }
21017
+ },
21018
+ "type": "object"
21019
+ },
21020
+ "symbol_id": {
21021
+ "type": "string"
21022
+ }
21023
+ },
21024
+ "type": "object"
21025
+ },
21026
+ "unresolved": {
21027
+ "items": {
21028
+ "additionalProperties": true,
21029
+ "type": "object"
21030
+ },
21031
+ "type": "array"
21032
+ }
21033
+ },
21034
+ "type": "object"
21035
+ },
21036
+ "meta": {
21037
+ "properties": {
21038
+ "contract": {
21039
+ "enum": [
21040
+ "1.3"
21041
+ ],
21042
+ "type": "string"
21043
+ },
21044
+ "truncation": {
21045
+ "additionalProperties": true,
21046
+ "description": "Whether the answer was cut and how: the caps that applied, what was left out (e.g. `lists`, `depth_limited`, `items_without_text`, `candidates_dropped`) and, when a larger request would show more, the parameters to send next.",
21047
+ "properties": {
21048
+ "budget_tokens": {
21049
+ "type": "integer"
21050
+ },
21051
+ "candidates_dropped": {
21052
+ "type": "integer"
21053
+ },
21054
+ "definition_truncated": {
21055
+ "type": "boolean"
21056
+ },
21057
+ "depth": {
21058
+ "type": "integer"
21059
+ },
21060
+ "depth_limited": {
21061
+ "description": "Dependents not yet listed remain past the depth asked for",
21062
+ "type": "boolean"
21063
+ },
21064
+ "hint": {
21065
+ "type": "string"
21066
+ },
21067
+ "items_unavailable": {
21068
+ "description": "Items whose indexed content couldn't be read",
21069
+ "type": "integer"
21070
+ },
21071
+ "items_without_text": {
21072
+ "description": "Items the budget left as citations without text",
21073
+ "type": "integer"
21074
+ },
21075
+ "limit": {
21076
+ "type": "integer"
21077
+ },
21078
+ "limits": {
21079
+ "additionalProperties": {
21080
+ "type": "integer"
21081
+ },
21082
+ "type": "object"
21083
+ },
21084
+ "lists": {
21085
+ "description": "The answer's lists the caps cut",
21086
+ "items": {
21087
+ "type": "string"
21088
+ },
21089
+ "type": "array"
21090
+ },
21091
+ "next": {
21092
+ "additionalProperties": true,
21093
+ "description": "The request parameters to send for more: `limit`, `depth` or `budget_tokens`",
21094
+ "type": "object"
21095
+ },
21096
+ "references_cut": {
21097
+ "type": "boolean"
21098
+ },
21099
+ "seeds_dropped": {
21100
+ "type": "integer"
21101
+ },
21102
+ "truncated": {
21103
+ "type": "boolean"
21104
+ }
21105
+ },
21106
+ "required": [
21107
+ "truncated"
21108
+ ],
21109
+ "type": "object"
21110
+ },
21111
+ "view": {
21112
+ "properties": {
21113
+ "active": {
21114
+ "description": "The version queries answer from; null before the first is indexed",
21115
+ "nullable": true,
21116
+ "properties": {
21117
+ "base_commit": {
21118
+ "pattern": "^[0-9a-f]{40}$",
21119
+ "type": "string"
21120
+ },
21121
+ "indexed_at": {
21122
+ "format": "date-time",
21123
+ "type": "string"
21124
+ },
21125
+ "overlay_digest": {
21126
+ "type": "string"
21127
+ },
21128
+ "version": {
21129
+ "type": "integer"
21130
+ }
21131
+ },
21132
+ "type": "object"
21133
+ },
21134
+ "kind": {
21135
+ "description": "A CLI worktree's overlay, or the repository's default branch, kept by the server",
21136
+ "enum": [
21137
+ "worktree",
21138
+ "default_branch"
21139
+ ],
21140
+ "type": "string"
21141
+ },
21142
+ "last_sync_at": {
21143
+ "format": "date-time",
21144
+ "nullable": true,
21145
+ "type": "string"
21146
+ },
21147
+ "pending": {
21148
+ "description": "A later sync still queued, indexing or failed",
21149
+ "nullable": true,
21150
+ "properties": {
21151
+ "error": {
21152
+ "description": "Why indexing failed",
21153
+ "nullable": true,
21154
+ "properties": {
21155
+ "failures": {
21156
+ "description": "For a refresh, how many times it has failed",
21157
+ "type": "integer"
21158
+ },
21159
+ "files": {
21160
+ "description": "For `regressed`, how many files would lose their facts",
21161
+ "type": "integer"
21162
+ },
21163
+ "message": {
21164
+ "type": "string"
21165
+ },
21166
+ "reason": {
21167
+ "description": "`regressed`: a refresh that would leave files without the facts the active version has; the view keeps that version",
21168
+ "type": "string"
21169
+ },
21170
+ "retry_at": {
21171
+ "description": "For a refresh, when the server tries it again",
21172
+ "format": "date-time",
21173
+ "type": "string"
21174
+ }
21175
+ },
21176
+ "type": "object"
21177
+ },
21178
+ "progress": {
21179
+ "description": "Files processed so far (parsed or failed) of those the sync must parse, updated after each batch; null before indexing starts",
21180
+ "nullable": true,
21181
+ "properties": {
21182
+ "done": {
21183
+ "type": "integer"
21184
+ },
21185
+ "total": {
21186
+ "type": "integer"
21187
+ }
21188
+ },
21189
+ "type": "object"
21190
+ },
21191
+ "state": {
21192
+ "type": "string"
21193
+ },
21194
+ "version": {
21195
+ "type": "integer"
21196
+ }
21197
+ },
21198
+ "type": "object"
21199
+ },
21200
+ "repository_id": {
21201
+ "format": "uuid",
21202
+ "type": "string"
21203
+ },
21204
+ "view_id": {
21205
+ "format": "uuid",
21206
+ "type": "string"
21207
+ },
21208
+ "view_key": {
21209
+ "type": "string"
21210
+ }
21211
+ },
21212
+ "type": "object"
21213
+ }
21214
+ },
21215
+ "type": "object"
21216
+ }
21217
+ },
21218
+ "type": "object"
21219
+ }
21220
+ }
21221
+ },
21222
+ "description": "Success"
21223
+ },
21224
+ "400": {
21225
+ "description": "Bad request"
21226
+ },
21227
+ "401": {
21228
+ "description": "Missing or invalid token"
21229
+ },
21230
+ "403": {
21231
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
21232
+ },
21233
+ "404": {
21234
+ "description": "Not found"
21235
+ },
21236
+ "422": {
21237
+ "description": "Validation error"
21238
+ }
21239
+ },
21240
+ "summary": "Explain a symbol",
21241
+ "tags": []
21242
+ }
21243
+ },
21244
+ "/api/v1/code/views/{view_id}/syncs": {
21245
+ "post": {
21246
+ "callbacks": {},
21247
+ "deprecated": false,
21248
+ "description": "Requires the `harness:write` scope. Sends the view's overlay against a complete base: the whole overlay (`full`), or the changes to the active version (`delta`, which must name it as `parent_version`). Idempotent on `client_sync_id`: a retry answers with the same sync, whatever its state, and the blobs it still needs (none once activated). The request is not compared with the stored sync, so a `client_sync_id` names one exact manifest. A view holds at most 3 syncs receiving: opening another replaces any left unactivated for 10 minutes and, beyond that, the oldest. Activating a replaced sync answers 404 and its uploads 409 `unexpected_blob`; a retry with a replaced sync's id opens a new sync. A request carries at most 20,000 changes, and the resulting overlay holds at most 20,000 paths. Answers with the blobs still to upload; activate the sync once they have arrived. A JSON body may be sent gzip-compressed with `Content-Encoding: gzip`; the size limit applies to it inflated.",
21249
+ "parameters": [
21250
+ {
21251
+ "description": "The view's id",
21252
+ "in": "path",
21253
+ "name": "view_id",
21254
+ "required": true,
21255
+ "schema": {
21256
+ "format": "uuid",
21257
+ "type": "string"
21258
+ }
21259
+ }
21260
+ ],
21261
+ "requestBody": {
21262
+ "content": {
21263
+ "application/json": {
21264
+ "schema": {
21265
+ "additionalProperties": false,
21266
+ "properties": {
21267
+ "base_commit": {
21268
+ "pattern": "^[0-9a-f]{40}$",
21269
+ "type": "string"
21270
+ },
21271
+ "changes": {
21272
+ "items": {
21273
+ "additionalProperties": false,
21274
+ "properties": {
21275
+ "language": {
21276
+ "nullable": true,
21277
+ "type": "string"
21278
+ },
21279
+ "mode": {
21280
+ "description": "The git file mode",
21281
+ "enum": [
21282
+ "100644",
21283
+ "100755",
21284
+ "120000"
21285
+ ],
21286
+ "type": "string"
21287
+ },
21288
+ "op": {
21289
+ "default": "put",
21290
+ "enum": [
21291
+ "put",
21292
+ "delete"
21293
+ ],
21294
+ "type": "string"
21295
+ },
21296
+ "path": {
21297
+ "description": "Repository-relative path",
21298
+ "type": "string"
21299
+ },
21300
+ "renamed_from": {
21301
+ "nullable": true,
21302
+ "type": "string"
21303
+ },
21304
+ "sha256": {
21305
+ "pattern": "^[0-9a-f]{64}$",
21306
+ "type": "string"
21307
+ },
21308
+ "size": {
21309
+ "minimum": 0,
21310
+ "type": "integer"
21311
+ }
21312
+ },
21313
+ "required": [
21314
+ "path"
21315
+ ],
21316
+ "type": "object"
21317
+ },
21318
+ "type": "array"
21319
+ },
21320
+ "client_sync_id": {
21321
+ "description": "The client's id for this sync, for retries",
21322
+ "type": "string"
21323
+ },
21324
+ "mode": {
21325
+ "enum": [
21326
+ "full",
21327
+ "delta"
21328
+ ],
21329
+ "type": "string"
21330
+ },
21331
+ "parent_version": {
21332
+ "description": "The active version a `delta` applies to",
21333
+ "type": "integer"
21334
+ },
21335
+ "policy_digest": {
21336
+ "description": "The policy digest the client scanned under; a stale one is refused with 409 `stale_policy`",
21337
+ "type": "string"
21338
+ }
21339
+ },
21340
+ "required": [
21341
+ "client_sync_id",
21342
+ "base_commit",
21343
+ "mode"
21344
+ ],
21345
+ "type": "object"
21346
+ }
21347
+ }
21348
+ },
21349
+ "required": true
21350
+ },
21351
+ "responses": {
21352
+ "200": {
21353
+ "content": {
21354
+ "application/json": {
21355
+ "schema": {
21356
+ "properties": {
21357
+ "data": {
21358
+ "properties": {
21359
+ "missing": {
21360
+ "description": "The blobs still to upload",
21361
+ "items": {
21362
+ "pattern": "^[0-9a-f]{64}$",
21363
+ "type": "string"
21364
+ },
21365
+ "type": "array"
21366
+ },
21367
+ "rejected": {
21368
+ "description": "Malformed entries, e.g. `invalid_sha256`, `invalid_mode` or `invalid_op`",
21369
+ "items": {
21370
+ "properties": {
21371
+ "error": {
21372
+ "type": "string"
21373
+ },
21374
+ "path": {
21375
+ "type": "string"
21376
+ }
21377
+ },
21378
+ "type": "object"
21379
+ },
21380
+ "type": "array"
21381
+ },
21382
+ "state": {
21383
+ "type": "string"
21384
+ },
21385
+ "sync_id": {
21386
+ "format": "uuid",
21387
+ "type": "string"
21388
+ }
21389
+ },
21390
+ "type": "object"
21391
+ },
21392
+ "meta": {
21393
+ "properties": {
21394
+ "contract": {
21395
+ "enum": [
21396
+ "1.2"
21397
+ ],
21398
+ "type": "string"
21399
+ }
21400
+ },
21401
+ "type": "object"
21402
+ }
21403
+ },
21404
+ "type": "object"
21405
+ }
21406
+ }
21407
+ },
21408
+ "description": "Success"
21409
+ },
21410
+ "400": {
21411
+ "content": {
21412
+ "application/json": {
21413
+ "schema": {
21414
+ "properties": {
21415
+ "details": {
21416
+ "additionalProperties": true,
21417
+ "type": "object"
21418
+ },
21419
+ "error": {
21420
+ "type": "string"
21421
+ },
21422
+ "message": {
21423
+ "type": "string"
21424
+ },
21425
+ "request_id": {
21426
+ "nullable": true,
21427
+ "type": "string"
21428
+ }
21429
+ },
21430
+ "type": "object"
21431
+ }
21432
+ }
21433
+ },
21434
+ "description": "`invalid_sync`: a malformed sync, e.g. `base_commit` is not a full commit SHA, `parent_version` is not a non-negative integer, or more than 20,000 changes"
21435
+ },
21436
+ "401": {
21437
+ "description": "Missing or invalid token"
21438
+ },
21439
+ "403": {
21440
+ "content": {
21441
+ "application/json": {
21442
+ "schema": {
21443
+ "properties": {
21444
+ "details": {
21445
+ "additionalProperties": true,
21446
+ "type": "object"
21447
+ },
21448
+ "error": {
21449
+ "type": "string"
21450
+ },
21451
+ "message": {
21452
+ "type": "string"
21453
+ },
21454
+ "request_id": {
21455
+ "nullable": true,
21456
+ "type": "string"
21457
+ }
21458
+ },
21459
+ "type": "object"
21460
+ }
21461
+ }
21462
+ },
21463
+ "description": "`not_view_owner`: another member's view; sync your own `view_key`; `code_index_disabled` while the code index is off"
21464
+ },
21465
+ "404": {
21466
+ "description": "Not found"
21467
+ },
21468
+ "409": {
21469
+ "content": {
21470
+ "application/json": {
21471
+ "schema": {
21472
+ "properties": {
21473
+ "details": {
21474
+ "additionalProperties": true,
21475
+ "type": "object"
21476
+ },
21477
+ "error": {
21478
+ "type": "string"
21479
+ },
21480
+ "message": {
21481
+ "type": "string"
21482
+ },
21483
+ "request_id": {
21484
+ "nullable": true,
21485
+ "type": "string"
21486
+ }
21487
+ },
21488
+ "type": "object"
21489
+ }
21490
+ }
21491
+ },
21492
+ "description": "`stale_parent` (`details.active_version` is the version to delta against), `base_missing` (the base commit is not built yet; poll its status), `default_view` (the default-branch view is the server's) or `stale_policy`"
21493
+ },
21494
+ "413": {
21495
+ "content": {
21496
+ "application/json": {
21497
+ "schema": {
21498
+ "properties": {
21499
+ "details": {
21500
+ "additionalProperties": true,
21501
+ "type": "object"
21502
+ },
21503
+ "error": {
21504
+ "type": "string"
21505
+ },
21506
+ "message": {
21507
+ "type": "string"
21508
+ },
21509
+ "request_id": {
21510
+ "nullable": true,
21511
+ "type": "string"
21512
+ }
21513
+ },
21514
+ "type": "object"
21515
+ }
21516
+ }
21517
+ },
21518
+ "description": "The body exceeds the size limit (`payload_too_large`)"
21519
+ },
21520
+ "422": {
21521
+ "content": {
21522
+ "application/json": {
21523
+ "schema": {
21524
+ "properties": {
21525
+ "details": {
21526
+ "additionalProperties": true,
21527
+ "type": "object"
21528
+ },
21529
+ "error": {
21530
+ "type": "string"
21531
+ },
21532
+ "message": {
21533
+ "type": "string"
21534
+ },
21535
+ "request_id": {
21536
+ "nullable": true,
21537
+ "type": "string"
21538
+ }
21539
+ },
21540
+ "type": "object"
21541
+ }
21542
+ }
21543
+ },
21544
+ "description": "`overlay_too_large` (`details.limit`: the view's overlay would pass the path limit; sync against a newer base commit) or `repository_not_connected`"
21545
+ }
21546
+ },
21547
+ "summary": "Open a sync of a view",
21548
+ "tags": []
21549
+ }
21550
+ },
21551
+ "/api/v1/code/views/{view_id}/syncs/{sync_id}": {
21552
+ "get": {
21553
+ "callbacks": {},
21554
+ "deprecated": false,
21555
+ "description": "Requires the `harness:read` scope.",
21556
+ "parameters": [
21557
+ {
21558
+ "description": "The view's id",
21559
+ "in": "path",
21560
+ "name": "view_id",
21561
+ "required": true,
21562
+ "schema": {
21563
+ "format": "uuid",
21564
+ "type": "string"
21565
+ }
21566
+ },
21567
+ {
21568
+ "description": "The sync's id",
21569
+ "in": "path",
21570
+ "name": "sync_id",
21571
+ "required": true,
21572
+ "schema": {
21573
+ "format": "uuid",
21574
+ "type": "string"
21575
+ }
21576
+ }
21577
+ ],
21578
+ "responses": {
21579
+ "200": {
21580
+ "content": {
21581
+ "application/json": {
21582
+ "schema": {
21583
+ "properties": {
21584
+ "data": {
21585
+ "properties": {
21586
+ "error": {
21587
+ "description": "Why indexing failed",
21588
+ "nullable": true,
21589
+ "properties": {
21590
+ "failures": {
21591
+ "description": "For a refresh, how many times it has failed",
21592
+ "type": "integer"
21593
+ },
21594
+ "files": {
21595
+ "description": "For `regressed`, how many files would lose their facts",
21596
+ "type": "integer"
21597
+ },
21598
+ "message": {
21599
+ "type": "string"
21600
+ },
21601
+ "reason": {
21602
+ "description": "`regressed`: a refresh that would leave files without the facts the active version has; the view keeps that version",
21603
+ "type": "string"
21604
+ },
21605
+ "retry_at": {
21606
+ "description": "For a refresh, when the server tries it again",
21607
+ "format": "date-time",
21608
+ "type": "string"
21609
+ }
21610
+ },
21611
+ "type": "object"
21612
+ },
21613
+ "id": {
21614
+ "format": "uuid",
21615
+ "type": "string"
21616
+ },
21617
+ "mode": {
21618
+ "description": "`refresh`: the server re-indexing the view after an extractor change",
21619
+ "enum": [
21620
+ "full",
21621
+ "delta",
21622
+ "refresh"
21623
+ ],
21624
+ "type": "string"
21625
+ },
21626
+ "overlay_digest": {
21627
+ "type": "string"
21628
+ },
21629
+ "received_bytes": {
21630
+ "type": "integer"
21631
+ },
21632
+ "state": {
21633
+ "enum": [
21634
+ "receiving",
21635
+ "queued",
21636
+ "indexing",
21637
+ "active",
21638
+ "superseded",
21639
+ "failed"
21640
+ ],
21641
+ "type": "string"
21642
+ },
21643
+ "timings": {
21644
+ "additionalProperties": true,
21645
+ "type": "object"
21646
+ },
21647
+ "version": {
21648
+ "nullable": true,
21649
+ "type": "integer"
21650
+ }
21651
+ },
21652
+ "type": "object"
21653
+ },
21654
+ "meta": {
21655
+ "properties": {
21656
+ "contract": {
21657
+ "enum": [
21658
+ "1.2"
21659
+ ],
21660
+ "type": "string"
21661
+ }
21662
+ },
21663
+ "type": "object"
21664
+ }
21665
+ },
21666
+ "type": "object"
21667
+ }
21668
+ }
21669
+ },
21670
+ "description": "Success"
21671
+ },
21672
+ "400": {
21673
+ "description": "Bad request"
21674
+ },
21675
+ "401": {
21676
+ "description": "Missing or invalid token"
21677
+ },
21678
+ "403": {
21679
+ "description": "Token not permitted (org-scoped, non-admin, or missing scope); `code_index_disabled` while the code index is off"
21680
+ },
21681
+ "404": {
21682
+ "description": "Not found"
21683
+ },
21684
+ "422": {
21685
+ "description": "Validation error"
21686
+ }
21687
+ },
21688
+ "summary": "Get a sync",
21689
+ "tags": []
21690
+ }
21691
+ },
21692
+ "/api/v1/code/views/{view_id}/syncs/{sync_id}/activate": {
21693
+ "post": {
21694
+ "callbacks": {},
21695
+ "deprecated": false,
21696
+ "description": "Requires the `harness:write` scope. Queues a sync whose content has all arrived for indexing, as the view's next version; it becomes the active version once indexed, unless a later one has. Idempotent per sync: one already activated answers with its state and the version it was given once. A 404 means the view holds no such sync. A sync replaced while receiving was never activated, and an activated one is kept at least 60 minutes: as long as it is active, 24 hours while queued, indexing or failed, and 60 minutes once superseded. So a 404 on a retry within that time means the sync was replaced while receiving; later it can also mean retention swept it, so read the view's active version before syncing again.",
21697
+ "parameters": [
21698
+ {
21699
+ "description": "The view's id",
21700
+ "in": "path",
21701
+ "name": "view_id",
21702
+ "required": true,
21703
+ "schema": {
21704
+ "format": "uuid",
21705
+ "type": "string"
21706
+ }
21707
+ },
21708
+ {
21709
+ "description": "The sync's id",
21710
+ "in": "path",
21711
+ "name": "sync_id",
21712
+ "required": true,
21713
+ "schema": {
21714
+ "format": "uuid",
21715
+ "type": "string"
21716
+ }
21717
+ }
21718
+ ],
21719
+ "responses": {
21720
+ "200": {
21721
+ "description": "Success"
21722
+ },
21723
+ "202": {
21724
+ "content": {
21725
+ "application/json": {
21726
+ "schema": {
21727
+ "properties": {
21728
+ "data": {
21729
+ "properties": {
21730
+ "pending_version": {
21731
+ "type": "integer"
21732
+ },
21733
+ "state": {
21734
+ "type": "string"
21735
+ }
21736
+ },
21737
+ "type": "object"
21738
+ },
21739
+ "meta": {
21740
+ "properties": {
21741
+ "contract": {
21742
+ "enum": [
21743
+ "1.2"
21744
+ ],
21745
+ "type": "string"
21746
+ }
21747
+ },
21748
+ "type": "object"
21749
+ }
21750
+ },
21751
+ "type": "object"
21752
+ }
21753
+ }
21754
+ },
21755
+ "description": "Queued for indexing"
21756
+ },
21757
+ "400": {
21758
+ "description": "Bad request"
21759
+ },
21760
+ "401": {
21761
+ "description": "Missing or invalid token"
21762
+ },
21763
+ "403": {
21764
+ "content": {
21765
+ "application/json": {
21766
+ "schema": {
21767
+ "properties": {
21768
+ "details": {
21769
+ "additionalProperties": true,
21770
+ "type": "object"
21771
+ },
21772
+ "error": {
21773
+ "type": "string"
21774
+ },
21775
+ "message": {
21776
+ "type": "string"
21777
+ },
21778
+ "request_id": {
21779
+ "nullable": true,
21780
+ "type": "string"
21781
+ }
21782
+ },
21783
+ "type": "object"
21784
+ }
21785
+ }
21786
+ },
21787
+ "description": "`not_view_owner`: another member's view; sync your own `view_key`; `code_index_disabled` while the code index is off"
21788
+ },
21789
+ "404": {
21790
+ "description": "Not found"
21791
+ },
21792
+ "409": {
21793
+ "content": {
21794
+ "application/json": {
21795
+ "schema": {
21796
+ "properties": {
21797
+ "details": {
21798
+ "additionalProperties": true,
21799
+ "type": "object"
21800
+ },
21801
+ "error": {
21802
+ "type": "string"
21803
+ },
21804
+ "message": {
21805
+ "type": "string"
21806
+ },
21807
+ "request_id": {
21808
+ "nullable": true,
21809
+ "type": "string"
21810
+ }
21811
+ },
21812
+ "type": "object"
21813
+ }
21814
+ }
21815
+ },
21816
+ "description": "`missing_blobs`: `details.missing` names the blobs still to upload"
21817
+ },
21818
+ "422": {
21819
+ "description": "Validation error"
21820
+ }
21821
+ },
21822
+ "summary": "Activate a sync",
21823
+ "tags": []
21824
+ }
18414
21825
  }
18415
21826
  },
18416
21827
  "security": [