specguard-mcp 0.1.31 → 0.1.33
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 +43 -4
- package/dist/src/config.d.ts +3 -1
- package/dist/src/config.js +3 -1
- package/dist/src/config.js.map +1 -1
- package/dist/src/support/specguard-api.d.ts +25 -1
- package/dist/src/support/specguard-api.js +43 -2
- package/dist/src/support/specguard-api.js.map +1 -1
- package/dist/src/tools/get-intent-schema.d.ts +3 -0
- package/dist/src/tools/get-intent-schema.js +153 -0
- package/dist/src/tools/get-intent-schema.js.map +1 -0
- package/dist/src/tools/get-server-version.js +2 -2
- package/dist/src/tools/get-server-version.js.map +1 -1
- package/dist/src/tools/index.d.ts +31 -0
- package/dist/src/tools/index.js +33 -0
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/lint-intent-annotations.js +7 -2
- package/dist/src/tools/lint-intent-annotations.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ refuses to boot and takes the tools that needed no configuration down with it.
|
|
|
32
32
|
|
|
33
33
|
| Variable | Needed by | Default | What it is |
|
|
34
34
|
| --- | --- | --- | --- |
|
|
35
|
-
| `SPECGUARD_ENDPOINT` | `get_repository_overview`, `get_server_version`, `list_repositories`, `add_repository`, `registrable_repositories` | — | your SpecGuard instance's root URL, **including the scheme** — e.g. `https://specguard.example.com`, or `http://localhost:3000`. A value with no scheme is refused by name (`SPECGUARD_ENDPOINT is not a usable URL: "sg.example.com"`) rather than surfacing later as an opaque failure. `SPECGUARD_URL` is accepted as an alias, and is the name every message uses when it is the one you set. A blank value counts as unset, so leaving `SPECGUARD_ENDPOINT` empty in a templated config falls through to `SPECGUARD_URL` instead of suppressing it. `get_server_version`
|
|
35
|
+
| `SPECGUARD_ENDPOINT` | `get_repository_overview`, `get_intent_schema`, `get_server_version`, `list_repositories`, `add_repository`, `registrable_repositories` | — | your SpecGuard instance's root URL, **including the scheme** — e.g. `https://specguard.example.com`, or `http://localhost:3000`. A value with no scheme is refused by name (`SPECGUARD_ENDPOINT is not a usable URL: "sg.example.com"`) rather than surfacing later as an opaque failure. `SPECGUARD_URL` is accepted as an alias, and is the name every message uses when it is the one you set. A blank value counts as unset, so leaving `SPECGUARD_ENDPOINT` empty in a templated config falls through to `SPECGUARD_URL` instead of suppressing it. `get_server_version` and `get_intent_schema` need only this variable — they send no API key, because the routes they read are unauthenticated by design |
|
|
36
36
|
| `SPECGUARD_API_KEY` | `get_repository_overview`, `near_duplicate_clusters` (default calls) | — | an agent/CI API key (`sgk_…`) issued by that deployment — a **per-repository** key, which is the single repository those tools answer about by default |
|
|
37
37
|
| `SPECGUARD_USER_API_KEY` | `list_repositories` (fallback), `add_repository`, `registrable_repositories`, `remove_repository` (fallback), `create_repository_api_key` (fallback), `revoke_repository_api_key` (fallback), `list_repository_api_keys` (fallback), `list_repository_agent_keys` (fallback), `revoke_repository_agent_key` (fallback), `list_repository_agent_keys_presented_revoked` (fallback), `list_repository_members` (fallback), `add_repository_member` (fallback), `update_repository_member_permissions` (fallback), `remove_repository_member` (fallback), `get_repository_overview` / `near_duplicate_clusters` **with** `repository` (fallback), `rename_repository` | — | a **user** API key (`sgu_…`), minted from that deployment's account page. A different credential from the one above, not a second place to put the same value: SpecGuard decides which of them a request may use from the token's prefix, before it reads anything, and answers `401` for the other one. Set whichever your tools need — both, if you use both |
|
|
38
38
|
| `SPECGUARD_AGENT_API_KEY` | `list_repositories` (preferred), `remove_repository` (preferred), `create_repository_api_key` (preferred), `revoke_repository_api_key` (preferred), `list_repository_api_keys` (preferred), `list_repository_agent_keys` (preferred), `revoke_repository_agent_key` (preferred), `list_repository_agent_keys_presented_revoked` (preferred), `list_repository_members` (preferred), `add_repository_member` (preferred), `update_repository_member_permissions` (preferred), `remove_repository_member` (preferred), `get_repository_overview` / `near_duplicate_clusters` **with** `repository` (preferred) | — | an **agent** API key (`sga_…`), minted from that deployment's account page (Agent keys panel) with an explicit set of repositories and permissions. It speaks for nobody: its reach is exactly the set granted onto it, fixed at mint time, and every read is bounded by that set server-side. This is the credential to give an automated agent — one key, many repositories, none of a person's rights. When it and `SPECGUARD_USER_API_KEY` are both set, every tool that answers either key — `list_repositories`, `remove_repository`, the members tools, the key-lifecycle tools, and `get_repository_overview` / `near_duplicate_clusters` **with** `repository` — uses **this** one, so discovery stays inside the set the other tools can reach |
|
|
@@ -78,7 +78,7 @@ Validates the `@intent:` annotations in a Ruby project's spec files against the
|
|
|
78
78
|
| --- | --- |
|
|
79
79
|
| `project_dir` | the project to lint; defaults to the server's working directory. A path that does not exist, or is not a directory, is refused by name — never reported as a missing linter |
|
|
80
80
|
| `paths` | specific spec files, relative to `project_dir`; omit to check all of them. An empty list is an error rather than a synonym for "everything", because a run that selected nothing must not come back clean |
|
|
81
|
-
| `changed` | check what the branch changed since the merge base with the default branch — CI's mode; untracked spec files count too (no `git add` needed)
|
|
81
|
+
| `changed` | check what the branch changed since the merge base with the default branch — CI's mode; untracked spec files count too (no `git add` needed); `--exclude-standard` keeps `.gitignore`d paths out of the untracked leg alone, and a tracked file is never subject to `.gitignore`, so the dependency/build directory fence holds ignored tracked paths out |
|
|
82
82
|
| `base` | diff `changed` against this ref instead |
|
|
83
83
|
|
|
84
84
|
Needs no SpecGuard deployment and no API key. A **missing** annotation is never a failure: adoption
|
|
@@ -90,6 +90,45 @@ tool call carrying findings — an agent told "the tool failed" retries the tool
|
|
|
90
90
|
a finding fixes the annotation. Only exit `2` is a tool error, and it carries the linter's stderr,
|
|
91
91
|
because the gem deliberately emits no document on that path.
|
|
92
92
|
|
|
93
|
+
### `get_intent_schema`
|
|
94
|
+
|
|
95
|
+
Serves the **OpenTestIntent schema document itself** — the contract an `@intent:` annotation is
|
|
96
|
+
validated against — read live from the deployment's own unauthenticated root-level schema mirror,
|
|
97
|
+
which hands back the canonical document's bytes verbatim.
|
|
98
|
+
|
|
99
|
+
Call it **before** writing or editing an annotation. This is the *reference*; `lint_intent_annotations`
|
|
100
|
+
is the *judge*, and a judge can only tell you that something you already wrote is wrong.
|
|
101
|
+
|
|
102
|
+
**Reading the contract is the only way to learn parts of it.** A refusal names the legal values of a
|
|
103
|
+
field you got *wrong*, and says nothing at all about a field you *omitted* — so the fastest way to
|
|
104
|
+
learn the rules from refusals alone is to submit values you believe are invalid. And an **optional**
|
|
105
|
+
property can never appear in any refusal: `required` does not name it, and a closed-object check
|
|
106
|
+
only ever reports the key you did send, so nothing you submit at any value causes the linter to
|
|
107
|
+
mention it. That part of the contract is reachable here and nowhere else in this toolset.
|
|
108
|
+
|
|
109
|
+
The answer carries the whole document in **both shapes, derived from one fetched body** so they
|
|
110
|
+
cannot disagree:
|
|
111
|
+
|
|
112
|
+
| field | |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| `structured` | the document **parsed** — the shape to read the field rules and any enumerated values off |
|
|
115
|
+
| `text` | the served bytes **unchanged** — no re-encoding, no reformatting, so a digest taken over this text matches the canonical document's, which is the mirror's whole promise |
|
|
116
|
+
|
|
117
|
+
Nothing in this bridge restates the schema's contents — not here, not in a tool description, not in
|
|
118
|
+
a test. The answer *is* the contract; any prose copy of it would be one release behind the document
|
|
119
|
+
this tool serves, and this repo deliberately vendors no copy of its own.
|
|
120
|
+
|
|
121
|
+
**A 404 means the deployment predates the mirror route: the endpoint is right and the build is old.**
|
|
122
|
+
The error text names the endpoint as possibly misconfigured, because a non-contract 404 body names
|
|
123
|
+
no cause — when the other tools work against the same endpoint, read it as *"the deployment needs
|
|
124
|
+
upgrading"*, not as a wrong URL. A **2xx** whose body will not parse is reported as a malformed
|
|
125
|
+
mirror instead, naming the route rather than your configuration: the response arrived, so the
|
|
126
|
+
endpoint is not the thing to go and fix.
|
|
127
|
+
|
|
128
|
+
**Needs no API key of any kind** — the route is unauthenticated by design, because a contract is not
|
|
129
|
+
a secret — so it works with `SPECGUARD_ENDPOINT` alone and sends no `Authorization` header. Takes no
|
|
130
|
+
arguments.
|
|
131
|
+
|
|
93
132
|
### `get_repository_overview`
|
|
94
133
|
|
|
95
134
|
Asks SpecGuard what a repository's suite looks like **without running it** — the cold-start question
|
|
@@ -411,8 +450,8 @@ cause — when the other tools work against the same endpoint, read that error a
|
|
|
411
450
|
needs upgrading"*, not as a wrong URL.
|
|
412
451
|
|
|
413
452
|
**Needs no API key of any kind** — the route is unauthenticated by design — so it works with
|
|
414
|
-
`SPECGUARD_ENDPOINT` alone, and it
|
|
415
|
-
no arguments.
|
|
453
|
+
`SPECGUARD_ENDPOINT` alone, and it sends no `Authorization` header (as does `get_intent_schema`, the
|
|
454
|
+
other credential-free read here). Takes no arguments.
|
|
416
455
|
|
|
417
456
|
### `list_repositories`
|
|
418
457
|
|
package/dist/src/config.d.ts
CHANGED
|
@@ -322,7 +322,9 @@ export declare function requireUserOrAgentApiConfig(config: Config): Credentiall
|
|
|
322
322
|
* `Credential`: the server's root-level `GET /version` (SPGD-1197, specguard
|
|
323
323
|
* 08ab408) answers unauthenticated BY DESIGN — the platform's own doctrine
|
|
324
324
|
* places it outside the credential seam, at the root where the no-account
|
|
325
|
-
* reads (`/up`, the schema mirror) already live.
|
|
325
|
+
* reads (`/up`, the schema mirror) already live. SPGD-1331 made it serve a
|
|
326
|
+
* second such ask: the schema mirror named there is now wrapped too
|
|
327
|
+
* (`get_intent_schema`), through this same helper. Demanding a key here would
|
|
326
328
|
* invent a requirement the deployment does not have, and the
|
|
327
329
|
* credential-free config this returns is what keeps the transport from
|
|
328
330
|
* sending an `Authorization` header at all.
|
package/dist/src/config.js
CHANGED
|
@@ -190,7 +190,9 @@ export function requireUserOrAgentApiConfig(config) {
|
|
|
190
190
|
* `Credential`: the server's root-level `GET /version` (SPGD-1197, specguard
|
|
191
191
|
* 08ab408) answers unauthenticated BY DESIGN — the platform's own doctrine
|
|
192
192
|
* places it outside the credential seam, at the root where the no-account
|
|
193
|
-
* reads (`/up`, the schema mirror) already live.
|
|
193
|
+
* reads (`/up`, the schema mirror) already live. SPGD-1331 made it serve a
|
|
194
|
+
* second such ask: the schema mirror named there is now wrapped too
|
|
195
|
+
* (`get_intent_schema`), through this same helper. Demanding a key here would
|
|
194
196
|
* invent a requirement the deployment does not have, and the
|
|
195
197
|
* credential-free config this returns is what keeps the transport from
|
|
196
198
|
* sending an `Authorization` header at all.
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA4G1C,MAAM,CAAC,MAAM,oBAAoB,GAAsB,CAAC,gBAAgB,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,MAAyB,OAAO,CAAC,GAAG;IAC7D,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC5D,6EAA6E;IAC7E,qEAAqE;IACrE,4EAA4E;IAC5E,8EAA8E;IAC9E,0EAA0E;IAC1E,6EAA6E;IAC7E,8EAA8E;IAC9E,8EAA8E;IAC9E,6EAA6E;IAC7E,mEAAmE;IACnE,8EAA8E;IAC9E,MAAM,gBAAgB,GACpB,QAAQ,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,KAAK,SAAS;QAC/C,CAAC,CAAC,oBAAoB;QACtB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,KAAK,SAAS;YAC5C,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,SAAS,CAAC;IAElB,OAAO;QACL,QAAQ,EAAE,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC/F,gBAAgB;QAChB,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;Q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KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAEnC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,KAA4B,CAAC;IACjC,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,IAAI,KAAK,KAAK;gBAAE,KAAK,GAAG,SAAS,CAAC;;gBACjC,OAAO,IAAI,IAAI,CAAC;YACrB,SAAS;QACX,CAAC;QAED,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjC,KAAK,GAAG,IAAI,CAAC;YACb,OAAO,GAAG,IAAI,CAAC;YACf,SAAS;QACX,CAAC;QAED,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,IAAI,OAAO;gBAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,GAAG,KAAK,CAAC;YAChB,SAAS;QACX,CAAC;QAED,OAAO,IAAI,IAAI,CAAC;QAChB,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IAED,IAAI,OAAO;QAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAElC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -9,10 +9,34 @@ import { requireAgentApiConfig, requireApiConfig, requireEndpointApiConfig, requ
|
|
|
9
9
|
*
|
|
10
10
|
* The key is PRESENT-CONDITIONAL since SPGD-1200: every credentialled helper
|
|
11
11
|
* binds one and it rides every request as before, while a credential-free ask
|
|
12
|
-
* (`requireEndpointApiConfig
|
|
12
|
+
* (`requireEndpointApiConfig` — the unauthenticated `/version`, and since
|
|
13
|
+
* SPGD-1331 the schema mirror beside it) presents NO
|
|
13
14
|
* `Authorization` header at all rather than `Bearer ` with nothing after it.
|
|
14
15
|
*/
|
|
15
16
|
export declare function getJson(api: ApiConfig, path: string, query: Record<string, string | undefined>, fetchImpl: typeof globalThis.fetch): Promise<unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* `GET` that hands back the RAW BODY TEXT — the read half of `deleteJson`'s
|
|
19
|
+
* argument, for a route whose bytes are the answer.
|
|
20
|
+
*
|
|
21
|
+
* `requestJson` JSON-parses every 2xx it sees and, when that parse fails,
|
|
22
|
+
* throws a sentence telling the operator to check that the endpoint points at
|
|
23
|
+
* a SpecGuard deployment "and not, say, a proxy or login page". That is the
|
|
24
|
+
* right diagnosis for a body that should have been JSON and was not; it is the
|
|
25
|
+
* WRONG one for a caller whose contract is the bytes themselves, because it
|
|
26
|
+
* names a cause (misconfigured endpoint) that the correct response in hand
|
|
27
|
+
* refutes. `deleteJson` already carries this shape for its own reason — its
|
|
28
|
+
* `204` has no body at all — and the argument generalises: what a SUCCESS body
|
|
29
|
+
* is for differs per caller, while the status check and the "reached and
|
|
30
|
+
* refused" hand-off to `describeFailure` do not.
|
|
31
|
+
*
|
|
32
|
+
* So this shares `fetchWithTimeout` and `describeFailure` VERBATIM — the one
|
|
33
|
+
* total deadline, the abort, the reached-and-stopped vs could-not-reach split,
|
|
34
|
+
* and every crafted status sentence — and differs from `getJson` in exactly
|
|
35
|
+
* one thing: it returns what came back instead of what it parsed. A caller
|
|
36
|
+
* that wants a parsed value parses it, and owns the diagnosis for its own
|
|
37
|
+
* body, which is the only place that diagnosis can be correct.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getText(api: ApiConfig, path: string, fetchImpl: typeof globalThis.fetch): Promise<string>;
|
|
16
40
|
/**
|
|
17
41
|
* `POST` with a JSON body — the write half of the transport, and deliberately
|
|
18
42
|
* the SAME function underneath.
|
|
@@ -10,7 +10,8 @@ import { ApiError } from "../errors.js";
|
|
|
10
10
|
*
|
|
11
11
|
* The key is PRESENT-CONDITIONAL since SPGD-1200: every credentialled helper
|
|
12
12
|
* binds one and it rides every request as before, while a credential-free ask
|
|
13
|
-
* (`requireEndpointApiConfig
|
|
13
|
+
* (`requireEndpointApiConfig` — the unauthenticated `/version`, and since
|
|
14
|
+
* SPGD-1331 the schema mirror beside it) presents NO
|
|
14
15
|
* `Authorization` header at all rather than `Bearer ` with nothing after it.
|
|
15
16
|
*/
|
|
16
17
|
export async function getJson(api, path, query, fetchImpl) {
|
|
@@ -21,6 +22,34 @@ export async function getJson(api, path, query, fetchImpl) {
|
|
|
21
22
|
}
|
|
22
23
|
return requestJson(url, api, fetchImpl, { method: "GET" });
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* `GET` that hands back the RAW BODY TEXT — the read half of `deleteJson`'s
|
|
27
|
+
* argument, for a route whose bytes are the answer.
|
|
28
|
+
*
|
|
29
|
+
* `requestJson` JSON-parses every 2xx it sees and, when that parse fails,
|
|
30
|
+
* throws a sentence telling the operator to check that the endpoint points at
|
|
31
|
+
* a SpecGuard deployment "and not, say, a proxy or login page". That is the
|
|
32
|
+
* right diagnosis for a body that should have been JSON and was not; it is the
|
|
33
|
+
* WRONG one for a caller whose contract is the bytes themselves, because it
|
|
34
|
+
* names a cause (misconfigured endpoint) that the correct response in hand
|
|
35
|
+
* refutes. `deleteJson` already carries this shape for its own reason — its
|
|
36
|
+
* `204` has no body at all — and the argument generalises: what a SUCCESS body
|
|
37
|
+
* is for differs per caller, while the status check and the "reached and
|
|
38
|
+
* refused" hand-off to `describeFailure` do not.
|
|
39
|
+
*
|
|
40
|
+
* So this shares `fetchWithTimeout` and `describeFailure` VERBATIM — the one
|
|
41
|
+
* total deadline, the abort, the reached-and-stopped vs could-not-reach split,
|
|
42
|
+
* and every crafted status sentence — and differs from `getJson` in exactly
|
|
43
|
+
* one thing: it returns what came back instead of what it parsed. A caller
|
|
44
|
+
* that wants a parsed value parses it, and owns the diagnosis for its own
|
|
45
|
+
* body, which is the only place that diagnosis can be correct.
|
|
46
|
+
*/
|
|
47
|
+
export async function getText(api, path, fetchImpl) {
|
|
48
|
+
const { response, body } = await fetchWithTimeout(new URL(`${api.endpoint}${path}`), api, fetchImpl, { method: "GET" });
|
|
49
|
+
if (!response.ok)
|
|
50
|
+
throw describeFailure(response.status, body, api);
|
|
51
|
+
return body;
|
|
52
|
+
}
|
|
24
53
|
/**
|
|
25
54
|
* `POST` with a JSON body — the write half of the transport, and deliberately
|
|
26
55
|
* the SAME function underneath.
|
|
@@ -266,7 +295,19 @@ async function fetchWithTimeout(url, api, fetchImpl, request) {
|
|
|
266
295
|
fetchImpl(url, {
|
|
267
296
|
method: request.method,
|
|
268
297
|
headers: {
|
|
269
|
-
|
|
298
|
+
// What this bridge will accept, and every media type the deployment
|
|
299
|
+
// actually serves it — the header is a CLAIM, so it must not exclude
|
|
300
|
+
// a route this client calls. SpecGuard's own doctrine puts one read
|
|
301
|
+
// outside the JSON surface: the schema mirror answers
|
|
302
|
+
// `application/schema+json`, the media type draft-07 registers for a
|
|
303
|
+
// schema document, and it is served by a `render plain:` with an
|
|
304
|
+
// explicit content type, which does not negotiate. So the narrower
|
|
305
|
+
// header happened to work — the request succeeded while announcing
|
|
306
|
+
// it would not accept what came back. Widened rather than made
|
|
307
|
+
// per-call: the `Accept` of this transport is a property of the
|
|
308
|
+
// client, not of an individual call, which is the same argument
|
|
309
|
+
// `RequestSpec` makes for staying narrow.
|
|
310
|
+
Accept: "application/json, application/schema+json",
|
|
270
311
|
// The version rides the identity the platform's rejection triage
|
|
271
312
|
// stores verbatim (`specguard-mcp/<version>`), the same shape the
|
|
272
313
|
// sibling clients already send. Resolved per request — see
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specguard-api.js","sourceRoot":"","sources":["../../../src/support/specguard-api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,2BAA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IAClC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAE3E,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,UAA8B;IAE9B,MAAM,GAAG,GACP,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC;QAC1B,CAAC,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,IAAI,GACR,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,oBAAoB;QACtB,CAAC,CAAC,wBAAwB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;IAC/D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC;AAED,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,GACzB,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { ApiError } from "../errors.js";
|
|
2
|
+
import { getText, requireEndpointApiConfig } from "../support/specguard-api.js";
|
|
3
|
+
/**
|
|
4
|
+
* The OpenTestIntent contract, READABLE — the reference this bridge was
|
|
5
|
+
* missing beside the judge it already had.
|
|
6
|
+
*
|
|
7
|
+
* == The gap this closes, and why refusals could not close it
|
|
8
|
+
*
|
|
9
|
+
* SpecGuard is structurally gated on `@intent:` annotations existing, and the
|
|
10
|
+
* only thing this bridge could say about one until now was whether an
|
|
11
|
+
* annotation the agent HAD ALREADY WRITTEN was wrong. `lint_intent_annotations`
|
|
12
|
+
* is a judge, not a reference: an agent authoring a new annotation had to
|
|
13
|
+
* guess, write the guess to a file, lint it, and read the refusal.
|
|
14
|
+
*
|
|
15
|
+
* Refusals are an INCOMPLETE teacher, and the sharpest asymmetry is that a
|
|
16
|
+
* WRONG enumerated value names the legal set in its error while an ABSENT one
|
|
17
|
+
* does not — so the fastest way to learn the contract through a judge is to
|
|
18
|
+
* submit a value you believe is invalid, which is a perverse thing for a
|
|
19
|
+
* toolset to reward. Worse, the schema declares an OPTIONAL property, and an
|
|
20
|
+
* optional property is underivable in principle from that surface: `required`
|
|
21
|
+
* never names it, and a closed-object refusal only ever reports the key you
|
|
22
|
+
* DID send. No input to the linter at any value causes it to be mentioned.
|
|
23
|
+
* That is the hole this tool exists to fill, and it is why this is a read of
|
|
24
|
+
* the contract rather than a nicer error message on the judge.
|
|
25
|
+
*
|
|
26
|
+
* == It MIRRORS; it does not carry a copy
|
|
27
|
+
*
|
|
28
|
+
* The bytes come from the deployment's own root-level, unauthenticated schema
|
|
29
|
+
* mirror — `SchemasController`, which renders the vendored document verbatim
|
|
30
|
+
* with an explicit `application/schema+json` content type and whose request
|
|
31
|
+
* spec pins the response to the file's bytes by digest. Vendoring the schema
|
|
32
|
+
* into this repo instead would mint a THIRD copy of a document whose entire
|
|
33
|
+
* design is one canonical source plus byte-identical mirrors, and it would
|
|
34
|
+
* drift silently — a bridge that answers from its own copy answers about
|
|
35
|
+
* itself, not about the deployment the agent is being judged by.
|
|
36
|
+
*
|
|
37
|
+
* For the same reason the contract's contents are not transcribed into this
|
|
38
|
+
* file's description, the README, or a test name. A second copy of a field
|
|
39
|
+
* list is one release behind the schema by construction. The tool is
|
|
40
|
+
* cross-referenced by name from elsewhere; its ANSWER is where the fields
|
|
41
|
+
* live.
|
|
42
|
+
*
|
|
43
|
+
* == Why the body is fetched raw, and why both shapes come off one value
|
|
44
|
+
*
|
|
45
|
+
* `getText` rather than `getJsonObject`, and the reason is a diagnosis rather
|
|
46
|
+
* than a preference: `requestJson`'s not-JSON sentence tells the operator to
|
|
47
|
+
* check that the endpoint points at a SpecGuard deployment "and not, say, a
|
|
48
|
+
* proxy or login page" — the wrong remedy for a response that arrived
|
|
49
|
+
* perfectly correctly and simply is not what that helper assumed. So this
|
|
50
|
+
* shares the deadline and the failure diagnosis and owns its own success
|
|
51
|
+
* handling, exactly as `deleteJson` does for its empty `204`.
|
|
52
|
+
*
|
|
53
|
+
* The verbatim body is then served as the text view and PARSED ONCE for the
|
|
54
|
+
* structured view, both derived from the one fetched value as
|
|
55
|
+
* `tools/types.ts` requires. The text half is what keeps the mirror's promise
|
|
56
|
+
* intact across this bridge: a consumer digesting what it received gets the
|
|
57
|
+
* same digest the platform's own spec asserts, which a re-encode or a
|
|
58
|
+
* pretty-print would destroy. The structured half is the shape an agent
|
|
59
|
+
* actually reads a contract from — and `application/schema+json` carries the
|
|
60
|
+
* `+json` structured-syntax suffix precisely so a client dispatching on "is
|
|
61
|
+
* this JSON" still parses it.
|
|
62
|
+
*
|
|
63
|
+
* A 2xx body that will not parse is a genuinely malformed mirror and is
|
|
64
|
+
* reported as THAT, naming the route rather than the endpoint variable: the
|
|
65
|
+
* response arrived, so the configuration is not the thing to go and fix.
|
|
66
|
+
*
|
|
67
|
+
* == No arguments, no credential
|
|
68
|
+
*
|
|
69
|
+
* The route takes no parameters and authenticates nothing, so the tool
|
|
70
|
+
* advertises no argument and binds no key — the second consumer of
|
|
71
|
+
* `requireEndpointApiConfig` after `get_server_version`, sending no
|
|
72
|
+
* `Authorization` header even when every key variable is set. A contract is
|
|
73
|
+
* not a secret, and presenting a key an endpoint does not read is not
|
|
74
|
+
* authentication, it is leakage.
|
|
75
|
+
*/
|
|
76
|
+
const SCHEMA_PATH = "/schemas/open-test-intent.v1.json";
|
|
77
|
+
const getIntentSchema = {
|
|
78
|
+
name: "get_intent_schema",
|
|
79
|
+
title: "OpenTestIntent schema",
|
|
80
|
+
description: "Serves the OpenTestIntent schema document itself — the CONTRACT an `@intent:` annotation is " +
|
|
81
|
+
"validated against — read live from the SpecGuard deployment's own unauthenticated root-level " +
|
|
82
|
+
"schema mirror, which serves the canonical document's bytes verbatim. Call this BEFORE writing " +
|
|
83
|
+
"or editing an annotation: it is the reference, while lint_intent_annotations is the judge, and " +
|
|
84
|
+
"a judge can only tell you that something you already wrote is wrong. Reading the contract is " +
|
|
85
|
+
"also the ONLY way to learn parts of it: a refusal names the legal values of a field you got " +
|
|
86
|
+
"wrong but says nothing about a field you omitted, and an OPTIONAL property can never appear in " +
|
|
87
|
+
"any refusal at all — nothing you submit, at any value, causes the linter to mention it. The " +
|
|
88
|
+
"answer carries the whole document in both shapes, derived from one fetched body so they cannot " +
|
|
89
|
+
"disagree: `structured` is it parsed, which is what to read the field rules and any enumerated " +
|
|
90
|
+
"values off; `text` is the served bytes UNCHANGED, so a digest taken over it matches the " +
|
|
91
|
+
"canonical document's. Nothing here restates the schema's contents — the answer is the contract, " +
|
|
92
|
+
"and any prose copy of it would be one release behind. A 404 means this deployment PREDATES the " +
|
|
93
|
+
"mirror route: the endpoint is right and the build is old. The error text names the endpoint as " +
|
|
94
|
+
"possibly misconfigured because a non-contract 404 body names no cause — when the other tools " +
|
|
95
|
+
"work against the same endpoint, read it as 'the deployment needs upgrading', not as a wrong " +
|
|
96
|
+
"URL. Needs NO API key of any kind — the route is unauthenticated by design, because a contract " +
|
|
97
|
+
"is not a secret — so it works with SPECGUARD_ENDPOINT alone and sends no Authorization header. " +
|
|
98
|
+
"Takes no arguments.",
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: "object",
|
|
101
|
+
// No properties, deliberately — a document has no ask to narrow. Still
|
|
102
|
+
// CLOSED rather than merely empty, for the reason `get-server-version.ts`
|
|
103
|
+
// states: `server.ts` forwards `arguments` unvalidated and `run` ignores
|
|
104
|
+
// them, so an open schema would let an invented argument be silently
|
|
105
|
+
// dropped while the call is answered as if it had been honoured.
|
|
106
|
+
additionalProperties: false,
|
|
107
|
+
},
|
|
108
|
+
async run(_args, context) {
|
|
109
|
+
const api = requireEndpointApiConfig(context.config);
|
|
110
|
+
const document = await getText(api, SCHEMA_PATH, context.fetch);
|
|
111
|
+
return {
|
|
112
|
+
// The served bytes, unchanged — see this file's header. Both views come
|
|
113
|
+
// off this ONE value.
|
|
114
|
+
text: document,
|
|
115
|
+
structured: parseSchemaDocument(document, api.endpoint),
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* The parse, with the diagnosis this route actually needs.
|
|
121
|
+
*
|
|
122
|
+
* Deliberately NOT `requestJson`'s: its sentence sends the operator to check
|
|
123
|
+
* `SPECGUARD_ENDPOINT` for pointing at a proxy or a login page, and a 200 from
|
|
124
|
+
* the schema route is evidence AGAINST that reading — the deployment answered,
|
|
125
|
+
* on the path, with a status that says it meant to. What is wrong is the
|
|
126
|
+
* document, so the message says the document, and names the route so the
|
|
127
|
+
* report has somewhere to go.
|
|
128
|
+
*
|
|
129
|
+
* The object narrowing is part of the same answer rather than a second failure
|
|
130
|
+
* mode bolted beside it: `ToolResult.structured` is a `Record<string, unknown>`,
|
|
131
|
+
* a schema document's root is a JSON object, and a mirror serving an array or a
|
|
132
|
+
* bare scalar is malformed in exactly the way this sentence describes.
|
|
133
|
+
*/
|
|
134
|
+
function parseSchemaDocument(body, endpoint) {
|
|
135
|
+
let parsed;
|
|
136
|
+
try {
|
|
137
|
+
parsed = JSON.parse(body);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
throw new ApiError(`${endpoint}${SCHEMA_PATH} answered successfully but the document it served is not valid ` +
|
|
141
|
+
"JSON. The route was reached and answered, so this is a malformed schema mirror on the " +
|
|
142
|
+
"deployment rather than a configuration problem on this side.");
|
|
143
|
+
}
|
|
144
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
145
|
+
throw new ApiError(`${endpoint}${SCHEMA_PATH} answered successfully but the document it served is not a JSON ` +
|
|
146
|
+
"object, which a schema document's root must be. The route was reached and answered, so " +
|
|
147
|
+
"this is a malformed schema mirror on the deployment rather than a configuration problem " +
|
|
148
|
+
"on this side.");
|
|
149
|
+
}
|
|
150
|
+
return parsed;
|
|
151
|
+
}
|
|
152
|
+
export default getIntentSchema;
|
|
153
|
+
//# sourceMappingURL=get-intent-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-intent-schema.js","sourceRoot":"","sources":["../../../src/tools/get-intent-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAExD,MAAM,eAAe,GAAmB;IACtC,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,8FAA8F;QAC9F,+FAA+F;QAC/F,gGAAgG;QAChG,iGAAiG;QACjG,+FAA+F;QAC/F,8FAA8F;QAC9F,iGAAiG;QACjG,8FAA8F;QAC9F,iGAAiG;QACjG,gGAAgG;QAChG,0FAA0F;QAC1F,kGAAkG;QAClG,iGAAiG;QACjG,iGAAiG;QACjG,+FAA+F;QAC/F,8FAA8F;QAC9F,iGAAiG;QACjG,iGAAiG;QACjG,qBAAqB;IACvB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,uEAAuE;QACvE,0EAA0E;QAC1E,yEAAyE;QACzE,qEAAqE;QACrE,iEAAiE;QACjE,oBAAoB,EAAE,KAAK;KAC5B;IAED,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO;QACtB,MAAM,GAAG,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAErD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAEhE,OAAO;YACL,wEAAwE;YACxE,sBAAsB;YACtB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,mBAAmB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC;SACxD,CAAC;IACJ,CAAC;CACF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,SAAS,mBAAmB,CAAC,IAAY,EAAE,QAAgB;IACzD,IAAI,MAAe,CAAC;IAEpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,QAAQ,CAChB,GAAG,QAAQ,GAAG,WAAW,iEAAiE;YACxF,wFAAwF;YACxF,8DAA8D,CACjE,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,QAAQ,CAChB,GAAG,QAAQ,GAAG,WAAW,kEAAkE;YACzF,yFAAyF;YACzF,0FAA0F;YAC1F,eAAe,CAClB,CAAC;IACJ,CAAC;IAED,OAAO,MAAiC,CAAC;AAC3C,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -65,8 +65,8 @@ const getServerVersion = {
|
|
|
65
65
|
"names the endpoint as possibly misconfigured because a non-contract 404 body names no cause — " +
|
|
66
66
|
"when the other tools work against the same endpoint, read that error as 'the deployment needs " +
|
|
67
67
|
"upgrading', not as a wrong URL. Needs NO API key of any kind — the route is unauthenticated by " +
|
|
68
|
-
"design — so it works with `SPECGUARD_ENDPOINT` alone, and it
|
|
69
|
-
"
|
|
68
|
+
"design — so it works with `SPECGUARD_ENDPOINT` alone, and it sends no `Authorization` header " +
|
|
69
|
+
"(as does get_intent_schema, the other credential-free read here). Takes no arguments.",
|
|
70
70
|
inputSchema: {
|
|
71
71
|
type: "object",
|
|
72
72
|
// No properties, deliberately — see this file's header. Still CLOSED rather
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-server-version.js","sourceRoot":"","sources":["../../../src/tools/get-server-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,gBAAgB,GAAmB;IACvC,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,+FAA+F;QAC/F,iGAAiG;QACjG,4FAA4F;QAC5F,2FAA2F;QAC3F,8FAA8F;QAC9F,+FAA+F;QAC/F,iGAAiG;QACjG,0FAA0F;QAC1F,gGAAgG;QAChG,+FAA+F;QAC/F,8FAA8F;QAC9F,iGAAiG;QACjG,gGAAgG;QAChG,gGAAgG;QAChG,iGAAiG;QACjG,+FAA+F;QAC/F,
|
|
1
|
+
{"version":3,"file":"get-server-version.js","sourceRoot":"","sources":["../../../src/tools/get-server-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,gBAAgB,GAAmB;IACvC,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,+FAA+F;QAC/F,iGAAiG;QACjG,4FAA4F;QAC5F,2FAA2F;QAC3F,8FAA8F;QAC9F,+FAA+F;QAC/F,iGAAiG;QACjG,0FAA0F;QAC1F,gGAAgG;QAChG,+FAA+F;QAC/F,8FAA8F;QAC9F,iGAAiG;QACjG,gGAAgG;QAChG,gGAAgG;QAChG,iGAAiG;QACjG,+FAA+F;QAC/F,uFAAuF;IACzF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,4EAA4E;QAC5E,0EAA0E;QAC1E,0EAA0E;QAC1E,0EAA0E;QAC1E,mDAAmD;QACnD,oBAAoB,EAAE,KAAK;KAC5B;IAED,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO;QACtB,MAAM,GAAG,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAErD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAEvE,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,UAAU,EAAE,MAAM;SACnB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -200,6 +200,37 @@ import type { ToolDefinition } from "./types.js";
|
|
|
200
200
|
* unchanged and still binding: the endpoint was verified-shipped on
|
|
201
201
|
* `origin/main` before this entry wrapped it. What moved was the platform,
|
|
202
202
|
* not the bar.
|
|
203
|
+
*
|
|
204
|
+
* == The contract itself, readable at last
|
|
205
|
+
*
|
|
206
|
+
* - `get_intent_schema` wraps the root-level `GET
|
|
207
|
+
* /schemas/open-test-intent.v1.json` (shipped: `specguard/config/routes.rb`,
|
|
208
|
+
* `SchemasController`, spec-covered by
|
|
209
|
+
* `spec/requests/open_test_intent_schema_spec.rb`).
|
|
210
|
+
*
|
|
211
|
+
* The second credential-free entry, and the one that gives this registry a
|
|
212
|
+
* REFERENCE beside the JUDGE it opened with. `lint_intent_annotations` can
|
|
213
|
+
* only say that an annotation already written is wrong, and its refusals are
|
|
214
|
+
* an incomplete teacher — a wrong enumerated value names the legal set, an
|
|
215
|
+
* omitted field does not, and the schema's OPTIONAL property is underivable
|
|
216
|
+
* in principle from a closed-object refusal, which only ever reports a key
|
|
217
|
+
* that WAS sent. Serving the document closes that hole without touching the
|
|
218
|
+
* judge.
|
|
219
|
+
*
|
|
220
|
+
* It mirrors rather than vendors, deliberately: the schema's design is one
|
|
221
|
+
* canonical source plus byte-identical mirrors, so a copy inside this bridge
|
|
222
|
+
* would be a third one, drifting silently and answering about itself instead
|
|
223
|
+
* of about the deployment the agent is judged by. That is also why it forced
|
|
224
|
+
* the transport's raw-body READ (`getText`): `requestJson`'s not-JSON
|
|
225
|
+
* sentence blames the endpoint for pointing at a proxy or a login page, which
|
|
226
|
+
* is the wrong remedy for a response that arrived correctly — the same
|
|
227
|
+
* argument `deleteJson`'s empty `204` made, generalised. The shared `Accept`
|
|
228
|
+
* header was widened in the same slice to admit `application/schema+json`, the
|
|
229
|
+
* media type this route actually serves: the header is a claim this client
|
|
230
|
+
* makes, and it must not exclude a route this client calls. The standing rule
|
|
231
|
+
* is unchanged and still binding — the route was verified-shipped, spec-covered
|
|
232
|
+
* and root-level before this entry wrapped it, and `/check-intent` (a comment
|
|
233
|
+
* in `routes.rb`) stays out.
|
|
203
234
|
*/
|
|
204
235
|
export declare const TOOLS: readonly ToolDefinition[];
|
|
205
236
|
export type { ToolContext, ToolDefinition, ToolResult } from "./types.js";
|
package/dist/src/tools/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import addRepository from "./add-repository.js";
|
|
2
2
|
import addRepositoryMember from "./add-repository-member.js";
|
|
3
3
|
import createRepositoryApiKey from "./create-repository-api-key.js";
|
|
4
|
+
import getIntentSchema from "./get-intent-schema.js";
|
|
4
5
|
import getServerVersion from "./get-server-version.js";
|
|
5
6
|
import lintIntentAnnotations from "./lint-intent-annotations.js";
|
|
6
7
|
import listRepositories from "./list-repositories.js";
|
|
@@ -218,9 +219,41 @@ import updateRepositoryMemberPermissions from "./update-repository-member-permis
|
|
|
218
219
|
* unchanged and still binding: the endpoint was verified-shipped on
|
|
219
220
|
* `origin/main` before this entry wrapped it. What moved was the platform,
|
|
220
221
|
* not the bar.
|
|
222
|
+
*
|
|
223
|
+
* == The contract itself, readable at last
|
|
224
|
+
*
|
|
225
|
+
* - `get_intent_schema` wraps the root-level `GET
|
|
226
|
+
* /schemas/open-test-intent.v1.json` (shipped: `specguard/config/routes.rb`,
|
|
227
|
+
* `SchemasController`, spec-covered by
|
|
228
|
+
* `spec/requests/open_test_intent_schema_spec.rb`).
|
|
229
|
+
*
|
|
230
|
+
* The second credential-free entry, and the one that gives this registry a
|
|
231
|
+
* REFERENCE beside the JUDGE it opened with. `lint_intent_annotations` can
|
|
232
|
+
* only say that an annotation already written is wrong, and its refusals are
|
|
233
|
+
* an incomplete teacher — a wrong enumerated value names the legal set, an
|
|
234
|
+
* omitted field does not, and the schema's OPTIONAL property is underivable
|
|
235
|
+
* in principle from a closed-object refusal, which only ever reports a key
|
|
236
|
+
* that WAS sent. Serving the document closes that hole without touching the
|
|
237
|
+
* judge.
|
|
238
|
+
*
|
|
239
|
+
* It mirrors rather than vendors, deliberately: the schema's design is one
|
|
240
|
+
* canonical source plus byte-identical mirrors, so a copy inside this bridge
|
|
241
|
+
* would be a third one, drifting silently and answering about itself instead
|
|
242
|
+
* of about the deployment the agent is judged by. That is also why it forced
|
|
243
|
+
* the transport's raw-body READ (`getText`): `requestJson`'s not-JSON
|
|
244
|
+
* sentence blames the endpoint for pointing at a proxy or a login page, which
|
|
245
|
+
* is the wrong remedy for a response that arrived correctly — the same
|
|
246
|
+
* argument `deleteJson`'s empty `204` made, generalised. The shared `Accept`
|
|
247
|
+
* header was widened in the same slice to admit `application/schema+json`, the
|
|
248
|
+
* media type this route actually serves: the header is a claim this client
|
|
249
|
+
* makes, and it must not exclude a route this client calls. The standing rule
|
|
250
|
+
* is unchanged and still binding — the route was verified-shipped, spec-covered
|
|
251
|
+
* and root-level before this entry wrapped it, and `/check-intent` (a comment
|
|
252
|
+
* in `routes.rb`) stays out.
|
|
221
253
|
*/
|
|
222
254
|
export const TOOLS = [
|
|
223
255
|
lintIntentAnnotations,
|
|
256
|
+
getIntentSchema,
|
|
224
257
|
getRepositoryOverview,
|
|
225
258
|
getServerVersion,
|
|
226
259
|
listRepositories,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAA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qBAAqB,MAAM,+BAA+B,CAAC;AAClE,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AACjE,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AACjE,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,uBAAuB,MAAM,+BAA+B,CAAC;AACpE,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,sBAAsB,MAAM,+BAA+B,CAAC;AACnE,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,wBAAwB,MAAM,kCAAkC,CAAC;AACxE,OAAO,sBAAsB,MAAM,gCAAgC,CAAC;AACpE,OAAO,iCAAiC,MAAM,2CAA2C,CAAC;AAG1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwOG;AACH,MAAM,CAAC,MAAM,KAAK,GAA8B;IAC9C,qBAAqB;IACrB,eAAe;IACf,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;IACb,uBAAuB;IACvB,gBAAgB;IAChB,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,mBAAmB;IACnB,iCAAiC;IACjC,sBAAsB;IACtB,gBAAgB;IAChB,uBAAuB;IACvB,uCAAuC;IACvC,wBAAwB;CACzB,CAAC"}
|
|
@@ -74,7 +74,10 @@ const lintIntentAnnotations = {
|
|
|
74
74
|
type: "boolean",
|
|
75
75
|
description: "Check the spec files the branch changed since the merge base with the default branch — " +
|
|
76
76
|
"the mode CI uses. Untracked spec files count as changed too, so a brand-new spec needs " +
|
|
77
|
-
"no `git add`; `.gitignore`d paths
|
|
77
|
+
"no `git add`; `--exclude-standard` keeps `.gitignore`d paths out of the untracked leg " +
|
|
78
|
+
"alone, and a tracked file is never subject to `.gitignore`, so the dependency/build " +
|
|
79
|
+
"directory fence is what holds ignored tracked paths out of the selection. When " +
|
|
80
|
+
"`changed` is set and " +
|
|
78
81
|
"files were selected, the selection provenance line — the base actually diffed against " +
|
|
79
82
|
"and how many selected files arrived untracked — rides `linter_stderr`, so verifying the " +
|
|
80
83
|
"selection means reading that field, not doing arithmetic on `summary.files`. Cannot be " +
|
|
@@ -238,7 +241,9 @@ function parseReport(result) {
|
|
|
238
241
|
"this bridge truncated it and the JSON document is incomplete — no findings could be " +
|
|
239
242
|
"read from it. Narrow the run with `paths`, or with `changed` to check what the " +
|
|
240
243
|
"branch changed — the diff since the merge base plus untracked spec files; " +
|
|
241
|
-
"`.gitignore`d paths
|
|
244
|
+
"`--exclude-standard` keeps `.gitignore`d paths out of the untracked leg alone, and a " +
|
|
245
|
+
"tracked file is never subject to `.gitignore`, so the dependency/build directory " +
|
|
246
|
+
"fence holds ignored tracked paths out.");
|
|
242
247
|
}
|
|
243
248
|
// The same reasoning one rung further out, and it is ordered AFTER truncation
|
|
244
249
|
// deliberately: both mean "this bridge stopped reading", but truncation is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint-intent-annotations.js","sourceRoot":"","sources":["../../../src/tools/lint-intent-annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAsB,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,qBAAqB,GAAmB;IAC5C,IAAI,EAAE,yBAAyB;IAE/B,KAAK,EAAE,0BAA0B;IAEjC,WAAW,EACT,kFAAkF;QAClF,4FAA4F;QAC5F,6FAA6F;QAC7F,mFAAmF;QACnF,+EAA+E;QAC/E,6FAA6F;QAC7F,4FAA4F;IAE9F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,oFAAoF;oBACpF,8DAA8D;aACjE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EACT,uFAAuF;oBACvF,sEAAsE;oBACtE,oCAAoC;aACvC;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,yFAAyF;oBACzF,yFAAyF;oBACzF,
|
|
1
|
+
{"version":3,"file":"lint-intent-annotations.js","sourceRoot":"","sources":["../../../src/tools/lint-intent-annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAsB,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,qBAAqB,GAAmB;IAC5C,IAAI,EAAE,yBAAyB;IAE/B,KAAK,EAAE,0BAA0B;IAEjC,WAAW,EACT,kFAAkF;QAClF,4FAA4F;QAC5F,6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