@cat-factory/gates 0.5.57 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -16
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
import { type GateRegistry } from '@cat-factory/kernel';
|
|
1
2
|
export { CI_STATUS_PROVIDER, MERGEABILITY_PROVIDER, RELEASE_HEALTH_PROVIDER, INCIDENT_ENRICHMENT_PROVIDER, PULL_REQUEST_REVIEW_PROVIDER, DOC_QUALITY_PROVIDER, wireCiStatusProvider, wireMergeabilityProvider, wireReleaseHealthProvider, wireIncidentEnrichment, wirePullRequestReviewProvider, wireDocQualityProvider, clearGateProviders, applyGateProviders, warnUnwiredGates, type GateProviderOverrides, type GateWiringLogger, } from './providers.js';
|
|
2
3
|
export { ciGate, conflictsGate, postReleaseHealthGate, humanReviewGate, docQualityGate, } from './gates.js';
|
|
3
4
|
export { classifyHumanReview, isApproved, outstandingThreads, outstandingComments, renderReviewFeedbackForFixer, requiredApprovals, type HumanReviewVerdict, } from './review.logic.js';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Install the built-in gate suite into an app-owned {@link GateRegistry}. The composition
|
|
7
|
+
* root calls this once with the instance it threads through `CoreDependencies.gateRegistry`.
|
|
8
|
+
* Idempotent (the registry replaces by kind), so a deployment can call it then override a
|
|
9
|
+
* built-in by re-registering the same kind.
|
|
8
10
|
*/
|
|
9
|
-
export declare function registerBuiltinGates(): void;
|
|
11
|
+
export declare function registerBuiltinGates(registry: GateRegistry): void;
|
|
12
|
+
/**
|
|
13
|
+
* A fresh app-owned {@link GateRegistry} pre-loaded with the built-in gate suite — the single
|
|
14
|
+
* named factory a composition root reaches for when it is NOT handed an injected registry.
|
|
15
|
+
* Prefer this over the `defaultGateRegistry()` + `registerBuiltinGates()` two-step at every
|
|
16
|
+
* construction site: kernel's `defaultGateRegistry()` is empty by design (it cannot depend on
|
|
17
|
+
* this package), so a site that forgets the second step silently drops the platform's own
|
|
18
|
+
* CI / conflicts / merge gates. Collapsing the pair into one call makes that hazard
|
|
19
|
+
* unrepresentable — the obvious "I need the built-in gates" helper installs them.
|
|
20
|
+
*/
|
|
21
|
+
export declare function gateRegistryWithBuiltins(): GateRegistry;
|
|
10
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAIlB,MAAM,qBAAqB,CAAA;AAiC5B,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,cAAc,GACf,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,iBAAiB,EACjB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAA;AAE1B;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAMjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,IAAI,YAAY,CAIvD"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CI_AGENT_KIND, CONFLICTS_AGENT_KIND, DOC_QUALITY_AGENT_KIND, HUMAN_REVIEW_AGENT_KIND, POST_RELEASE_HEALTH_AGENT_KIND,
|
|
1
|
+
import { CI_AGENT_KIND, CONFLICTS_AGENT_KIND, DOC_QUALITY_AGENT_KIND, HUMAN_REVIEW_AGENT_KIND, POST_RELEASE_HEALTH_AGENT_KIND, defaultGateRegistry, } from '@cat-factory/kernel';
|
|
2
2
|
import { ciGate, conflictsGate, docQualityGate, humanReviewGate, postReleaseHealthGate, } from './gates.js';
|
|
3
3
|
// ---------------------------------------------------------------------------
|
|
4
4
|
// The built-in polling-gate suite, authored ENTIRELY through the public gate-registry
|
|
@@ -8,32 +8,49 @@ import { ciGate, conflictsGate, docQualityGate, humanReviewGate, postReleaseHeal
|
|
|
8
8
|
// deployment's. The engine no longer hard-codes them; it merges whatever gates are
|
|
9
9
|
// registered when its ExecutionService first builds its gate registry.
|
|
10
10
|
//
|
|
11
|
-
// A deployment opts in by
|
|
12
|
-
// gate's provider at startup:
|
|
11
|
+
// A deployment opts in by installing the built-in gates into its app-owned gate registry,
|
|
12
|
+
// then wiring each gate's provider at startup:
|
|
13
13
|
//
|
|
14
|
-
//
|
|
14
|
+
// const gates = defaultGateRegistry()
|
|
15
|
+
// registerBuiltinGates(gates) // installs ci / conflicts / … into the instance
|
|
15
16
|
// wireCiStatusProvider(new GitHubCiStatusProvider(...))
|
|
16
17
|
// wireMergeabilityProvider(new GitHubMergeabilityProvider(...))
|
|
17
18
|
// wireReleaseHealthProvider(new RegistryReleaseHealthProvider(...))
|
|
18
19
|
// wireIncidentEnrichment(new CompositeIncidentEnrichmentProvider(...))
|
|
20
|
+
// // …then thread `gates` through `CoreDependencies.gateRegistry`.
|
|
19
21
|
//
|
|
20
|
-
// Until a gate's provider is wired it is a harmless pass-through
|
|
22
|
+
// Until a gate's provider is wired it is a harmless pass-through. The registry is an
|
|
23
|
+
// app-owned INSTANCE (`GateRegistry`), not a module global — so registering the built-ins is
|
|
24
|
+
// an explicit call the composition root makes, not an import side effect.
|
|
21
25
|
// ---------------------------------------------------------------------------
|
|
22
26
|
export { CI_STATUS_PROVIDER, MERGEABILITY_PROVIDER, RELEASE_HEALTH_PROVIDER, INCIDENT_ENRICHMENT_PROVIDER, PULL_REQUEST_REVIEW_PROVIDER, DOC_QUALITY_PROVIDER, wireCiStatusProvider, wireMergeabilityProvider, wireReleaseHealthProvider, wireIncidentEnrichment, wirePullRequestReviewProvider, wireDocQualityProvider, clearGateProviders, applyGateProviders, warnUnwiredGates, } from './providers.js';
|
|
23
27
|
export { ciGate, conflictsGate, postReleaseHealthGate, humanReviewGate, docQualityGate, } from './gates.js';
|
|
24
28
|
export { classifyHumanReview, isApproved, outstandingThreads, outstandingComments, renderReviewFeedbackForFixer, requiredApprovals, } from './review.logic.js';
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
30
|
+
* Install the built-in gate suite into an app-owned {@link GateRegistry}. The composition
|
|
31
|
+
* root calls this once with the instance it threads through `CoreDependencies.gateRegistry`.
|
|
32
|
+
* Idempotent (the registry replaces by kind), so a deployment can call it then override a
|
|
33
|
+
* built-in by re-registering the same kind.
|
|
29
34
|
*/
|
|
30
|
-
export function registerBuiltinGates() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
export function registerBuiltinGates(registry) {
|
|
36
|
+
registry.register(CI_AGENT_KIND, ciGate);
|
|
37
|
+
registry.register(CONFLICTS_AGENT_KIND, conflictsGate);
|
|
38
|
+
registry.register(POST_RELEASE_HEALTH_AGENT_KIND, postReleaseHealthGate);
|
|
39
|
+
registry.register(HUMAN_REVIEW_AGENT_KIND, humanReviewGate);
|
|
40
|
+
registry.register(DOC_QUALITY_AGENT_KIND, docQualityGate);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A fresh app-owned {@link GateRegistry} pre-loaded with the built-in gate suite — the single
|
|
44
|
+
* named factory a composition root reaches for when it is NOT handed an injected registry.
|
|
45
|
+
* Prefer this over the `defaultGateRegistry()` + `registerBuiltinGates()` two-step at every
|
|
46
|
+
* construction site: kernel's `defaultGateRegistry()` is empty by design (it cannot depend on
|
|
47
|
+
* this package), so a site that forgets the second step silently drops the platform's own
|
|
48
|
+
* CI / conflicts / merge gates. Collapsing the pair into one call makes that hazard
|
|
49
|
+
* unrepresentable — the obvious "I need the built-in gates" helper installs them.
|
|
50
|
+
*/
|
|
51
|
+
export function gateRegistryWithBuiltins() {
|
|
52
|
+
const registry = defaultGateRegistry();
|
|
53
|
+
registerBuiltinGates(registry);
|
|
54
|
+
return registry;
|
|
36
55
|
}
|
|
37
|
-
// Side-effect registration: `import '@cat-factory/gates'` is enough.
|
|
38
|
-
registerBuiltinGates();
|
|
39
56
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EAEtB,uBAAuB,EACvB,8BAA8B,EAC9B,mBAAmB,GACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,MAAM,EACN,aAAa,EACb,cAAc,EACd,eAAe,EACf,qBAAqB,GACtB,MAAM,YAAY,CAAA;AAEnB,8EAA8E;AAC9E,sFAAsF;AACtF,0FAA0F;AAC1F,kFAAkF;AAClF,gFAAgF;AAChF,mFAAmF;AACnF,uEAAuE;AACvE,EAAE;AACF,0FAA0F;AAC1F,+CAA+C;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.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/gates",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "The built-in polling-gate suite (CI, merge-conflicts, post-release health + the on-call escalation) for the Agent Architecture Board, authored entirely through the public gate-registry seam — depends only on @cat-factory/kernel + @cat-factory/contracts, never the engine. A deployment imports it for side effect and wires each gate's provider via the exported wireX handles.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@cat-factory/contracts": "0.148.1",
|
|
28
|
-
"@cat-factory/kernel": "0.
|
|
28
|
+
"@cat-factory/kernel": "0.141.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "7.0.2",
|