@getvda/test-suite 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +30 -0
- package/README.md +74 -0
- package/dist/cli.d.ts +26 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +0 -0
- package/dist/cli.js.map +1 -0
- package/dist/condition.d.ts +46 -0
- package/dist/condition.d.ts.map +1 -0
- package/dist/condition.js +117 -0
- package/dist/condition.js.map +1 -0
- package/dist/impact.d.ts +50 -0
- package/dist/impact.d.ts.map +1 -0
- package/dist/impact.js +125 -0
- package/dist/impact.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/render.d.ts +17 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +65 -0
- package/dist/render.js.map +1 -0
- package/dist/sandbox.d.ts +32 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +28 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/scenarios.d.ts +34 -0
- package/dist/scenarios.d.ts.map +1 -0
- package/dist/scenarios.js +209 -0
- package/dist/scenarios.js.map +1 -0
- package/dist/signoff-trailer.d.ts +99 -0
- package/dist/signoff-trailer.d.ts.map +1 -0
- package/dist/signoff-trailer.js +129 -0
- package/dist/signoff-trailer.js.map +1 -0
- package/dist/suite.d.ts +44 -0
- package/dist/suite.d.ts.map +1 -0
- package/dist/suite.js +161 -0
- package/dist/suite.js.map +1 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +24 -0
- package/dist/types.js.map +1 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Verified Digital Agents (VDA) — Agent Control Plane
|
|
2
|
+
Copyright 2026 getvda.ai
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use these files except in compliance with the License. A copy of the
|
|
6
|
+
License is in the LICENSE file at the repository root and at:
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
11
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
12
|
+
CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
What these packages do and do NOT carry
|
|
17
|
+
----------------------------------------
|
|
18
|
+
|
|
19
|
+
The @getvda/* packages VERIFY and ENFORCE governance. They do not carry the
|
|
20
|
+
trust anchors that governance rests on:
|
|
21
|
+
|
|
22
|
+
- Bundle-signing keys (#key-3) live only in getvda's Secret Manager. These
|
|
23
|
+
packages VERIFY a bundle's signature against the public key resolved from
|
|
24
|
+
did:web:acp.getvda.ai; they cannot mint a bundle that verifies.
|
|
25
|
+
- Witness account credentials are the customer's own (customer-managed
|
|
26
|
+
custody). These packages SEAL to a Witness account the caller supplies;
|
|
27
|
+
they carry no standing credential.
|
|
28
|
+
|
|
29
|
+
The code is open. The trust anchors are not in the code — and giving away the
|
|
30
|
+
verifier does not give away the ability to forge what it verifies.
|
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @getvda/test-suite
|
|
2
|
+
|
|
3
|
+
> **Status: pre-1.0 (0.x).** Public API may change between minor versions —
|
|
4
|
+
> pin an exact version if you need stability. Part of the [getvda.ai](https://getvda.ai)
|
|
5
|
+
> governance suite. Honesty discipline: nothing documented here is live unless it
|
|
6
|
+
> says so, boundaries (fail-static, condition-assertion) are stated where they apply,
|
|
7
|
+
> and a stub is labelled a stub.
|
|
8
|
+
|
|
9
|
+
> **What this carries — and what it does not.** This package *verifies and
|
|
10
|
+
> enforces* governance. The trust anchors are not in it: bundle-signing keys
|
|
11
|
+
> (`#key-3`) live only in getvda's Secret Manager, and Witness account
|
|
12
|
+
> credentials are the caller's own (customer-managed custody). It verifies a
|
|
13
|
+
> signature against the public key resolved from `did:web:acp.getvda.ai` and
|
|
14
|
+
> seals to a Witness account you supply — it cannot mint a bundle that verifies,
|
|
15
|
+
> and carries no standing credential. Open code, trust anchors elsewhere.
|
|
16
|
+
|
|
17
|
+
The **CI test suite** (Phase 3) — what makes a governance change SAFE to merge.
|
|
18
|
+
Runs on the PR. **Provider-free** (depends only on `@getvda/governance-schema` +
|
|
19
|
+
`@getvda/compliance-guard`, no git), so it drops into the customer's OWN pipeline as
|
|
20
|
+
one trusted step.
|
|
21
|
+
|
|
22
|
+
## The four gates → one result
|
|
23
|
+
|
|
24
|
+
| Step | What | Blocking |
|
|
25
|
+
| ------------------ | ----------------------------------------------------------------- | ---------------------- |
|
|
26
|
+
| **schema** (3a) | the 1a contract as a gate — CONFIRMED strict, PROVISIONAL lenient | yes |
|
|
27
|
+
| **guard** (3b) | the Compliance Guard (`runComplianceGuard`) | yes |
|
|
28
|
+
| **scenarios** (3c) | ACP governance-level adversarial checks | yes (certain findings) |
|
|
29
|
+
| **sandbox** (3c) | agent-behavioral eval, delegated to Onboarding Phase 5 | — (honest stub) |
|
|
30
|
+
| **impact** (3d) | deterministic impact analysis | no (informational) |
|
|
31
|
+
|
|
32
|
+
`runTestSuite(before, after, options)` → one `TestSuiteResult`. The overall
|
|
33
|
+
verdict (`ok`/`exitCode`) and the human summary both read the SAME normalized
|
|
34
|
+
`StepResult[]` — no second "did it pass" logic, no second renderer
|
|
35
|
+
(`renderSuiteForHuman` + `toJson` are the only outputs, over one object).
|
|
36
|
+
|
|
37
|
+
## 3c — why ACP owns the scenario runner
|
|
38
|
+
|
|
39
|
+
Onboarding's adversarial sandbox (its Phase 5) is **staged/pass-through** — its
|
|
40
|
+
card states phases 2–6 don't run live evaluation; it seals a `not_implemented`
|
|
41
|
+
agent_action (verified 2026-07-18). So:
|
|
42
|
+
|
|
43
|
+
- **Governance-level scenarios** are ACP's own crown jewel — static analysis over
|
|
44
|
+
the documents, no agent sandbox needed:
|
|
45
|
+
- `unconditioned_capability` — a permission with no conditions (structural,
|
|
46
|
+
**certain → blocks**).
|
|
47
|
+
- `prohibition_permission_conflict` / `newly_permitted_conflict` — a "MUST NOT
|
|
48
|
+
x" overlapping a granted capability (**heuristic → warns**, flagged when the
|
|
49
|
+
change newly introduces it: "permit something previously denied").
|
|
50
|
+
- `contradictory_obligations` — a "MUST x" vs "MUST NOT x" (**heuristic →
|
|
51
|
+
warns**).
|
|
52
|
+
Certainty is labelled: structural findings block; heuristic ones flag for a
|
|
53
|
+
human, never presented as proofs.
|
|
54
|
+
- **Agent-behavioral sandbox** is a real seam (`SandboxEvaluator`) delegating to
|
|
55
|
+
Onboarding, with an honest stub reporting `not_available` — never a fake pass.
|
|
56
|
+
Drop in a real evaluator when Onboarding Phase 5 goes live; nothing else
|
|
57
|
+
changes.
|
|
58
|
+
|
|
59
|
+
## 3d — impact analysis honesty
|
|
60
|
+
|
|
61
|
+
Deterministic from the data ACP has: changed files, environments (frontmatter),
|
|
62
|
+
capabilities/clauses affected. Agents come from an ACP-maintained environment
|
|
63
|
+
registry if provided; otherwise from frontmatter, **marked incomplete** — ACP
|
|
64
|
+
cannot yet read live admitted-agent facts from Onboarding (no such skill on its
|
|
65
|
+
card). Journeys need the registry or are honestly `undetermined`.
|
|
66
|
+
|
|
67
|
+
## Invoke it in the customer's CI
|
|
68
|
+
|
|
69
|
+
- **Plain CLI:** `npx @getvda/test-suite acp-test --base <ref> [--head <ref>] [--path dir]`
|
|
70
|
+
→ human summary + exit 0/1. Reads before/after via plain `git show` — no tokens.
|
|
71
|
+
- **GitHub Action:** [`ci/github-action/action.yml`](../../ci/github-action/action.yml)
|
|
72
|
+
- **GitLab component:** [`ci/gitlab/acp-test.yml`](../../ci/gitlab/acp-test.yml)
|
|
73
|
+
|
|
74
|
+
All three are the same CLI; the actions are thin wrappers.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* acp-test — the plain-CLI entry point for the governance test suite.
|
|
4
|
+
*
|
|
5
|
+
* Designed to be the ONE trusted step a customer's platform team adds to their
|
|
6
|
+
* EXISTING pipeline (GitHub Action / GitLab component / Jenkins / plain shell).
|
|
7
|
+
* It depends only on `git` being present — no ACP git-provider, no network, no
|
|
8
|
+
* tokens — because in CI the repo is already checked out.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* acp-test --base <ref> [--head <ref>] [--path <dir>] [--format human|json]
|
|
12
|
+
* [--json <file>] [--policy <file>] [--registry <file>] [--repo <dir>]
|
|
13
|
+
*
|
|
14
|
+
* --base git ref for the BEFORE state (e.g. the PR target / merge-base). Required.
|
|
15
|
+
* --head git ref for the AFTER state. Omit to use the working tree.
|
|
16
|
+
* --path directory the governance files live in (default: repo root).
|
|
17
|
+
* --format human (default) or json.
|
|
18
|
+
* --json also write the machine-readable result to this file.
|
|
19
|
+
* --policy JSON: { guard?, scenario?, signOffs? } (GuardPolicy + ScenarioPolicy + SignOff[]).
|
|
20
|
+
* --registry JSON: EnvironmentRegistry (env → agents/journeys).
|
|
21
|
+
* --repo repo directory (default: cwd).
|
|
22
|
+
*
|
|
23
|
+
* Exit code: 0 = suite passed, 1 = a blocking gate failed, 2 = usage/IO error.
|
|
24
|
+
*/
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
|
package/dist/cli.js
ADDED
|
Binary file
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAuB,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAa1D,SAAS,SAAS,CAAC,IAAuB;IACxC,MAAM,IAAI,GAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;IAC5D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,IAAI,GAAG,GAAW,EAAE;YACxB,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YACpB,IAAI,CAAC,KAAK,SAAS;gBAAE,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;YACpD,OAAO,CAA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,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAC/E,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,KAAK,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SC-1b — does a condition actually CONSTRAIN?
|
|
3
|
+
*
|
|
4
|
+
* The core idea: **a condition that cannot be false is not a condition.**
|
|
5
|
+
* Counting the conditions array is defeatable by writing a word — a capability
|
|
6
|
+
* conditioned on "always permitted" satisfies a length check while meaning its
|
|
7
|
+
* exact opposite. So the question is falsifiability, not presence.
|
|
8
|
+
*
|
|
9
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
* KNOWN DIRECTION — this is a bridge, not the destination.
|
|
11
|
+
*
|
|
12
|
+
* Governance conditions are PROSE BY DESIGN, and the runtime already treats
|
|
13
|
+
* them as unverifiable: the evaluator answers the structural question, and the
|
|
14
|
+
* agent ASSERTS that it met the condition (the condition-assertion boundary
|
|
15
|
+
* stated on ACP's own agent card). So SC-1 is statically judging text that
|
|
16
|
+
* nothing else evaluates either — a vocabulary heuristic over prose is the best
|
|
17
|
+
* available static check, not a semantic guarantee.
|
|
18
|
+
*
|
|
19
|
+
* The real fix is STRUCTURED, MACHINE-EVALUABLE CONDITIONS — a condition
|
|
20
|
+
* expressed so that something can actually decide whether it held, rather than
|
|
21
|
+
* an agent asserting that it did. Recorded here so it is not rediscovered as a
|
|
22
|
+
* surprise every time someone reads this file.
|
|
23
|
+
*
|
|
24
|
+
* LANGUAGE: the vocabularies below are ENGLISH-ONLY. A governance set written
|
|
25
|
+
* in another language will fall to `indeterminate` on every condition — which
|
|
26
|
+
* is the honest failure direction (a warning for a human) rather than a false
|
|
27
|
+
* pass or a false block, but it is a real limitation, not a rounding error.
|
|
28
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
29
|
+
*/
|
|
30
|
+
export type ConditionVerdict = 'constrains' | 'vacuous' | 'indeterminate';
|
|
31
|
+
/**
|
|
32
|
+
* Judge one condition.
|
|
33
|
+
*
|
|
34
|
+
* Vacuity is decided on the WHOLE token set, never a substring: "the audit log
|
|
35
|
+
* is always written before the action" contains `always` but also `written` and
|
|
36
|
+
* `before`, so it constrains. Firing on a fragment is how a check ends up
|
|
37
|
+
* confident for the wrong reason.
|
|
38
|
+
*/
|
|
39
|
+
export declare function judgeCondition(condition: string): ConditionVerdict;
|
|
40
|
+
/** Verdict for a capability's whole condition list. */
|
|
41
|
+
export declare function judgeConditions(conditions: readonly string[]): {
|
|
42
|
+
verdict: ConditionVerdict;
|
|
43
|
+
vacuous: readonly string[];
|
|
44
|
+
indeterminate: readonly string[];
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=condition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../src/condition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,SAAS,GAAG,eAAe,CAAC;AAgD1E;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAclE;AAED,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG;IAC9D,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,CAkBA"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SC-1b — does a condition actually CONSTRAIN?
|
|
3
|
+
*
|
|
4
|
+
* The core idea: **a condition that cannot be false is not a condition.**
|
|
5
|
+
* Counting the conditions array is defeatable by writing a word — a capability
|
|
6
|
+
* conditioned on "always permitted" satisfies a length check while meaning its
|
|
7
|
+
* exact opposite. So the question is falsifiability, not presence.
|
|
8
|
+
*
|
|
9
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
* KNOWN DIRECTION — this is a bridge, not the destination.
|
|
11
|
+
*
|
|
12
|
+
* Governance conditions are PROSE BY DESIGN, and the runtime already treats
|
|
13
|
+
* them as unverifiable: the evaluator answers the structural question, and the
|
|
14
|
+
* agent ASSERTS that it met the condition (the condition-assertion boundary
|
|
15
|
+
* stated on ACP's own agent card). So SC-1 is statically judging text that
|
|
16
|
+
* nothing else evaluates either — a vocabulary heuristic over prose is the best
|
|
17
|
+
* available static check, not a semantic guarantee.
|
|
18
|
+
*
|
|
19
|
+
* The real fix is STRUCTURED, MACHINE-EVALUABLE CONDITIONS — a condition
|
|
20
|
+
* expressed so that something can actually decide whether it held, rather than
|
|
21
|
+
* an agent asserting that it did. Recorded here so it is not rediscovered as a
|
|
22
|
+
* surprise every time someone reads this file.
|
|
23
|
+
*
|
|
24
|
+
* LANGUAGE: the vocabularies below are ENGLISH-ONLY. A governance set written
|
|
25
|
+
* in another language will fall to `indeterminate` on every condition — which
|
|
26
|
+
* is the honest failure direction (a warning for a human) rather than a false
|
|
27
|
+
* pass or a false block, but it is a real limitation, not a rounding error.
|
|
28
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
29
|
+
*/
|
|
30
|
+
/** Dropped before judging — carries no evidence either way. */
|
|
31
|
+
const FILLER = new Set([
|
|
32
|
+
'the', 'a', 'an', 'is', 'are', 'be', 'was', 'were', 'and', 'or', 'at', 'in',
|
|
33
|
+
'on', 'of', 'to', 'this', 'that', 'it', 'its', 'capability', 'action', 'agent',
|
|
34
|
+
]);
|
|
35
|
+
/**
|
|
36
|
+
* Tokens that assert universality. A condition made ENTIRELY of these cannot be
|
|
37
|
+
* false, so it is not a condition.
|
|
38
|
+
*/
|
|
39
|
+
const VACUITY = new Set([
|
|
40
|
+
'always', 'permitted', 'allowed', 'unconditional', 'unconditionally',
|
|
41
|
+
'unrestricted', 'any', 'all', 'time', 'times', 'none', 'na', 'n/a',
|
|
42
|
+
'applicable', 'yes', 'true', 'no', 'restrictions', 'conditions', 'condition',
|
|
43
|
+
'nil', 'nothing', 'everything', 'everywhere', 'anytime',
|
|
44
|
+
]);
|
|
45
|
+
/**
|
|
46
|
+
* Evidence that something could be otherwise: a testable verb, a comparator, or
|
|
47
|
+
* a qualifier. One of these is enough to call it constraining.
|
|
48
|
+
*/
|
|
49
|
+
const PREDICATE = new Set([
|
|
50
|
+
// testable verbs — a state that either holds or does not
|
|
51
|
+
'passed', 'passes', 'sealed', 'seals', 'carries', 'carried', 'exceeds',
|
|
52
|
+
'exceeded', 'matches', 'matched', 'verified', 'approved', 'signed',
|
|
53
|
+
'authenticated', 'authorised', 'authorized', 'validated', 'confirmed',
|
|
54
|
+
'present', 'recorded', 'logged', 'written', 'completed', 'holds', 'held',
|
|
55
|
+
'granted', 'issued', 'resolved', 'reviewed', 'attested', 'anchored',
|
|
56
|
+
// comparators / scoping
|
|
57
|
+
'within', 'above', 'below', 'under', 'over', 'before', 'after', 'least',
|
|
58
|
+
'most', 'more', 'less', 'between', 'during', 'until', 'while', 'limit',
|
|
59
|
+
'threshold', 'ceiling', 'maximum', 'minimum', 'scope', 'scoped',
|
|
60
|
+
// qualifiers — introduce a way to fail
|
|
61
|
+
'unless', 'only', 'except', 'not', 'if', 'when', 'where', 'provided',
|
|
62
|
+
'requires', 'required', 'must',
|
|
63
|
+
]);
|
|
64
|
+
/** Lowercase, strip punctuation, drop filler. */
|
|
65
|
+
function tokenise(condition) {
|
|
66
|
+
return condition
|
|
67
|
+
.toLowerCase()
|
|
68
|
+
.replace(/[^a-z0-9/\s-]/g, ' ')
|
|
69
|
+
.split(/[\s-]+/)
|
|
70
|
+
.filter((t) => t !== '' && !FILLER.has(t));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Judge one condition.
|
|
74
|
+
*
|
|
75
|
+
* Vacuity is decided on the WHOLE token set, never a substring: "the audit log
|
|
76
|
+
* is always written before the action" contains `always` but also `written` and
|
|
77
|
+
* `before`, so it constrains. Firing on a fragment is how a check ends up
|
|
78
|
+
* confident for the wrong reason.
|
|
79
|
+
*/
|
|
80
|
+
export function judgeCondition(condition) {
|
|
81
|
+
const tokens = tokenise(condition);
|
|
82
|
+
if (tokens.length === 0)
|
|
83
|
+
return 'vacuous';
|
|
84
|
+
// A predicate anywhere means there is a way for this to be false.
|
|
85
|
+
if (tokens.some((t) => PREDICATE.has(t)))
|
|
86
|
+
return 'constrains';
|
|
87
|
+
// Every remaining token asserts universality → it cannot be false.
|
|
88
|
+
if (tokens.every((t) => VACUITY.has(t)))
|
|
89
|
+
return 'vacuous';
|
|
90
|
+
// No vacuity proof and no predicate found. Say so rather than guess —
|
|
91
|
+
// asserting a verdict the evidence does not support is the failure this
|
|
92
|
+
// check exists to catch.
|
|
93
|
+
return 'indeterminate';
|
|
94
|
+
}
|
|
95
|
+
/** Verdict for a capability's whole condition list. */
|
|
96
|
+
export function judgeConditions(conditions) {
|
|
97
|
+
const vacuous = [];
|
|
98
|
+
const indeterminate = [];
|
|
99
|
+
let anyConstrains = false;
|
|
100
|
+
for (const c of conditions) {
|
|
101
|
+
const v = judgeCondition(c);
|
|
102
|
+
if (v === 'constrains')
|
|
103
|
+
anyConstrains = true;
|
|
104
|
+
else if (v === 'vacuous')
|
|
105
|
+
vacuous.push(c);
|
|
106
|
+
else
|
|
107
|
+
indeterminate.push(c);
|
|
108
|
+
}
|
|
109
|
+
// One genuinely constraining condition is enough to bound the capability,
|
|
110
|
+
// even alongside a vacuous one — the permission is still limited.
|
|
111
|
+
if (anyConstrains)
|
|
112
|
+
return { verdict: 'constrains', vacuous, indeterminate };
|
|
113
|
+
if (vacuous.length > 0 && indeterminate.length === 0)
|
|
114
|
+
return { verdict: 'vacuous', vacuous, indeterminate };
|
|
115
|
+
return { verdict: 'indeterminate', vacuous, indeterminate };
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=condition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../src/condition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,+DAA+D;AAC/D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC;IACrB,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC3E,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO;CAC/E,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;IACtB,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB;IACpE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK;IAClE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW;IAC5E,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS;CACxD,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACxB,yDAAyD;IACzD,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACtE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ;IAClE,eAAe,EAAE,YAAY,EAAE,YAAY,EA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AAE,OAAO,YAAY,CAAC;IAE9D,mEAAmE;IACnE,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAE1D,sEAAsE;IACtE,wEAAwE;IACxE,yBAAyB;IACzB,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,eAAe,CAAC,UAA6B;IAK3D,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,IAAI,aAAa,GAAG,KAAK,CAAC;IAE1B,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,YAAY;YAAE,aAAa,GAAG,IAAI,CAAC;aACxC,IAAI,CAAC,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;YACrC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAED,0EAA0E;IAC1E,kEAAkE;IAClE,IAAI,aAAa;QAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IAC5E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IACxD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AAC9D,CAAC"}
|
package/dist/impact.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic impact analysis (3d).
|
|
3
|
+
*
|
|
4
|
+
* Given a governance change, answer — from the data ACP actually has — which
|
|
5
|
+
* files, environments, agents, capabilities, and journeys it affects. Same input
|
|
6
|
+
* → same output; no heuristics in the counts.
|
|
7
|
+
*
|
|
8
|
+
* HONESTY about data sources: ACP can read environments/agents from governance
|
|
9
|
+
* frontmatter and from an ACP-maintained environment registry. It CANNOT yet
|
|
10
|
+
* read live admitted-agent facts from Onboarding — that skill does not exist on
|
|
11
|
+
* Onboarding's live card (verified 2026-07-18). So when the agent list is derived
|
|
12
|
+
* only from frontmatter, impact says so and marks the result incomplete, rather
|
|
13
|
+
* than implying it enumerated the real fleet.
|
|
14
|
+
*
|
|
15
|
+
* Shaped for the Phase-4 human approver, same as the honest diff.
|
|
16
|
+
*/
|
|
17
|
+
import { type GovernanceFileName, type GovernanceSet } from '@getvda/governance-schema';
|
|
18
|
+
import type { GovernanceDiff } from '@getvda/compliance-guard';
|
|
19
|
+
/** ACP-maintained mapping of environment → its agents/journeys. Seam to be
|
|
20
|
+
* enriched from Onboarding admitted-agent facts once that skill is live. */
|
|
21
|
+
export interface EnvironmentRegistryEntry {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly agents: readonly string[];
|
|
24
|
+
readonly journeys?: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
export interface EnvironmentRegistry {
|
|
27
|
+
readonly environments: readonly EnvironmentRegistryEntry[];
|
|
28
|
+
}
|
|
29
|
+
export interface AffectedAgents {
|
|
30
|
+
readonly agents: readonly string[];
|
|
31
|
+
readonly source: 'registry' | 'frontmatter' | 'none';
|
|
32
|
+
/** false when the list may be incomplete (e.g. derived from frontmatter). */
|
|
33
|
+
readonly complete: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ImpactAnalysis {
|
|
36
|
+
readonly changedFiles: readonly GovernanceFileName[];
|
|
37
|
+
readonly environments: readonly string[];
|
|
38
|
+
readonly agents: AffectedAgents;
|
|
39
|
+
readonly capabilitiesAffected: readonly string[];
|
|
40
|
+
readonly clauseImpact: {
|
|
41
|
+
readonly mustDelta: number;
|
|
42
|
+
readonly mustNotDelta: number;
|
|
43
|
+
readonly citationsChanged: readonly string[];
|
|
44
|
+
};
|
|
45
|
+
readonly journeys: readonly string[] | 'undetermined';
|
|
46
|
+
/** Honest caveats about data completeness. */
|
|
47
|
+
readonly notes: readonly string[];
|
|
48
|
+
}
|
|
49
|
+
export declare function computeImpact(before: GovernanceSet, after: GovernanceSet, diff: GovernanceDiff, registry?: EnvironmentRegistry): ImpactAnalysis;
|
|
50
|
+
//# sourceMappingURL=impact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impact.d.ts","sourceRoot":"","sources":["../src/impact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D;6EAC6E;AAC7E,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AACD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC5D;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,GAAG,MAAM,CAAC;IACrD,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,YAAY,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrD,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,C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