@company-semantics/contracts 27.0.0 → 27.2.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/package.json +1 -1
- package/src/api/generated-spec-hash.ts +2 -2
- package/src/api/generated.ts +174 -0
- package/src/generated/openapi-routes.ts +4 -0
- package/src/index.ts +14 -0
- package/src/org/README.md +6 -0
- package/src/org/index.ts +14 -0
- package/src/org/reasoning-review.ts +85 -0
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
|
|
2
|
-
export const SPEC_HASH = '
|
|
3
|
-
export const SPEC_HASH_FULL = '
|
|
2
|
+
export const SPEC_HASH = '409ce57139cd' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = '409ce57139cd78a8ec633efb516bc92ba81dd2cdaab0a4afe240d20c67bb6b1e' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -1338,6 +1338,40 @@ export interface paths {
|
|
|
1338
1338
|
patch?: never;
|
|
1339
1339
|
trace?: never;
|
|
1340
1340
|
};
|
|
1341
|
+
"/api/integrations/bamboohr/inferences": {
|
|
1342
|
+
parameters: {
|
|
1343
|
+
query?: never;
|
|
1344
|
+
header?: never;
|
|
1345
|
+
path?: never;
|
|
1346
|
+
cookie?: never;
|
|
1347
|
+
};
|
|
1348
|
+
/** List the org’s pending org-structure reasoning inferences (review queue) */
|
|
1349
|
+
get: operations["listBambooHrInferences"];
|
|
1350
|
+
put?: never;
|
|
1351
|
+
post?: never;
|
|
1352
|
+
delete?: never;
|
|
1353
|
+
options?: never;
|
|
1354
|
+
head?: never;
|
|
1355
|
+
patch?: never;
|
|
1356
|
+
trace?: never;
|
|
1357
|
+
};
|
|
1358
|
+
"/api/integrations/bamboohr/inferences/{id}/decision": {
|
|
1359
|
+
parameters: {
|
|
1360
|
+
query?: never;
|
|
1361
|
+
header?: never;
|
|
1362
|
+
path?: never;
|
|
1363
|
+
cookie?: never;
|
|
1364
|
+
};
|
|
1365
|
+
get?: never;
|
|
1366
|
+
put?: never;
|
|
1367
|
+
/** Accept or reject one pending org-structure reasoning inference */
|
|
1368
|
+
post: operations["decideBambooHrInference"];
|
|
1369
|
+
delete?: never;
|
|
1370
|
+
options?: never;
|
|
1371
|
+
head?: never;
|
|
1372
|
+
patch?: never;
|
|
1373
|
+
trace?: never;
|
|
1374
|
+
};
|
|
1341
1375
|
"/api/company-md/tree": {
|
|
1342
1376
|
parameters: {
|
|
1343
1377
|
query?: never;
|
|
@@ -1662,6 +1696,23 @@ export interface paths {
|
|
|
1662
1696
|
patch?: never;
|
|
1663
1697
|
trace?: never;
|
|
1664
1698
|
};
|
|
1699
|
+
"/api/company-md/docs/:id/context-bank/suggestions": {
|
|
1700
|
+
parameters: {
|
|
1701
|
+
query?: never;
|
|
1702
|
+
header?: never;
|
|
1703
|
+
path?: never;
|
|
1704
|
+
cookie?: never;
|
|
1705
|
+
};
|
|
1706
|
+
/** Suggest context docs semantically nearest to a parent the caller may view */
|
|
1707
|
+
get: operations["companyMdContextDocSuggestions"];
|
|
1708
|
+
put?: never;
|
|
1709
|
+
post?: never;
|
|
1710
|
+
delete?: never;
|
|
1711
|
+
options?: never;
|
|
1712
|
+
head?: never;
|
|
1713
|
+
patch?: never;
|
|
1714
|
+
trace?: never;
|
|
1715
|
+
};
|
|
1665
1716
|
"/api/company-md/search": {
|
|
1666
1717
|
parameters: {
|
|
1667
1718
|
query?: never;
|
|
@@ -4349,6 +4400,29 @@ export interface components {
|
|
|
4349
4400
|
};
|
|
4350
4401
|
};
|
|
4351
4402
|
};
|
|
4403
|
+
OrgStructureReviewQueue: {
|
|
4404
|
+
items: {
|
|
4405
|
+
/** Format: uuid */
|
|
4406
|
+
id: string;
|
|
4407
|
+
inferenceType: string;
|
|
4408
|
+
payload: unknown;
|
|
4409
|
+
confidence: number;
|
|
4410
|
+
reason: string;
|
|
4411
|
+
/** Format: date-time */
|
|
4412
|
+
createdAt: string;
|
|
4413
|
+
}[];
|
|
4414
|
+
};
|
|
4415
|
+
OrgStructureInferenceDecisionResult: {
|
|
4416
|
+
/** Format: uuid */
|
|
4417
|
+
id: string;
|
|
4418
|
+
/** @enum {string} */
|
|
4419
|
+
status: "accepted" | "rejected";
|
|
4420
|
+
applied: boolean;
|
|
4421
|
+
};
|
|
4422
|
+
BambooHrInferenceDecision: {
|
|
4423
|
+
/** @enum {string} */
|
|
4424
|
+
decision: "accept" | "reject";
|
|
4425
|
+
};
|
|
4352
4426
|
CompanyMdListResponse: {
|
|
4353
4427
|
items: {
|
|
4354
4428
|
id: string;
|
|
@@ -4458,6 +4532,10 @@ export interface components {
|
|
|
4458
4532
|
SearchContextDocsResponse: {
|
|
4459
4533
|
items: components["schemas"]["ContextDocDiscoveryHit"][];
|
|
4460
4534
|
};
|
|
4535
|
+
/** @description Semantically nearest context-doc suggestions the caller may view. */
|
|
4536
|
+
SuggestContextDocsResponse: {
|
|
4537
|
+
items: components["schemas"]["ContextDocDiscoveryHit"][];
|
|
4538
|
+
};
|
|
4461
4539
|
/** @description Ranked retrieval hits plus the source kinds actually searched. */
|
|
4462
4540
|
CompanyMdSearchResponse: {
|
|
4463
4541
|
hits: {
|
|
@@ -7778,6 +7856,66 @@ export interface operations {
|
|
|
7778
7856
|
};
|
|
7779
7857
|
};
|
|
7780
7858
|
};
|
|
7859
|
+
listBambooHrInferences: {
|
|
7860
|
+
parameters: {
|
|
7861
|
+
query?: never;
|
|
7862
|
+
header?: never;
|
|
7863
|
+
path?: never;
|
|
7864
|
+
cookie?: never;
|
|
7865
|
+
};
|
|
7866
|
+
requestBody?: never;
|
|
7867
|
+
responses: {
|
|
7868
|
+
/** @description The org’s pending (review) org-structure inferences, newest first */
|
|
7869
|
+
200: {
|
|
7870
|
+
headers: {
|
|
7871
|
+
[name: string]: unknown;
|
|
7872
|
+
};
|
|
7873
|
+
content: {
|
|
7874
|
+
"application/json": components["schemas"]["OrgStructureReviewQueue"];
|
|
7875
|
+
};
|
|
7876
|
+
};
|
|
7877
|
+
};
|
|
7878
|
+
};
|
|
7879
|
+
decideBambooHrInference: {
|
|
7880
|
+
parameters: {
|
|
7881
|
+
query?: never;
|
|
7882
|
+
header?: never;
|
|
7883
|
+
path: {
|
|
7884
|
+
id: string;
|
|
7885
|
+
};
|
|
7886
|
+
cookie?: never;
|
|
7887
|
+
};
|
|
7888
|
+
requestBody: {
|
|
7889
|
+
content: {
|
|
7890
|
+
"application/json": components["schemas"]["BambooHrInferenceDecision"];
|
|
7891
|
+
};
|
|
7892
|
+
};
|
|
7893
|
+
responses: {
|
|
7894
|
+
/** @description The decision outcome (status + whether the org graph was mutated) */
|
|
7895
|
+
200: {
|
|
7896
|
+
headers: {
|
|
7897
|
+
[name: string]: unknown;
|
|
7898
|
+
};
|
|
7899
|
+
content: {
|
|
7900
|
+
"application/json": components["schemas"]["OrgStructureInferenceDecisionResult"];
|
|
7901
|
+
};
|
|
7902
|
+
};
|
|
7903
|
+
/** @description Invalid decision value */
|
|
7904
|
+
400: {
|
|
7905
|
+
headers: {
|
|
7906
|
+
[name: string]: unknown;
|
|
7907
|
+
};
|
|
7908
|
+
content?: never;
|
|
7909
|
+
};
|
|
7910
|
+
/** @description Inference not found or already decided */
|
|
7911
|
+
404: {
|
|
7912
|
+
headers: {
|
|
7913
|
+
[name: string]: unknown;
|
|
7914
|
+
};
|
|
7915
|
+
content?: never;
|
|
7916
|
+
};
|
|
7917
|
+
};
|
|
7918
|
+
};
|
|
7781
7919
|
getCompanyMdTree: {
|
|
7782
7920
|
parameters: {
|
|
7783
7921
|
query?: {
|
|
@@ -8338,6 +8476,42 @@ export interface operations {
|
|
|
8338
8476
|
};
|
|
8339
8477
|
};
|
|
8340
8478
|
};
|
|
8479
|
+
companyMdContextDocSuggestions: {
|
|
8480
|
+
parameters: {
|
|
8481
|
+
query?: {
|
|
8482
|
+
limit?: number;
|
|
8483
|
+
};
|
|
8484
|
+
header?: never;
|
|
8485
|
+
path?: never;
|
|
8486
|
+
cookie?: never;
|
|
8487
|
+
};
|
|
8488
|
+
requestBody?: never;
|
|
8489
|
+
responses: {
|
|
8490
|
+
/** @description ACL-admitted semantically-nearest context-doc suggestions */
|
|
8491
|
+
200: {
|
|
8492
|
+
headers: {
|
|
8493
|
+
[name: string]: unknown;
|
|
8494
|
+
};
|
|
8495
|
+
content: {
|
|
8496
|
+
"application/json": components["schemas"]["SuggestContextDocsResponse"];
|
|
8497
|
+
};
|
|
8498
|
+
};
|
|
8499
|
+
/** @description Invalid path or query parameters */
|
|
8500
|
+
400: {
|
|
8501
|
+
headers: {
|
|
8502
|
+
[name: string]: unknown;
|
|
8503
|
+
};
|
|
8504
|
+
content?: never;
|
|
8505
|
+
};
|
|
8506
|
+
/** @description Requires org.view_company_md scope */
|
|
8507
|
+
403: {
|
|
8508
|
+
headers: {
|
|
8509
|
+
[name: string]: unknown;
|
|
8510
|
+
};
|
|
8511
|
+
content?: never;
|
|
8512
|
+
};
|
|
8513
|
+
};
|
|
8514
|
+
};
|
|
8341
8515
|
searchCompanyMd: {
|
|
8342
8516
|
parameters: {
|
|
8343
8517
|
query?: never;
|
|
@@ -24,6 +24,8 @@ export const openApiRoutes = {
|
|
|
24
24
|
'/api/company-md/access-requests/{id}/approve': ['POST'],
|
|
25
25
|
'/api/company-md/access-requests/{id}/deny': ['POST'],
|
|
26
26
|
'/api/company-md/context-bank': ['POST'],
|
|
27
|
+
'/api/company-md/context-bank/search': ['GET'],
|
|
28
|
+
'/api/company-md/docs/:id/context-bank/suggestions': ['GET'],
|
|
27
29
|
'/api/company-md/docs/{id}': ['GET'],
|
|
28
30
|
'/api/company-md/docs/{id}/access-requests': ['GET', 'POST'],
|
|
29
31
|
'/api/company-md/docs/{id}/content': ['PUT'],
|
|
@@ -60,6 +62,8 @@ export const openApiRoutes = {
|
|
|
60
62
|
'/api/factory/kpis': ['GET'],
|
|
61
63
|
'/api/factory/snapshot': ['GET'],
|
|
62
64
|
'/api/ingestion/operations/{id}': ['GET'],
|
|
65
|
+
'/api/integrations/bamboohr/inferences': ['GET'],
|
|
66
|
+
'/api/integrations/bamboohr/inferences/{id}/decision': ['POST'],
|
|
63
67
|
'/api/internal-admin/impersonate/end': ['POST'],
|
|
64
68
|
'/api/internal-admin/impersonate/session': ['GET'],
|
|
65
69
|
'/api/internal-admin/impersonate/start': ['POST'],
|
package/src/index.ts
CHANGED
|
@@ -424,6 +424,20 @@ export type { SyncRunSummary } from "./org/index";
|
|
|
424
424
|
export { ConflictRecordSchema } from "./org/index";
|
|
425
425
|
export type { ConflictRecord } from "./org/index";
|
|
426
426
|
|
|
427
|
+
// Org-structure reasoning review queue: pending structure inferences an operator
|
|
428
|
+
// accepts/rejects, and the outcome of one decision. Published response shapes.
|
|
429
|
+
// Provider-agnostic store; BambooHR is the first surface. (ADR-CONT-095)
|
|
430
|
+
export {
|
|
431
|
+
OrgStructureReviewInferenceSchema,
|
|
432
|
+
OrgStructureReviewQueueSchema,
|
|
433
|
+
OrgStructureInferenceDecisionResultSchema,
|
|
434
|
+
} from "./org/index";
|
|
435
|
+
export type {
|
|
436
|
+
OrgStructureReviewInference,
|
|
437
|
+
OrgStructureReviewQueue,
|
|
438
|
+
OrgStructureInferenceDecisionResult,
|
|
439
|
+
} from "./org/index";
|
|
440
|
+
|
|
427
441
|
// Canonical facts: the adapter-seam ingestion batch — external-keyed Canonical*
|
|
428
442
|
// facts (each with provenance) plus a CanonicalFacts envelope. The reconciler
|
|
429
443
|
// consumes the batch into the internal org graph. (ADR-CONT-085 / ADR-CTRL-183)
|
package/src/org/README.md
CHANGED
|
@@ -159,6 +159,12 @@ Shared type vocabulary for organization ownership, type classification, and tran
|
|
|
159
159
|
- `OrgOwnerIcon` _(type)_
|
|
160
160
|
- `OrgOwnerIconSchema` — Icon options for the `owner` org-chart role.
|
|
161
161
|
- `OrgScopedContext` _(type)_ — Validated organization-scoped context for policy implementations.
|
|
162
|
+
- `OrgStructureInferenceDecisionResult` _(type)_
|
|
163
|
+
- `OrgStructureInferenceDecisionResultSchema`
|
|
164
|
+
- `OrgStructureReviewInference` _(type)_
|
|
165
|
+
- `OrgStructureReviewInferenceSchema`
|
|
166
|
+
- `OrgStructureReviewQueue` _(type)_
|
|
167
|
+
- `OrgStructureReviewQueueSchema`
|
|
162
168
|
- `OrgSystemEventsList` _(type)_
|
|
163
169
|
- `OrgSystemEventsListSchema`
|
|
164
170
|
- `OrgTreeResponse` _(type)_
|
package/src/org/index.ts
CHANGED
|
@@ -136,6 +136,20 @@ export type { SyncRunSummary } from "./sync-run";
|
|
|
136
136
|
export { ConflictRecordSchema } from "./conflict-record";
|
|
137
137
|
export type { ConflictRecord } from "./conflict-record";
|
|
138
138
|
|
|
139
|
+
// Org-structure reasoning review queue: pending structure inferences an operator
|
|
140
|
+
// accepts/rejects, and the outcome of one decision. Published response shapes;
|
|
141
|
+
// provider-agnostic store, BambooHR is the first surface. (ADR-CONT-095)
|
|
142
|
+
export {
|
|
143
|
+
OrgStructureReviewInferenceSchema,
|
|
144
|
+
OrgStructureReviewQueueSchema,
|
|
145
|
+
OrgStructureInferenceDecisionResultSchema,
|
|
146
|
+
} from "./reasoning-review";
|
|
147
|
+
export type {
|
|
148
|
+
OrgStructureReviewInference,
|
|
149
|
+
OrgStructureReviewQueue,
|
|
150
|
+
OrgStructureInferenceDecisionResult,
|
|
151
|
+
} from "./reasoning-review";
|
|
152
|
+
|
|
139
153
|
// Canonical facts: the adapter-seam ingestion batch. Each fact is keyed by
|
|
140
154
|
// external identity (externalSourceId/externalSourceSystem) and carries a
|
|
141
155
|
// FactProvenance envelope; the reconciler consumes the batch. (ADR-CONT-085 / ADR-CTRL-183)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Org-structure reasoning review vocabulary — the operator review queue for
|
|
3
|
+
* proposed structure changes and the outcome of deciding one.
|
|
4
|
+
*
|
|
5
|
+
* An org-structure reasoning pass (the adapter → reasoning-engine pipeline,
|
|
6
|
+
* BambooHR being the guinea-pig source — control ADR-CTRL-159, backend
|
|
7
|
+
* ADR-BE-345) emits structure INFERENCES (nest a unit, place a report, ...) that
|
|
8
|
+
* are held in `review` rather than applied blindly. The review queue is the set
|
|
9
|
+
* of an org's pending inferences; an operator with integration-management
|
|
10
|
+
* authority ACCEPTS one (re-applying it to the live org graph) or REJECTS it.
|
|
11
|
+
*
|
|
12
|
+
* These are published RESPONSE shapes (ADR-CONT-029: response/published shapes
|
|
13
|
+
* live in contracts; the `decision` request body stays backend-local). They are
|
|
14
|
+
* provider-agnostic — the underlying store (`org_structure_inferences`) is not
|
|
15
|
+
* BambooHR-specific even though the first surface that reads it is the BambooHR
|
|
16
|
+
* integration route. `inferenceType` is an OPEN string (no enum) so new
|
|
17
|
+
* inference kinds need no schema change, mirroring the sibling org schemas
|
|
18
|
+
* ({@link ConflictRecordSchema}, {@link SyncRunSummarySchema}). `payload` is the
|
|
19
|
+
* inference-kind-specific body, modeled as unknown — its shape is keyed off
|
|
20
|
+
* `inferenceType` and is not part of the stable contract surface.
|
|
21
|
+
*/
|
|
22
|
+
import { z } from "zod";
|
|
23
|
+
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// OrgStructureReviewInference — one pending ('review') structure inference
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
export const OrgStructureReviewInferenceSchema = z.object({
|
|
29
|
+
/** Identifier of this inference within the org graph. */
|
|
30
|
+
id: z.string().uuid(),
|
|
31
|
+
/**
|
|
32
|
+
* Kind of structure inference (e.g. "NestOrgUnit", "PlaceReport"). An OPEN
|
|
33
|
+
* string so new inference kinds need no schema change.
|
|
34
|
+
*/
|
|
35
|
+
inferenceType: z.string().min(1),
|
|
36
|
+
/**
|
|
37
|
+
* The inference-kind-specific body. Its shape is keyed off `inferenceType`
|
|
38
|
+
* and is intentionally unmodeled here — not part of the stable contract.
|
|
39
|
+
*/
|
|
40
|
+
payload: z.unknown(),
|
|
41
|
+
/** Engine confidence in this inference, 0..1. */
|
|
42
|
+
confidence: z.number(),
|
|
43
|
+
/** Human-meaningful WHY the engine proposed this change. */
|
|
44
|
+
reason: z.string(),
|
|
45
|
+
/** ISO timestamp the inference was created. */
|
|
46
|
+
createdAt: z.string().datetime(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export type OrgStructureReviewInference = z.infer<
|
|
50
|
+
typeof OrgStructureReviewInferenceSchema
|
|
51
|
+
>;
|
|
52
|
+
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// OrgStructureReviewQueue — an org's pending review inferences (newest first)
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
export const OrgStructureReviewQueueSchema = z.object({
|
|
58
|
+
/** The org's pending ('review') inferences, newest first. */
|
|
59
|
+
items: z.array(OrgStructureReviewInferenceSchema),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export type OrgStructureReviewQueue = z.infer<
|
|
63
|
+
typeof OrgStructureReviewQueueSchema
|
|
64
|
+
>;
|
|
65
|
+
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
// OrgStructureInferenceDecisionResult — outcome of accepting/rejecting one
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
|
|
70
|
+
export const OrgStructureInferenceDecisionResultSchema = z.object({
|
|
71
|
+
/** Identifier of the decided inference. */
|
|
72
|
+
id: z.string().uuid(),
|
|
73
|
+
/** The terminal status the inference was moved to. */
|
|
74
|
+
status: z.enum(["accepted", "rejected"]),
|
|
75
|
+
/**
|
|
76
|
+
* Whether the decision mutated the live org graph. True on an accept that
|
|
77
|
+
* re-applied the inference; false on a reject (and on an accept that resolved
|
|
78
|
+
* to a no-op).
|
|
79
|
+
*/
|
|
80
|
+
applied: z.boolean(),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export type OrgStructureInferenceDecisionResult = z.infer<
|
|
84
|
+
typeof OrgStructureInferenceDecisionResultSchema
|
|
85
|
+
>;
|