@maycombhq/sdk 2.0.0-beta.24 → 2.0.0-beta.26

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/npm/core/api.d.ts CHANGED
@@ -454,8 +454,48 @@ import { z } from "zod";
454
454
  * drawn in the architecture and repo lenses, never merged into calls or their counts; its join's
455
455
  * `how` is `coordinates` and it carries `dependency` (group, name, version, scope), with the
456
456
  * dependency's lines as `caller` and the publishing lines as `callee`. Additive only.
457
+ * 3.11.0 (review of beta.24, round 2): POST /api/links/corrections takes up to 5000 items
458
+ * (`LINK_CORRECTIONS_MAX`, was 200), every call GET /api/graph/edge-calls can give, still all
459
+ * or none, in a body of up to 16 MB. An item is skipped only when the correction its fact
460
+ * meets now (by its id and cite, as verify meets it) says the same: one on file for a line the
461
+ * fact has left meets nothing, so the new one is written. A repo named in another case is the
462
+ * one the manifests or the facts files spell (one plan for it); a name none spells is 404. A
463
+ * corrections file another process holds past the wait answers 409 with `written: []`. A
464
+ * problem may carry `written` (the repos whose files were written, `{ repo, file }`); a 500
465
+ * names them, and most write none. GET /api/graph/edge-calls requires `edge` and one of
466
+ * `node` or `focus`, and takes the node view's `depth` and `all`, so an edge of a depth-2 or
467
+ * an all view is found. Repo trust's `secrets[].key` is empty when the key is a secret itself
468
+ * (an access key id), never shown. Additive only.
469
+ * Review of beta.24, round 3: POST /api/facts/{repo}/corrections takes the repo in another
470
+ * case as the batch does, and answers 409 with `written: []` while another process holds the
471
+ * corrections file. A repo the manifest spells in one case and only one facts file spells in
472
+ * another (on a file system that minds case) is the facts file's spelling, so its file is the
473
+ * one read and written; a repo name two facts files spell but for case is refused (422,
474
+ * `written: []`); a facts folder's `.rejected`, `.reviewed` and `.questions` files name no
475
+ * repo. GET /api/graph/edge-calls is as in round 2 (it names no call facts). Additive only.
476
+ * 3.11.0 (beta.25, a library's "depends on" arrows, ADR 0192 addendum): a `depends-on` join's
477
+ * `dependency` carries `facts`, every dependency fact the link rests on (its repo, id, cited
478
+ * line and every line it rests on, and the coordinates it names), `caller` listing all their
479
+ * lines and `callee` every publishing line: one link per pair of components, holding every
480
+ * coordinate one builds on of the other's. This link is wrong marks each one chosen, so the
481
+ * arrow can't come back from another line, in one POST /api/links/corrections (all or none,
482
+ * for dependency facts as for calls). GET /api/graph/edge-calls gives every join merged into a
483
+ * `depends-on` edge too, not only the 20 a view lists. The facts file stays at version 5 (a
484
+ * pom's `system` scope is recorded as `provided`). Additive only.
485
+ * 3.11.0 (beta.25, review of beta.24's answer boxes): GET /api/trust's `answerBoxes` are only what
486
+ * a person's own words made (answers whose words read as a sentence, and the system of a profile
487
+ * they made), never a system judged by the shape of its id, nor one an option, the picker or an
488
+ * outside system's answer made. POST /api/trust/answer-boxes/ignore and /rename answer a
489
+ * `stamp` (what the files the fix writes held), and take it back with the write: a file changed
490
+ * since the preview is refused (409, nothing written). The write is all or none as far as
491
+ * Atticus can make it (each file locked against its other locking writers, checked, written
492
+ * whole and renamed; a failure puts back only a file that still holds what the fix wrote, leaves
493
+ * one someone else changed, and answers 500 naming the files left written, Problem `written`).
494
+ * A rename to the box's own name, or to another box, is refused (400); a box whose system holds a
495
+ * YAML anchor other lines use, 422. An Ignore's `reason` is at most 300 characters from every
496
+ * caller. Additive only.
457
497
  */
458
- export declare const API_VERSION = "3.10.0";
498
+ export declare const API_VERSION = "3.11.0";
459
499
  export declare const DEFAULT_PORT = 4321;
460
500
  /** RFC 9457 problem details, used for every error. */
461
501
  /**
@@ -484,6 +524,10 @@ export declare const Problem: z.ZodObject<{
484
524
  step: z.ZodLiteral<"sync">;
485
525
  repos: z.ZodArray<z.ZodString>;
486
526
  }, z.core.$strip>>;
527
+ written: z.ZodOptional<z.ZodArray<z.ZodObject<{
528
+ repo: z.ZodOptional<z.ZodString>;
529
+ file: z.ZodString;
530
+ }, z.core.$strip>>>;
487
531
  }, z.core.$strip>;
488
532
  export declare const CatalogRecord: z.ZodUnion<[z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, ...z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>[]]>;
489
533
  export declare const RecordPage: z.ZodObject<{
@@ -815,6 +859,16 @@ export declare const HierJoin: z.ZodObject<{
815
859
  name: z.ZodString;
816
860
  version: z.ZodOptional<z.ZodString>;
817
861
  scope: z.ZodOptional<z.ZodString>;
862
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
863
+ repo: z.ZodString;
864
+ fact: z.ZodString;
865
+ at: z.ZodString;
866
+ lines: z.ZodArray<z.ZodString>;
867
+ group: z.ZodOptional<z.ZodString>;
868
+ name: z.ZodOptional<z.ZodString>;
869
+ version: z.ZodOptional<z.ZodString>;
870
+ scope: z.ZodOptional<z.ZodString>;
871
+ }, z.core.$strip>>>;
818
872
  }, z.core.$strip>>;
819
873
  }, z.core.$strip>;
820
874
  /** Parallel edges between the same two nodes of the same type are one edge with a count. */
@@ -932,6 +986,16 @@ export declare const HierEdge: z.ZodObject<{
932
986
  name: z.ZodString;
933
987
  version: z.ZodOptional<z.ZodString>;
934
988
  scope: z.ZodOptional<z.ZodString>;
989
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
990
+ repo: z.ZodString;
991
+ fact: z.ZodString;
992
+ at: z.ZodString;
993
+ lines: z.ZodArray<z.ZodString>;
994
+ group: z.ZodOptional<z.ZodString>;
995
+ name: z.ZodOptional<z.ZodString>;
996
+ version: z.ZodOptional<z.ZodString>;
997
+ scope: z.ZodOptional<z.ZodString>;
998
+ }, z.core.$strip>>>;
935
999
  }, z.core.$strip>>;
936
1000
  }, z.core.$strip>>>;
937
1001
  }, z.core.$strip>;
@@ -1222,6 +1286,16 @@ export declare const GraphNodeView: z.ZodObject<{
1222
1286
  name: z.ZodString;
1223
1287
  version: z.ZodOptional<z.ZodString>;
1224
1288
  scope: z.ZodOptional<z.ZodString>;
1289
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1290
+ repo: z.ZodString;
1291
+ fact: z.ZodString;
1292
+ at: z.ZodString;
1293
+ lines: z.ZodArray<z.ZodString>;
1294
+ group: z.ZodOptional<z.ZodString>;
1295
+ name: z.ZodOptional<z.ZodString>;
1296
+ version: z.ZodOptional<z.ZodString>;
1297
+ scope: z.ZodOptional<z.ZodString>;
1298
+ }, z.core.$strip>>>;
1225
1299
  }, z.core.$strip>>;
1226
1300
  }, z.core.$strip>>>;
1227
1301
  }, z.core.$strip>>;
@@ -1481,6 +1555,16 @@ export declare const GraphFocusView: z.ZodObject<{
1481
1555
  name: z.ZodString;
1482
1556
  version: z.ZodOptional<z.ZodString>;
1483
1557
  scope: z.ZodOptional<z.ZodString>;
1558
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1559
+ repo: z.ZodString;
1560
+ fact: z.ZodString;
1561
+ at: z.ZodString;
1562
+ lines: z.ZodArray<z.ZodString>;
1563
+ group: z.ZodOptional<z.ZodString>;
1564
+ name: z.ZodOptional<z.ZodString>;
1565
+ version: z.ZodOptional<z.ZodString>;
1566
+ scope: z.ZodOptional<z.ZodString>;
1567
+ }, z.core.$strip>>>;
1484
1568
  }, z.core.$strip>>;
1485
1569
  }, z.core.$strip>>>;
1486
1570
  }, z.core.$strip>>;
@@ -1572,6 +1656,16 @@ export declare const GraphEdgeCallsView: z.ZodObject<{
1572
1656
  name: z.ZodString;
1573
1657
  version: z.ZodOptional<z.ZodString>;
1574
1658
  scope: z.ZodOptional<z.ZodString>;
1659
+ facts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1660
+ repo: z.ZodString;
1661
+ fact: z.ZodString;
1662
+ at: z.ZodString;
1663
+ lines: z.ZodArray<z.ZodString>;
1664
+ group: z.ZodOptional<z.ZodString>;
1665
+ name: z.ZodOptional<z.ZodString>;
1666
+ version: z.ZodOptional<z.ZodString>;
1667
+ scope: z.ZodOptional<z.ZodString>;
1668
+ }, z.core.$strip>>>;
1575
1669
  }, z.core.$strip>>;
1576
1670
  }, z.core.$strip>>;
1577
1671
  }, z.core.$strip>;
@@ -3194,9 +3288,10 @@ export declare const ContractCounts: z.ZodObject<{
3194
3288
  unlinked: z.ZodOptional<z.ZodNumber>;
3195
3289
  }, z.core.$strip>;
3196
3290
  /**
3197
- * 3.10.0 (beta.24 review): a box on the map made from an answer's words, not a system's name (an
3198
- * id of five or more words, or with a sentence's words in it, or a long name with spaces): a
3199
- * system of a profile, the answers to questions about where calls go that name it, or both.
3291
+ * 3.10.0 (beta.24 review): a box on the map made from an answer's words, not a system's name: the
3292
+ * answers to questions about where calls go whose words read as a sentence, and the system of a
3293
+ * profile those words made, if any. 3.11.0 (beta.25): never judged by the shape of an id; a system
3294
+ * an option, the picker or an outside system's answer made (with a host alias) is never one.
3200
3295
  */
3201
3296
  export declare const AnswerBox: z.ZodObject<{
3202
3297
  id: z.ZodString;
@@ -3394,6 +3489,7 @@ export declare const AnswerBoxRequest: z.ZodObject<{
3394
3489
  id: z.ZodString;
3395
3490
  name: z.ZodOptional<z.ZodString>;
3396
3491
  preview: z.ZodOptional<z.ZodLiteral<true>>;
3492
+ stamp: z.ZodOptional<z.ZodString>;
3397
3493
  }, z.core.$strict>;
3398
3494
  export declare const AnswerBoxResult: z.ZodObject<{
3399
3495
  id: z.ZodString;
@@ -3412,6 +3508,7 @@ export declare const AnswerBoxResult: z.ZodObject<{
3412
3508
  }, z.core.$strip>>;
3413
3509
  }, z.core.$strip>>;
3414
3510
  repos: z.ZodArray<z.ZodString>;
3511
+ stamp: z.ZodOptional<z.ZodString>;
3415
3512
  }, z.core.$strip>;
3416
3513
  export type AnswerBoxResultT = z.infer<typeof AnswerBoxResult>;
3417
3514
  /**
@@ -4081,6 +4178,8 @@ export declare const FactCorrectionResult: z.ZodObject<{
4081
4178
  * why for every one (an item's own `reason` first). Every item is checked before any is written;
4082
4179
  * then each repo's corrections file takes its lines in one write.
4083
4180
  */
4181
+ /** 3.11.0: the most calls one POST /api/links/corrections corrects (was 200). */
4182
+ export declare const LINK_CORRECTIONS_MAX = 5000;
4084
4183
  export declare const LinkCorrectionsRequest: z.ZodObject<{
4085
4184
  items: z.ZodArray<z.ZodObject<{
4086
4185
  repo: z.ZodString;
@@ -13453,15 +13552,15 @@ export type KnowledgeAnswerViewT = z.infer<typeof KnowledgeAnswerView>;
13453
13552
  export declare const StoryShapeOp: z.ZodEnum<{
13454
13553
  split: "split";
13455
13554
  add: "add";
13456
- merge: "merge";
13457
13555
  rename: "rename";
13556
+ merge: "merge";
13458
13557
  }>;
13459
13558
  export declare const StoryShapeRequest: z.ZodObject<{
13460
13559
  op: z.ZodEnum<{
13461
13560
  split: "split";
13462
13561
  add: "add";
13463
- merge: "merge";
13464
13562
  rename: "rename";
13563
+ merge: "merge";
13465
13564
  }>;
13466
13565
  story: z.ZodOptional<z.ZodString>;
13467
13566
  stories: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -13477,8 +13576,8 @@ export declare const StoryShapeEntryView: z.ZodObject<{
13477
13576
  op: z.ZodEnum<{
13478
13577
  split: "split";
13479
13578
  add: "add";
13480
- merge: "merge";
13481
13579
  rename: "rename";
13580
+ merge: "merge";
13482
13581
  }>;
13483
13582
  story: z.ZodOptional<z.ZodString>;
13484
13583
  stories: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -13506,8 +13605,8 @@ export declare const StoryShapeView: z.ZodObject<{
13506
13605
  op: z.ZodEnum<{
13507
13606
  split: "split";
13508
13607
  add: "add";
13509
- merge: "merge";
13510
13608
  rename: "rename";
13609
+ merge: "merge";
13511
13610
  }>;
13512
13611
  story: z.ZodOptional<z.ZodString>;
13513
13612
  stories: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -44,10 +44,14 @@ export declare function quoteNotRequired(path: string, line: string): boolean;
44
44
  export declare function isSecretPath(path: string): boolean;
45
45
  /**
46
46
  * Whether a text holds a secret by its shape alone, whatever names it (beta.24 review): a URL's
47
- * password (`jdbc:postgresql://user:pass@host`), a bearer token or one of the well-known token
47
+ * password (`jdbc:postgresql://user:pass@host`), a bearer or Basic token or one of the well-known token
48
48
  * shapes `redactSecrets` takes out. A reference (`${X}`, `env:X`) in the password's place is none.
49
+ * `basic: false` leaves the Basic token out, as beta.24 released the check: the facts schema
50
+ * keeps it so (the verifier and Trust's secrets check take the Basic token).
49
51
  */
50
- export declare function hasSecretShape(text: string): boolean;
52
+ export declare function hasSecretShape(text: string, o?: {
53
+ basic?: boolean;
54
+ }): boolean;
51
55
  /**
52
56
  * Redact the secrets on a line, keeping what names them: a value after a secret-looking key
53
57
  * (at the line's start, whatever the value; anywhere on it, a quoted literal), a setter's
@@ -22,14 +22,41 @@ import type { DependencyScope } from "./schema/facts.js";
22
22
  export interface DependencyEnd extends FactEnd {
23
23
  lines: string[];
24
24
  }
25
+ /**
26
+ * Review of beta.25: one dependency fact a link rests on, with the coordinates it names (a link
27
+ * between two components holds every coordinate one builds on of the other's: `kit-api` and
28
+ * `kit-core` of component `kit` are one arrow).
29
+ */
30
+ export interface DependencyFactEnd extends DependencyEnd {
31
+ group: string;
32
+ name: string;
33
+ version?: string;
34
+ /** Its scope, when not compile. */
35
+ scope?: DependencyScope;
36
+ }
25
37
  export interface DependencyLink {
26
- /** The dependency fact, in the component that builds on the library. */
38
+ /** The dependency fact, in the component that builds on the library (the first by id). */
27
39
  from: DependencyEnd;
40
+ /**
41
+ * Beta.25: every dependency fact the link rests on, `from` first, each with its lines: two
42
+ * module poms of one component, a `<profile>`'s copy, `implementation` and `runtimeOnly` of the
43
+ * same coordinates, and (review of beta.25) every other coordinate of the same library
44
+ * component, each with its coordinates. The link goes only once each of them is wrong.
45
+ */
46
+ facts?: (DependencyEnd & Partial<Pick<DependencyFactEnd, "group" | "name" | "version" | "scope">>)[];
28
47
  /** The artifact fact, in the library's component, that publishes the coordinates. */
29
48
  to: DependencyEnd;
49
+ /**
50
+ * Review of beta.25: every artifact fact of the library's component a dependency on the link
51
+ * names, `to` first (one per coordinate).
52
+ */
53
+ published?: DependencyEnd[];
30
54
  group: string;
31
55
  name: string;
32
- /** The dependency's declared scope, when it says one other than compile. */
56
+ /**
57
+ * The dependency's declared scope, when it says one other than compile; on a link merged from
58
+ * several facts (review of beta.25), only when every one of them has it, else left out.
59
+ */
33
60
  scope?: DependencyScope;
34
61
  /** The version the dependency declares, when it says one. */
35
62
  version?: string;
@@ -51,5 +78,8 @@ export interface DependencyJoinResult {
51
78
  export declare function joinDependencies(input: {
52
79
  repos: readonly JoinRepo[];
53
80
  }): DependencyJoinResult;
54
- /** The id a "depends on" link is known by, for a view's join: stable across reads of one pom. */
81
+ /**
82
+ * The id a "depends on" link is known by, for a view's join: stable across reads of one pom, and
83
+ * (review of beta.25) one per pair of components, as the join makes one link per pair.
84
+ */
55
85
  export declare const dependencyLinkId: (l: Pick<DependencyLink, "from" | "to">) => string;
@@ -73,6 +73,14 @@ export interface JoinRepo {
73
73
  hosts: readonly string[];
74
74
  basePath?: string;
75
75
  }[];
76
+ /**
77
+ * Beta.25 (ADR 0192 addendum): every module the manifest lists, by its folder, hosts or not: a
78
+ * build fact (`artifact`, `dependency`) that names no component is its build file's module's.
79
+ */
80
+ moduleDirs?: readonly {
81
+ path: string;
82
+ component: string;
83
+ }[];
76
84
  /** An API gateway (the manifest's `type: gateway`): its entries are routes it forwards. */
77
85
  gateway?: boolean;
78
86
  /**
@@ -210,7 +218,8 @@ export declare const JOINED_BY_HOST = "joined-by-host";
210
218
  /**
211
219
  * A call whose host nothing resolves, joined to a gateway proxy's flow by its whole path: the one
212
220
  * proxy whose cited `<BasePath>` starts it, the one flow of its method under it. Code at both
213
- * ends: a how, never a guess.
221
+ * ends: a how, never a guess. Beta.25: verified only for a gateway's forwarding call that names
222
+ * no host (a chained proxy); a call whose host nothing resolves is inferred, `joined-by-path` first.
214
223
  */
215
224
  export declare const JOINED_BY_BASE_PATH = "joined-by-base-path";
216
225
  /**
@@ -295,6 +304,8 @@ export interface FactJoin {
295
304
  * A join by path (the join fallback): nobody named the callee, so it is inferred. `within`
296
305
  * says where the one entry that serves the call was found: the caller's own repo first, else
297
306
  * the estate; `named` is the target the call gave, when it named one the estate doesn't have.
307
+ * Beta.25: also a join by a proxy's BasePath (`how: "base-path"`) whose caller's host nothing
308
+ * resolves (`within: "estate"`): the path is code at both ends, the host a guess.
298
309
  */
299
310
  inferred?: {
300
311
  within: "repo" | "estate";
@@ -564,7 +575,8 @@ export declare function gatewayCycleQuestion(f: Call, component: string, gateway
564
575
  * A host's registrable domain (`northwind.example` for `api.northwind.example`,
565
576
  * `northwind.co.uk` for `api.northwind.co.uk`), or undefined for a name the outside rule can't
566
577
  * place: one label, `localhost`, an address, a private or in-cluster name (`.corp`, `.svc`), a
567
- * Service and its namespace (`wallets.payments`). A wildcard and a port are left off.
578
+ * Service and its namespace (`wallets.payments`, `wallets.qa`, `forge-wallets.dev`: two labels
579
+ * whose last is no `PUBLIC_TLDS` name). A wildcard and a port are left off.
568
580
  */
569
581
  export declare function registrableDomain(host: string): string | undefined;
570
582
  /**
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  import type { CatalogRecord } from "./catalog.js";
2
3
  import { Fact, type FactOf } from "./schema/facts.js";
3
4
  /**
@@ -14,14 +15,48 @@ export interface FactIssue {
14
15
  code: string;
15
16
  message: string;
16
17
  }
18
+ /**
19
+ * A fact of a kind this Atticus doesn't know (beta.25, ADR 0192 addendum): a newer Atticus wrote
20
+ * it. It is left out of what is read, and said, rather than refusing the whole file; whoever
21
+ * writes the file back must keep it (or not write), since it is a teammate's fact.
22
+ */
23
+ export interface NewerFact {
24
+ line?: number;
25
+ factId: string;
26
+ kind: string;
27
+ message: string;
28
+ /** The line as written (a line-by-line read), for a writer to keep it as it is. */
29
+ raw?: string;
30
+ }
17
31
  export type ParseFactsResult = {
18
32
  ok: true;
19
33
  facts: Fact[];
34
+ /** Beta.25: the facts of kinds a newer Atticus wrote, left out of `facts`. */
35
+ newer?: NewerFact[];
20
36
  } | {
21
37
  ok: false;
22
38
  issues: FactIssue[];
23
39
  };
40
+ /** A JSON value that is a fact of a kind this Atticus doesn't know, said as one; else undefined. */
41
+ export declare function newerFactOf(json: unknown, line?: number): NewerFact | undefined;
42
+ /**
43
+ * Review of beta.25: a fact of a kind this Atticus knows that a newer Atticus wrote: every reason
44
+ * it doesn't read is a field this Atticus doesn't know (a name as Atticus writes them, never a
45
+ * slip of one the kind has: `nearFieldOf`) or a value of one of its lists it doesn't know (a
46
+ * lowercase word more than two edits from each of the list's values, as `scope: "shaded"`; never
47
+ * `scope: "system"`, which is recorded as provided). Said as such, so the fact is left out on its
48
+ * own and kept as written; anything else wrong is a wrong fact, refused for the assistant to fix.
49
+ */
50
+ export declare function newerShapeOf(json: unknown, issues: readonly z.core.$ZodIssue[], line?: number): NewerFact | undefined;
24
51
  export declare function parseFacts(text: string): ParseFactsResult;
52
+ /**
53
+ * A facts file's line as it may be kept where people read it (`<repo>.rejected.jsonl`), beta.25
54
+ * review: a config fact any of whose fields carries a secret (`configSecretField`, beta.24's value
55
+ * check included, or a quote `redactSecrets` changes) has its value, source, parts and quote
56
+ * redacted, the rest kept as written. A line that isn't JSON is redacted as a line of code is,
57
+ * and any quoted literal that reads as a credential goes too. Anything else is kept as it is.
58
+ */
59
+ export declare function redactFactLine(raw: string): string;
25
60
  /** A line of a facts file that isn't a fact, with its number, its text and what is wrong. */
26
61
  export type BadFactLine = {
27
62
  line: number;
@@ -37,6 +72,7 @@ export type BadFactLine = {
37
72
  export declare function parseFactLine(raw: string, line: number, seen: Set<string>): {
38
73
  fact?: Fact;
39
74
  bad?: BadFactLine;
75
+ newer?: NewerFact;
40
76
  };
41
77
  /**
42
78
  * Read a JSONL facts file line by line, keeping every line that reads and returning the others
@@ -49,6 +85,8 @@ export declare function parseFactLine(raw: string, line: number, seen: Set<strin
49
85
  export declare function parseFactsLines(text: string): {
50
86
  facts: Fact[];
51
87
  bad: BadFactLine[];
88
+ /** Beta.25: facts of kinds a newer Atticus wrote, left out of `facts` (`newerFactOf`). */
89
+ newer: NewerFact[];
52
90
  };
53
91
  /** One canonical JSON line per fact, sorted by id; the same facts give the same bytes. */
54
92
  export declare function serializeFacts(facts: readonly Fact[]): string;
@@ -71,6 +109,27 @@ export interface ProjectResult {
71
109
  export declare const factIdPart: (text: string) => string;
72
110
  /** The Endpoint id an entry fact projects to in its component (`projectFacts`). */
73
111
  export declare function entryEndpointId(f: FactOf<"entry">, component: string): string;
112
+ /**
113
+ * The component a fact is placed in that names one its repo's manifest doesn't have (review of
114
+ * beta.25, ADR 0192 addendum §2): a repo whose manifest entry lists no modules ships as its one
115
+ * component, so a fact (an entry, a call, a store, any but a build's coordinates, which the
116
+ * verifier refuses instead) naming a component that is neither the repo's own nor one the
117
+ * manifest names anywhere (`ledger-api`, a folder's name) is the repo's component's, and its
118
+ * endpoints are in the box its depends-on arrow starts from. Undefined when the fact stays as it
119
+ * is: it names none, or one the manifest names, or the repo lists modules, or it is a prototype
120
+ * (ADR 0133: its UI, BFF and mocks are components of their own, read and compared, never
121
+ * written into the catalog).
122
+ */
123
+ export declare function placedComponentOf(f: Fact, manifest: {
124
+ /** The repo's own component (the manifest's `component`, else its id). */
125
+ component: string;
126
+ /** The repo's modules as the manifest lists them. */
127
+ modules?: readonly unknown[] | undefined;
128
+ /** Every component (and repo id) the estate's manifests name. */
129
+ components: readonly string[];
130
+ /** The repo is a prototype (its manifest `type`). */
131
+ prototype?: boolean | undefined;
132
+ }): string | undefined;
74
133
  /**
75
134
  * A call's normalised path: a gRPC method stays `package.Service/Method` and a SOAP operation
76
135
  * `Contract/Operation` (a client may write either with a leading slash); an HTTP path loses a parameter's optional marker and constraint first
@@ -1,3 +1,4 @@
1
+ import { type Document } from "yaml";
1
2
  import { type LineChange } from "./manifest-edit.js";
2
3
  /**
3
4
  * Which repo answers on a host (ADR 0088): a scan or atticus estate join asks, as a question
@@ -61,6 +62,8 @@ export declare const ignoreOption: () => {
61
62
  means: string;
62
63
  changes: string;
63
64
  };
65
+ /** Beta.25: the longest reason an Ignore keeps, as the local API takes it. */
66
+ export declare const IGNORE_REASON_MAX = 300;
64
67
  /** An Ignore answer's words: `Ignore: <reason>`. */
65
68
  export declare const ignoreText: (reason: string) => string;
66
69
  /**
@@ -81,25 +84,66 @@ export declare function ignoredAnswer(q: {
81
84
  } | undefined;
82
85
  /** The longest name an outside system an answer adds may have. */
83
86
  export declare const SYSTEM_NAME_MAX = 40;
87
+ /**
88
+ * Beta.25 (review of beta.24): whether a system's name reads as a sentence: by its words only,
89
+ * two or more of a sentence's small words ("ignore this, its cicd related"). Never by its marks:
90
+ * a real system's name may have a comma, a full stop or a `!` in it ("Northwind, Inc.", "Harbor
91
+ * Co."), and a profile holds what its people wrote.
92
+ */
93
+ export declare function nameReadsAsSentence(name: string): boolean;
94
+ /**
95
+ * Beta.25 (review of beta.24): whether words read as a sentence rather than a name: a sentence's
96
+ * marks (a comma, a semicolon, `!`, `?`, a quote, or a full stop that ends a word: never the dots
97
+ * of a host), or two or more of a sentence's small words ("ignore this, its cicd related"). A name
98
+ * of any length in words ("Payments API Gateway North East") is a name, and so is one with a
99
+ * single small word in it ("IT Service Desk", "Plan A").
100
+ */
101
+ export declare function readsAsSentence(words: string): boolean;
84
102
  /**
85
103
  * Why words can't be a new outside system's name (beta.24 review), or undefined when they can: a
86
- * short name of letters, digits, spaces and dashes, at most 40 characters, not a sentence (four
87
- * words at most, none of "ignore", "this", "is", "a", "to", "the", "related", "not", "it").
104
+ * short name of letters, digits, spaces and dashes, at most 40 characters, that doesn't read as a
105
+ * sentence (`readsAsSentence`). Lenient for names: "IT Service Desk", "Plan A" and a five-word
106
+ * name are names.
88
107
  */
89
108
  export declare function systemNameProblem(name: string): string | undefined;
109
+ /** The names Atticus knows a target by (`knownTargetNames`). */
110
+ export interface KnownTargets {
111
+ ids: Set<string>;
112
+ names: Set<string>;
113
+ /**
114
+ * Beta.25: the profiles' systems' names exactly, lower case, marks and all ("northwind, inc."),
115
+ * of those whose name isn't a sentence by its words (`nameReadsAsSentence`).
116
+ */
117
+ systemNames?: Set<string>;
118
+ }
119
+ /**
120
+ * Beta.25: the names Atticus knows a target by, as `namesKnownTarget` reads them: `ids` the ids
121
+ * (repos, components, a system's id, alias or topic, teams) exactly, lower case; `names` those and
122
+ * the systems' names, each also as the id it slugs to; `systemNames` the systems' names exactly.
123
+ * Systems whose id is in `except` are left out (the boxes an answer's words made, which name
124
+ * nothing real).
125
+ */
126
+ export declare function knownTargetNames(root: string, o?: {
127
+ except?: ReadonlySet<string>;
128
+ }): Promise<Required<KnownTargets>>;
90
129
  /**
91
- * Beta.24 review: whether a system (its id, and its name when it has one) looks made from an
92
- * answer's words rather than named: an id of five or more dash-separated words, or with a word
93
- * of a sentence in it, or a name with spaces longer than 40 characters.
130
+ * Whether words name a target of `knownTargetNames`: a profile system's name exactly, case aside
131
+ * (beta.25: "Northwind, Inc." names the system so named, its marks and all); else case and spacing
132
+ * aside, or by the id they slug to; words that read as a sentence only when they are an id exactly
133
+ * (a sentence is never a system's name, even one an answer's words once wrote into a profile).
94
134
  */
95
- export declare function madeFromWords(id: string, name?: string): boolean;
135
+ export declare function namesKnown(known: KnownTargets, words: string): boolean;
96
136
  /**
97
137
  * Beta.24 review: whether words name a repo, component, system or team Atticus knows, as an
98
138
  * answer about where calls go may: a repo of the manifests (its id, component or a module's
99
139
  * component), a system of the profiles (its id, name, an alias or a topic), a team of roles.yaml,
100
140
  * or a component a repo's facts name. Case and spacing aside, or by the id the words slug to.
141
+ * Beta.25: words that read as a sentence name only an id they are exactly, and the systems in
142
+ * `except` (the boxes an answer's words made) are none.
101
143
  */
102
- export declare function namesKnownTarget(root: string, words: string): Promise<boolean>;
144
+ export declare function namesKnownTarget(root: string, words: string, o?: {
145
+ except?: ReadonlySet<string>;
146
+ }): Promise<boolean>;
103
147
  /**
104
148
  * Beta.24 review: the refusal of words that name no repo, component or system as the answer of a
105
149
  * question about where calls go, in a person's words: what to do instead.
@@ -130,7 +174,9 @@ export declare function hostOfQuestion(q: {
130
174
  * Beta.24 review: the host a targets question the join raised for a host nothing resolves asks
131
175
  * about (a gateway's forwarding call whose target URL is a token, `@targetUrl@`): its words start
132
176
  * as a hosts question's do, and may go on to say what to do next (`forwardHostQuestion`). A
133
- * targets question asked of a call (`Which repo or system answers ...`) has none.
177
+ * targets question asked of a call (`Which repo or system answers ...`) has none. Beta.25: the
178
+ * host up to the first `?` that ends the question, so a token with spaces in it (`{{ vendor_url
179
+ * }}`, as `forwardHostQuestion` writes it) is read back whole.
134
180
  */
135
181
  export declare function joinHostOfQuestion(q: {
136
182
  question: string;
@@ -144,6 +190,21 @@ export declare function outsideSystemOfJoinHost(host: string): {
144
190
  id: string;
145
191
  name: string;
146
192
  };
193
+ /**
194
+ * Beta.25 (review of beta.24): the one way every profile edit is written (an outside system, a
195
+ * system a person named, a box put right), so a preview shows only the lines that really change:
196
+ * no line folded (`lineWidth: 0`), flow collections padded as the file pads them (`[ a ]` or
197
+ * `[a]`), and each line the edit didn't change kept exactly as the file had it (the library pads
198
+ * a file's maps and lists alike, so a file that mixes `{ a: 1 }` with `[b]` keeps both). LF only;
199
+ * the caller writes it in the file's own line endings.
200
+ */
201
+ export declare function profileText(doc: Document, before: string | undefined): string;
202
+ /**
203
+ * Beta.25 (review of beta.24): a profile edit Atticus doesn't make, said in a person's words (the
204
+ * local API answers 422): the file stays as it is, for a person to change by hand.
205
+ */
206
+ export declare class ProfileEditError extends Error {
207
+ }
147
208
  /**
148
209
  * Put an outside system for a host into the profile whose repos.manifest.yaml lists the repo
149
210
  * that asked (O1): its id and name from the host, the host as its alias, the boundary given
@@ -184,11 +245,21 @@ export declare function addProfileSystem(root: string, repo: string, s: {
184
245
  topics?: string[];
185
246
  /** The lines a new system changes in the profile (as the write makes them). */
186
247
  changes?: LineChange[];
248
+ /**
249
+ * Beta.25: for a new system, the file, the text it was read as (undefined: none yet) and the
250
+ * text written (or, previewed, to write), so a caller can write it with others, all or none.
251
+ */
252
+ write?: {
253
+ file: string;
254
+ before: string | undefined;
255
+ after: string;
256
+ };
187
257
  }>;
188
258
  /**
189
259
  * Beta.24 review: take a system out of the profile that has it, or (with `rename`) give it another
190
- * id and name, keeping its other fields, the file's comments and its order. For a system an
191
- * answer's words made (`madeFromWords`), from Map › Trust: written as a file change in the
260
+ * id and name, keeping its other fields, the file's comments and its order (a comment above a
261
+ * system taken out stays, above the next). For a system an answer's words made (a box on Map ›
262
+ * Trust): written as a file change in the
192
263
  * metarepo, for review in the pull request. `preview` writes nothing. Undefined when no profile
193
264
  * has the system. Throws when the profile would not be valid (the new id another system has).
194
265
  */
@@ -202,6 +273,10 @@ export declare function editProfileSystem(root: string, id: string, o?: {
202
273
  profile: string;
203
274
  changes: LineChange[];
204
275
  written: boolean;
276
+ /** Beta.25: the file, the text it was read as and the text written (or to write). */
277
+ file: string;
278
+ before: string;
279
+ after: string;
205
280
  } | undefined>;
206
281
  /**
207
282
  * Put a host under a repo's `hosts` in the repos.manifest.yaml that lists it, keeping the
@@ -1,20 +1,4 @@
1
- /**
2
- * Normalise an HTTP path or topic so the same interface found in different places
3
- * (caller code, gateway route, callee controller) gets the same identity.
4
- *
5
- * - path parameters in any style ({id}, :id, <id>, ${id}) become "{}"
6
- * - query strings and fragments are dropped
7
- * - repeated and trailing slashes are removed; a leading slash is ensured for paths
8
- * - topics (no leading slash in the input and no "/" at all) are returned trimmed
9
- */
10
- export declare function normalizePath(input: string): string;
11
- /**
12
- * A path with each `{...}` parameter cut to its name: what follows the first `:`, `?` or `=` in
13
- * braces nested inside a constraint (`{code:regex(^\\d{3}$)}`) are matched, not cut at the first `}`.
14
- * braces nested inside a constraint (`{code:regex(^\\d{{3}}$)}`) are matched, not cut at the first `}`.
15
- * An unclosed `{` leaves the rest as written.
16
- */
17
- export declare function stripParamConstraints(path: string): string;
1
+ export { normalizePath, stripParamConstraints } from "./paths.js";
18
2
  /** Code-unit string order, the same in every locale (`localeCompare` is not: ICU orders `_`/`-`
19
3
  * and, in `da`, `aa` differently), for every sort that feeds records, ids, hashes or a merge. */
20
4
  export declare function cmpText(a: string, b: string): number;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `@maycombhq/core/paths`: how the join normalises an HTTP path or a topic, with no imports, so
3
+ * the app (a browser bundle that takes nothing else of core at run time) matches a call's path to
4
+ * a link's exactly as the join made the link (review of beta.24). The same export as the
5
+ * package's own (`@maycombhq/core`).
6
+ */
7
+ /**
8
+ * Normalise an HTTP path or topic so the same interface found in different places
9
+ * (caller code, gateway route, callee controller) gets the same identity.
10
+ *
11
+ * - path parameters in any style ({id}, :id, <id>, ${id}) become "{}"
12
+ * - query strings and fragments are dropped
13
+ * - repeated and trailing slashes are removed; a leading slash is ensured for paths
14
+ * - topics (no leading slash in the input and no "/" at all) are returned trimmed
15
+ */
16
+ export declare function normalizePath(input: string): string;
17
+ /**
18
+ * A path with each `{...}` parameter cut to its name: what follows the first `:`, `?` or `=` in
19
+ * braces nested inside a constraint (`{code:regex(^\\d{3}$)}`) are matched, not cut at the first `}`.
20
+ * braces nested inside a constraint (`{code:regex(^\\d{{3}}$)}`) are matched, not cut at the first `}`.
21
+ * An unclosed `{` leaves the rest as written.
22
+ */
23
+ export declare function stripParamConstraints(path: string): string;
@@ -424,6 +424,12 @@ export declare const DeployFact: z.ZodObject<{
424
424
  * 4 (ADR 0180): the `component` kind, what a component is.
425
425
  * 5 (ADR 0192): the `artifact` and `dependency` kinds, a component's build coordinates and what
426
426
  * it builds on. A version-4 file reads unchanged: both are new kinds, nothing else moved.
427
+ *
428
+ * ADR 0192 addendum (beta.25), no version change: a pom's `<scope>system</scope>` is recorded as
429
+ * `provided` (it is drawn so), so 2.0.0-beta.25 reads every file 2.0.0-beta.25 writes. A reader of
430
+ * beta.25 or later leaves out, one fact at a time, a fact a newer Atticus wrote (a kind it doesn't
431
+ * know, or a known kind with a value or a field it doesn't), said as such (`parseFacts`' `newer`),
432
+ * rather than refusing the whole file, and `atticus verify --write` keeps that line as written.
427
433
  */
428
434
  export declare const FACTS_SCHEMA_VERSION: 5;
429
435
  export declare const SETTING_KINDS: readonly ["timeout", "retry", "circuit-breaker", "rate-limit", "pool", "cache-ttl", "feature-flag", "config", "schedule"];
@@ -433,6 +439,43 @@ export declare const SETTING_KINDS: readonly ["timeout", "retry", "circuit-break
433
439
  * secret lives nor a flag or a mode.
434
440
  */
435
441
  export declare function looksLikeSecret(key: string, value: string | undefined): boolean;
442
+ /**
443
+ * Whether a literal under a secret's key reads as a credential (`configSecretField`): token-like,
444
+ * no name as people write them (`NAME_LIKE`), and strong enough (`credentialStrength`).
445
+ */
446
+ export declare function credentialLike(t: string): boolean;
447
+ /**
448
+ * Beta.25 review: where a config fact carries its setting's secret, the field that does
449
+ * (`value`, `source` or `cite.with`), or undefined. The verifier refuses such a fact
450
+ * (`secret-value`); the schema keeps only beta.24's value check, as released, so a facts file
451
+ * read before is read the same (ADR 0124 addendum A-gateway-outside-2).
452
+ *
453
+ * A value is one when its key names a secret (`looksLikeSecret`) or it is shaped like one
454
+ * (`hasSecretShape`, a Basic token too). A source or a part is one when it is shaped like a
455
+ * secret whatever the key. Under a key that names a secret, a value, a source or a part with a
456
+ * placeholder whose default is a literal (`${DB_PASSWORD:hunter22}`) is one; a source is one
457
+ * when it is no reference (`isReference`), no name as code writes one (`identifierName`) and no
458
+ * name of the fact's own, however weak (`hunter22`, `Summer2024!`); and a part is one when it
459
+ * is a literal that reads as a credential (`credentialLike`) or a password by its marks
460
+ * (`Summer2024!`; a weak word with digits, `hunter22`, is shaped as a hash or a version is, so
461
+ * a part like it is not refused here, and the verifier's messages never quote it) and is no
462
+ * name of the fact's own:
463
+ * its key or a name in it, its target with or without its extension, its env, or a name its
464
+ * source gives (the part `northwind-oauth2` of `secretKeyRef:northwind-oauth2/client-secret`).
465
+ * A quote is the verifier's to redact, as it always was. The answer never repeats the value.
466
+ */
467
+ export declare function configSecretField(c: {
468
+ key: string;
469
+ value?: string | undefined;
470
+ source?: string | undefined;
471
+ target?: string | undefined;
472
+ env?: string | undefined;
473
+ cite: {
474
+ with?: readonly {
475
+ value: string;
476
+ }[] | undefined;
477
+ };
478
+ }): "value" | "source" | "cite.with" | undefined;
436
479
  export declare const ConfigFact: z.ZodObject<{
437
480
  settingKind: z.ZodDefault<z.ZodEnum<{
438
481
  config: "config";
@@ -814,7 +857,11 @@ export declare const ArtifactFact: z.ZodObject<{
814
857
  }>>;
815
858
  kind: z.ZodLiteral<"artifact">;
816
859
  }, z.core.$strict>;
817
- /** A dependency's scope (ADR 0192): Maven's, or what a Gradle configuration means. */
860
+ /**
861
+ * A dependency's scope (ADR 0192): Maven's, or what a Gradle configuration means. A pom's
862
+ * `<scope>system</scope>` (a jar from a path on the machine) is recorded as `provided`, which is
863
+ * how it is drawn (ADR 0192 addendum).
864
+ */
818
865
  export declare const DEPENDENCY_SCOPES: readonly ["compile", "runtime", "provided", "test", "import"];
819
866
  export type DependencyScope = (typeof DEPENDENCY_SCOPES)[number];
820
867
  /**
package/npm/index.js CHANGED
@@ -1207,8 +1207,7 @@ var init_question = __esm({
1207
1207
  }
1208
1208
  });
1209
1209
 
1210
- // packages/core/dist/identity.js
1211
- import { createHash } from "node:crypto";
1210
+ // packages/core/dist/paths.js
1212
1211
  function normalizePath(input) {
1213
1212
  const trimmed = input.trim();
1214
1213
  if (trimmed === "")
@@ -1248,6 +1247,14 @@ function stripParamConstraints(path) {
1248
1247
  }
1249
1248
  return out;
1250
1249
  }
1250
+ var init_paths = __esm({
1251
+ "packages/core/dist/paths.js"() {
1252
+ "use strict";
1253
+ }
1254
+ });
1255
+
1256
+ // packages/core/dist/identity.js
1257
+ import { createHash } from "node:crypto";
1251
1258
  function interfaceId(from, to, method, path) {
1252
1259
  const key = [from, to, (method ?? "").toUpperCase(), normalizePath(path)].join("|");
1253
1260
  return "if-" + createHash("sha256").update(key, "utf8").digest("hex").slice(0, 16);
@@ -1255,6 +1262,8 @@ function interfaceId(from, to, method, path) {
1255
1262
  var init_identity = __esm({
1256
1263
  "packages/core/dist/identity.js"() {
1257
1264
  "use strict";
1265
+ init_paths();
1266
+ init_paths();
1258
1267
  }
1259
1268
  });
1260
1269
 
@@ -1377,8 +1386,8 @@ function parseTemplate(template) {
1377
1386
  return parts;
1378
1387
  }
1379
1388
  function templateSources(template) {
1380
- const all2 = (x) => x.type === "lookup" ? [x, ...all2(x.key.source)] : [x];
1381
- return parseTemplate(template).flatMap((p2) => "expr" in p2 ? all2(p2.expr.source) : []);
1389
+ const all3 = (x) => x.type === "lookup" ? [x, ...all3(x.key.source)] : [x];
1390
+ return parseTemplate(template).flatMap((p2) => "expr" in p2 ? all3(p2.expr.source) : []);
1382
1391
  }
1383
1392
  var TEMPLATE_FILTERS, TemplateError, IDENT, KEY, BUILTIN;
1384
1393
  var init_template = __esm({
@@ -4549,6 +4558,7 @@ var SETTER_LITERAL = new RegExp(`(\\b(?:set|with)[A-Za-z0-9_]*?${SECRET_WORDS}\\
4549
4558
  var KEY_BARE = new RegExp(`((?:\\bexport\\s+|--|[?&;])[A-Za-z0-9_.-]*?${SECRET_WORDS}\\s*=\\s*)([^\\s&;"'\`]+)`, "gi");
4550
4559
  var URL_CREDENTIALS = /\b([a-z][a-z0-9+.-]*:\/\/[^\s:@/]+:)([^\s@/]+)(?=@)/gi;
4551
4560
  var BEARER = /\b(Bearer\s+)([A-Za-z0-9._~+/-]{16,}=*)/g;
4561
+ var BASIC = /\b(Basic\s+)((?=[A-Za-z0-9+/]*[0-9+/=])[A-Za-z0-9+/]{12,}={0,2})/g;
4552
4562
  var TOKEN_SHAPES = [
4553
4563
  /\bgh[pousr]_[A-Za-z0-9]{20,}/g,
4554
4564
  /\bgithub_pat_[A-Za-z0-9_]{20,}/g,
@@ -4558,12 +4568,14 @@ var TOKEN_SHAPES = [
4558
4568
  /\bAIza[0-9A-Za-z_-]{35}/g,
4559
4569
  /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g
4560
4570
  ];
4561
- function hasSecretShape(text3) {
4571
+ function hasSecretShape(text3, o = {}) {
4562
4572
  for (const m of text3.matchAll(URL_CREDENTIALS))
4563
4573
  if (!refersOnly(m[2]))
4564
4574
  return true;
4565
4575
  if (new RegExp(BEARER.source).test(text3))
4566
4576
  return true;
4577
+ if (o.basic !== false && new RegExp(BASIC.source).test(text3))
4578
+ return true;
4567
4579
  return TOKEN_SHAPES.some((re) => new RegExp(re.source).test(text3));
4568
4580
  }
4569
4581
  var placeholder = (v) => PLACEHOLDER.test(v.trim().replace(/^["'`]/, ""));
@@ -4614,7 +4626,12 @@ var common = {
4614
4626
  id: FactId,
4615
4627
  repo: str2(),
4616
4628
  commit: z3.string().regex(/^[0-9a-f]{7,64}$/),
4617
- /** The module in the repo the fact belongs to; the repo itself when left out. */
4629
+ /**
4630
+ * The component the fact belongs to: the component the manifest names (a module only when the
4631
+ * manifest lists modules); the repo's own when left out. Review of beta.25: in a repo whose
4632
+ * manifest lists no modules, one the manifest doesn't name (a folder's) is placed in the repo's
4633
+ * component (`placedComponentOf`), with a note.
4634
+ */
4618
4635
  component: z3.string().optional(),
4619
4636
  cite: Cite,
4620
4637
  verified: FactVerified.default("none"),
@@ -4813,6 +4830,32 @@ function namesOfKey(key) {
4813
4830
  function looksLikeSecret(key, value) {
4814
4831
  return value !== void 0 && namesOfKey(key).some((n) => SECRET_KEY.test(n)) && !SECRET_SOURCE.test(value) && !NOT_A_SECRET.test(value.trim());
4815
4832
  }
4833
+ var REFERENCE_SCHEMES = /* @__PURE__ */ new Set([
4834
+ "env",
4835
+ "vault",
4836
+ "secret",
4837
+ "ref",
4838
+ "secretkeyref",
4839
+ "configmapkeyref",
4840
+ "file",
4841
+ "kvm"
4842
+ ]);
4843
+ var PLACEHOLDER_SCHEMES = /* @__PURE__ */ new Set([
4844
+ ...REFERENCE_SCHEMES,
4845
+ "ssm",
4846
+ "sm",
4847
+ "secretsmanager",
4848
+ "aws",
4849
+ "azure",
4850
+ "keyvault",
4851
+ "gcp",
4852
+ "k8s",
4853
+ "cf",
4854
+ "opt",
4855
+ "self",
4856
+ "sys",
4857
+ "param"
4858
+ ]);
4816
4859
  var ConfigFact = z3.strictObject({
4817
4860
  kind: z3.literal("config"),
4818
4861
  ...common,
@@ -4833,7 +4876,7 @@ var ConfigFact = z3.strictObject({
4833
4876
  path: ["value"],
4834
4877
  message: `"${c.key}" looks like a secret: give its source (env:NAME, vault:path), never its value`
4835
4878
  });
4836
- } else if (c.value !== void 0 && hasSecretShape(c.value)) {
4879
+ } else if (c.value !== void 0 && hasSecretShape(c.value, { basic: false })) {
4837
4880
  ctx.addIssue({
4838
4881
  code: "custom",
4839
4882
  path: ["value"],
@@ -5241,9 +5284,10 @@ init_common();
5241
5284
  // packages/core/dist/facts.js
5242
5285
  init_common();
5243
5286
  init_kinds();
5287
+ var KNOWN_KINDS = new Set(FACT_KINDS);
5244
5288
 
5245
5289
  // packages/core/dist/host-questions.js
5246
- import { isMap as isMap4, isSeq as isSeq2, parseDocument as parseDocument4, YAMLSeq } from "yaml";
5290
+ import { isAlias, isMap as isMap4, isNode, isSeq as isSeq2, parseDocument as parseDocument4, visit, YAMLSeq } from "yaml";
5247
5291
 
5248
5292
  // packages/core/dist/fs.js
5249
5293
  init_kept_files();
@@ -5274,6 +5318,7 @@ import { isMap as isMap3, parseDocument as parseDocument3 } from "yaml";
5274
5318
  // packages/core/dist/host-questions.js
5275
5319
  init_orgpack();
5276
5320
  init_workspace();
5321
+ var IGNORE_REASON_MAX = 300;
5277
5322
 
5278
5323
  // packages/core/dist/facts-join.js
5279
5324
  init_identity();
@@ -5838,7 +5883,12 @@ var Problem = z30.object({
5838
5883
  /** For 403s on gated actions: who can act, e.g. "Needs an architect: R. Patel". */
5839
5884
  needs: z30.object({ role: z30.string(), names: z30.array(z30.string()) }).optional(),
5840
5885
  /** 3.9.0: what the app offers next, e.g. Sync the repos with no base clone here. */
5841
- next: NextStep.optional()
5886
+ next: NextStep.optional(),
5887
+ /**
5888
+ * 3.11.0 (beta.25): for a 500 that wrote only part of what was asked, the files left written
5889
+ * (each in the metarepo, or in `repo`'s working copy), so the app reads them again.
5890
+ */
5891
+ written: z30.array(z30.object({ repo: z30.string().optional(), file: z30.string() })).optional()
5842
5892
  });
5843
5893
  var Kind3 = z30.enum(RECORD_KINDS);
5844
5894
  var CatalogRecord2 = z30.union(RECORD_KINDS.map((k) => RECORD_SCHEMAS[k]));
@@ -5994,7 +6044,8 @@ var HierJoin = z30.object({
5994
6044
  run: z30.string().optional(),
5995
6045
  /**
5996
6046
  * 3.10.0 (ADR 0192): on a `depends-on` edge's join (`how: coordinates`), the coordinates the
5997
- * dependency names and the library publishes, and its scope when not compile. `interface` is
6047
+ * dependency names and the library publishes, and its scope when not compile (review of
6048
+ * beta.25: on a link of several facts, only when every one has it). `interface` is
5998
6049
  * then the link's own id (`depends-on:<repo>/<component>><repo>/<component>`, no Interface
5999
6050
  * record), `caller` the dependency's lines in the depending build file, `callee` the lines that
6000
6051
  * publish the coordinates. Left out on a call's join.
@@ -6003,7 +6054,24 @@ var HierJoin = z30.object({
6003
6054
  group: z30.string(),
6004
6055
  name: z30.string(),
6005
6056
  version: z30.string().optional(),
6006
- scope: z30.string().optional()
6057
+ scope: z30.string().optional(),
6058
+ /**
6059
+ * 3.11.0: every dependency fact the link rests on, the first (`caller`'s first line) first:
6060
+ * its repo, its id, its cited line (`file:line`) and every line it rests on, and the
6061
+ * coordinates it names (`group`, `name`, its `version` and `scope` when said): a link is
6062
+ * one per pair of components, so it holds every coordinate one builds on of the other's
6063
+ * (`group` and `name` above are the first's).
6064
+ */
6065
+ facts: z30.array(z30.object({
6066
+ repo: z30.string(),
6067
+ fact: z30.string(),
6068
+ at: z30.string(),
6069
+ lines: z30.array(z30.string()),
6070
+ group: z30.string().optional(),
6071
+ name: z30.string().optional(),
6072
+ version: z30.string().optional(),
6073
+ scope: z30.string().optional()
6074
+ })).optional()
6007
6075
  }).optional()
6008
6076
  });
6009
6077
  var HierEdge = z30.object({
@@ -6608,7 +6676,12 @@ var AnswerBoxRequest = z30.strictObject({
6608
6676
  id: z30.string().trim().min(1).max(200),
6609
6677
  /** For rename: the repo or system it is, or a new outside system's name. */
6610
6678
  name: z30.string().trim().min(1).max(200).optional(),
6611
- preview: z30.literal(true).optional()
6679
+ preview: z30.literal(true).optional(),
6680
+ /**
6681
+ * 3.11.0 (beta.25): the preview's `stamp`. A write with it is refused (409, nothing written)
6682
+ * when a file the fix writes changed since that preview.
6683
+ */
6684
+ stamp: z30.string().trim().min(1).max(100).optional()
6612
6685
  });
6613
6686
  var AnswerBoxResult = z30.object({
6614
6687
  id: z30.string(),
@@ -6621,7 +6694,12 @@ var AnswerBoxResult = z30.object({
6621
6694
  changes: z30.array(z30.object({ was: z30.string().optional(), now: z30.string().optional() }))
6622
6695
  }).optional(),
6623
6696
  /** The repos whose answers changed: Apply (verify --write) puts them on the map. */
6624
- repos: z30.array(z30.string())
6697
+ repos: z30.array(z30.string()),
6698
+ /**
6699
+ * 3.11.0 (beta.25): what the files the fix writes held when it was worked out, to send back
6700
+ * with the write (`stamp`), so the write is the one previewed.
6701
+ */
6702
+ stamp: z30.string().optional()
6625
6703
  });
6626
6704
  var FreshState = z30.enum([
6627
6705
  /** Facts cite files that changed, or source files changed: read again. */
@@ -6825,6 +6903,7 @@ var FactCorrectionResult = z30.object({
6825
6903
  /** 2.42.0 (ADR 0149): the line appended to the file, exactly as written. */
6826
6904
  line: z30.string().optional()
6827
6905
  });
6906
+ var LINK_CORRECTIONS_MAX = 5e3;
6828
6907
  var LinkCorrectionsRequest = z30.strictObject({
6829
6908
  items: z30.array(z30.strictObject({
6830
6909
  repo: z30.string().min(1),
@@ -6832,7 +6911,7 @@ var LinkCorrectionsRequest = z30.strictObject({
6832
6911
  action: z30.enum(["wrong", "edit"]),
6833
6912
  set: z30.record(z30.string().min(1), z30.string()).optional(),
6834
6913
  reason: z30.string().trim().min(1).max(500).optional()
6835
- })).min(1).max(200),
6914
+ })).min(1).max(LINK_CORRECTIONS_MAX),
6836
6915
  reason: z30.string().trim().min(1).max(500).optional()
6837
6916
  });
6838
6917
  var LinkCorrectionsResult = z30.object({
@@ -6848,8 +6927,9 @@ var LinkCorrectionsResult = z30.object({
6848
6927
  /** The commands that apply them, one per repo. */
6849
6928
  verify: z30.array(z30.string()),
6850
6929
  /**
6851
- * Review of beta.24: the items left out because the newest correction on file for that fact
6852
- * says the same already (asked again, nothing is written twice).
6930
+ * Review of beta.24: the items left out because the correction on file that the fact meets
6931
+ * now says the same already (asked again, nothing is written twice; 3.11.0: one for a line the
6932
+ * fact has left meets nothing).
6853
6933
  */
6854
6934
  skipped: z30.array(z30.object({ repo: z30.string(), fact: z30.string() })).optional()
6855
6935
  });
@@ -8492,7 +8572,7 @@ var AnswerQuestionRequest = z30.strictObject({
8492
8572
  * text and target; `reason` is kept as the answer's words (`Ignore: <reason>`).
8493
8573
  */
8494
8574
  ignore: z30.literal(true).optional(),
8495
- reason: z30.string().trim().min(1).max(300).optional()
8575
+ reason: z30.string().trim().min(1).max(IGNORE_REASON_MAX).optional()
8496
8576
  });
8497
8577
  var AnsweredQuestion = z30.object({
8498
8578
  question: Question,
@@ -10147,10 +10227,12 @@ var OPS = {
10147
10227
  summary: "Every call merged into one edge of a view (a node's, or a focus), not only the first 20 the view lists (review of beta.24)",
10148
10228
  tag: "views",
10149
10229
  params: [
10150
- q("edge", str3, "The edge's id, as the view gives it (required)"),
10151
- q("node", str3, "The node whose view has the edge (or focus)"),
10152
- q("focus", str3, "The node whose focus view has the edge (or node)"),
10153
- q("lens", { type: "string", enum: [...GRAPH_LENSES] }, "The view's lens")
10230
+ { ...q("edge", str3, "The edge's id, as the view gives it"), required: true },
10231
+ q("node", str3, "The node whose view has the edge: one of node or focus is required"),
10232
+ q("focus", str3, "The node whose focus view has the edge: one of node or focus is required"),
10233
+ q("lens", { type: "string", enum: [...GRAPH_LENSES] }, "The view's lens"),
10234
+ q("depth", { type: "string", enum: ["1", "2", "3"] }, "With node: the view's depth, as GET /api/graph/node/{id} takes it (3.11.0)"),
10235
+ q("all", { type: "string", enum: ["1"] }, "With node: every box, as GET /api/graph/node/{id} takes it (3.11.0)")
10154
10236
  ],
10155
10237
  ok: { status: 200, schema: "GraphEdgeCallsView", description: "OK" },
10156
10238
  errors: [400, 404, 422]
@@ -10553,21 +10635,21 @@ var OPS = {
10553
10635
  "/api/trust/answer-boxes/ignore": {
10554
10636
  post: {
10555
10637
  id: "ignoreAnswerBox",
10556
- summary: "A box an answer's words made (beta.24 review), put right as 'it was ignore this': each answer that names it becomes Ignore (the join leaves its calls) and the system leaves its profile. preview writes nothing; the write is local, for Propose for review",
10638
+ summary: "A box an answer's words made (beta.24 review), put right as 'it was ignore this': each answer that names it becomes Ignore (the join leaves its calls) and the system leaves its profile. preview writes nothing; the write (with the preview's stamp) writes all or none, only over the files previewed, local, for Propose for review",
10557
10639
  tag: "workspace",
10558
10640
  body: AnswerBoxRequest,
10559
10641
  ok: { status: 200, schema: "AnswerBoxResult", description: "Previewed or written" },
10560
- errors: [400, 404, 409, 422]
10642
+ errors: [400, 404, 409, 422, 500]
10561
10643
  }
10562
10644
  },
10563
10645
  "/api/trust/answer-boxes/rename": {
10564
10646
  post: {
10565
10647
  id: "renameAnswerBox",
10566
- summary: "A box an answer's words made (beta.24 review), renamed to a real system: a repo or system Atticus knows, or a new outside system's short name; the answers that name it name that instead. preview writes nothing; the write is local, for Propose for review",
10648
+ summary: "A box an answer's words made (beta.24 review), renamed to a real system: a repo or system Atticus knows, or a new outside system's short name; the answers that name it name that instead. preview writes nothing; the write (with the preview's stamp) writes all or none, only over the files previewed, local, for Propose for review",
10567
10649
  tag: "workspace",
10568
10650
  body: AnswerBoxRequest,
10569
10651
  ok: { status: 200, schema: "AnswerBoxResult", description: "Previewed or written" },
10570
- errors: [400, 404, 409, 422]
10652
+ errors: [400, 404, 409, 422, 500]
10571
10653
  }
10572
10654
  },
10573
10655
  "/api/trust/fresh": {
@@ -10602,11 +10684,11 @@ var OPS = {
10602
10684
  "/api/links/corrections": {
10603
10685
  post: {
10604
10686
  id: "correctLinkCalls",
10605
- summary: "This whole arrow is wrong (beta.24): one correction of every call on a link, each in its caller repo's facts/<repo>.corrections.jsonl (several lines in one write per repo), every item checked before any is written. Returns each file, the git command that commits them all and the verify command per repo",
10687
+ summary: "This whole arrow is wrong (beta.24): one correction of every call on a link, or (beta.25) of every dependency fact a depends-on link rests on, each in its repo's facts/<repo>.corrections.jsonl (several lines in one write per repo), every item checked before any is written, all or none. Returns each file, the git command that commits them all and the verify command per repo",
10606
10688
  tag: "workspace",
10607
10689
  body: LinkCorrectionsRequest,
10608
10690
  ok: { status: 200, schema: "LinkCorrectionsResult", description: "Recorded" },
10609
- errors: [400, 404, 422, 500]
10691
+ errors: [400, 404, 409, 413, 422, 500]
10610
10692
  }
10611
10693
  },
10612
10694
  "/api/facts/{repo}/preview": {
@@ -12704,7 +12786,7 @@ function folder(entries, rel, inherited, gitignore) {
12704
12786
  return { rules, names, kept };
12705
12787
  }
12706
12788
  var hasGitignore = (entries) => entries.some((e) => e.name === ".gitignore" && e.isFile());
12707
- async function walkRepo(root, visit, o = {}) {
12789
+ async function walkRepo(root, visit2, o = {}) {
12708
12790
  const max = o.max ?? Number.POSITIVE_INFINITY;
12709
12791
  let files = 0;
12710
12792
  let cut = false;
@@ -12732,7 +12814,7 @@ async function walkRepo(root, visit, o = {}) {
12732
12814
  return false;
12733
12815
  }
12734
12816
  files++;
12735
- if (await visit(path) === false)
12817
+ if (await visit2(path) === false)
12736
12818
  return false;
12737
12819
  }
12738
12820
  }
@@ -12751,6 +12833,77 @@ var LOG_MAX_BYTES = 5 * 1024 * 1024;
12751
12833
  // packages/core/dist/run-log.js
12752
12834
  var RUN_LOG_MAX_BYTES = 2 * 1024 * 1024;
12753
12835
  var RUN_SILENT_MS = 5 * 60 * 1e3;
12836
+ var all2 = true;
12837
+ var only = (...c) => new Set(c);
12838
+ var but = (...c) => ({ except: new Set(c) });
12839
+ var RECORDED = {
12840
+ // The long ones.
12841
+ map: all2,
12842
+ scan: all2,
12843
+ verify: all2,
12844
+ upgrade: all2,
12845
+ reconcile: all2,
12846
+ "run-ready": all2,
12847
+ workspace: only("sync", "bring-in", "open", "prune"),
12848
+ task: but("context"),
12849
+ knowledge: only("scan", "find", "ask", "keep", "verify", "correct", "reject"),
12850
+ handoff: only("done"),
12851
+ index: only("rebuild", "embed"),
12852
+ // A change, from its start to its archive, and what it asks of people.
12853
+ change: but("status", "list", "knowledge", "similar", "impact", "conflicts", "estimate", "map"),
12854
+ initiative: but("status"),
12855
+ questions: but("list", "show", "proposed", "decisions"),
12856
+ critic: all2,
12857
+ finding: all2,
12858
+ plan: all2,
12859
+ stories: all2,
12860
+ needs: only("done", "skip", "reopen"),
12861
+ todo: only("done", "run"),
12862
+ ado: all2,
12863
+ release: all2,
12864
+ outcome: only("record"),
12865
+ tests: only("generate"),
12866
+ spec: only("draft", "seed", "accept", "hand-down", "hand-up"),
12867
+ feature: but("list", "show"),
12868
+ triage: only("decide"),
12869
+ alias: all2,
12870
+ // The estate, the org pack and what Atticus learns.
12871
+ baseline: all2,
12872
+ repo: all2,
12873
+ "repo-type": only("new", "note", "rules"),
12874
+ rules: only("add", "activate", "off", "draft", "try", "import"),
12875
+ types: only("add"),
12876
+ skills: only("import", "write"),
12877
+ connect: all2,
12878
+ join: all2,
12879
+ estate: only("join", "measure", "shared", "contracts"),
12880
+ sources: only("sync", "tag", "refresh"),
12881
+ glossary: only("scan", "define", "link", "alias"),
12882
+ intake: only("add", "traffic"),
12883
+ patterns: only("scan"),
12884
+ defences: only("scan"),
12885
+ onboard: but("check"),
12886
+ frameworks: all2,
12887
+ dialect: only("new", "kit"),
12888
+ plugin: all2,
12889
+ absorb: all2,
12890
+ orgpack: only("draft", "accept", "owner"),
12891
+ standards: all2,
12892
+ openspec: only("setup"),
12893
+ templates: only("draft"),
12894
+ catalog: only("migrate"),
12895
+ diagram: all2,
12896
+ "assistant-files": all2,
12897
+ site: only("build"),
12898
+ secret: only("set", "forget"),
12899
+ init: all2,
12900
+ adopt: all2,
12901
+ unadopt: all2,
12902
+ support: only("bundle"),
12903
+ probe: all2,
12904
+ eval: only("run"),
12905
+ bench: all2
12906
+ };
12754
12907
  var DAY = 24 * 60 * 60 * 1e3;
12755
12908
 
12756
12909
  // packages/core/dist/printer.js
@@ -12863,7 +13016,7 @@ var QuestionProposal = z32.strictObject({
12863
13016
  });
12864
13017
 
12865
13018
  // packages/core/dist/setup-edit.js
12866
- import { isMap as isMap10, isNode, isScalar, isSeq as isSeq5, parseDocument as parseDocument10, stringify as stringify5 } from "yaml";
13019
+ import { isMap as isMap10, isNode as isNode2, isScalar, isSeq as isSeq5, parseDocument as parseDocument10, stringify as stringify5 } from "yaml";
12867
13020
  init_ai();
12868
13021
  init_conventions();
12869
13022
  init_orgpack();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maycombhq/sdk",
3
- "version": "2.0.0-beta.24",
3
+ "version": "2.0.0-beta.26",
4
4
  "description": "Atticus plugin SDK (contract C4): interfaces for extractors, dialects, ingestors and adapters.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",