@maycombhq/sdk 2.0.0-beta.28.5 → 2.0.0-beta.30

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/index.js CHANGED
@@ -1428,7 +1428,7 @@ var init_template = __esm({
1428
1428
 
1429
1429
  // packages/core/dist/schema/review.js
1430
1430
  import { z as z9 } from "zod";
1431
- var REVIEW_SCHEMA_VERSION, CriticQuestion, LEGACY_LENSES, Lens, isCriticQuestion, Layer, Severity, RuleSeverity, ReviewArtifact, Kind, Question2, RuleNeed, DeterministicCheck, AiCheck, ChecklistRule, ChecklistPack, FindingEvidence, FindingLocator, FindingState, FindingAction, FindingResolution, STATE_ACTIONS, Finding;
1431
+ var REVIEW_SCHEMA_VERSION, CriticQuestion, LEGACY_LENSES, Lens, isCriticQuestion, FindingLens, Layer, Severity, RuleSeverity, ReviewArtifact, Kind, Question2, RuleNeed, DeterministicCheck, AiCheck, ChecklistRule, ChecklistPack, FindingEvidence, FindingLocator, FindingState, FindingAction, FindingResolution, STATE_ACTIONS, Finding;
1432
1432
  var init_review = __esm({
1433
1433
  "packages/core/dist/schema/review.js"() {
1434
1434
  "use strict";
@@ -1448,6 +1448,7 @@ var init_review = __esm({
1448
1448
  ];
1449
1449
  Lens = z9.enum([...CriticQuestion.options, ...LEGACY_LENSES]);
1450
1450
  isCriticQuestion = (l) => CriticQuestion.options.includes(l);
1451
+ FindingLens = z9.enum([...Lens.options, "persona"]);
1451
1452
  Layer = z9.enum(["constitution", "org", "team"]);
1452
1453
  Severity = z9.enum(["blocking", "gap", "risk", "idea"]);
1453
1454
  RuleSeverity = Severity.exclude(["gap"]);
@@ -1643,7 +1644,9 @@ var init_review = __esm({
1643
1644
  round: z9.number().int().positive(),
1644
1645
  rule: RecordId,
1645
1646
  layer: Layer,
1646
- lens: Lens,
1647
+ lens: FindingLens,
1648
+ /** ADR 0203 C.3: the persona whose naysayer raised it (its file's name), with lens persona only. */
1649
+ persona: RecordId.optional(),
1647
1650
  severity: Severity,
1648
1651
  /** Path of the artifact relative to the change folder, or "catalog". */
1649
1652
  artifact: z9.string().min(1),
@@ -1686,6 +1689,10 @@ var init_review = __esm({
1686
1689
  }
1687
1690
  if (f.layer === "constitution" && f.waivable)
1688
1691
  add(["waivable"], "constitution findings are never waivable");
1692
+ if (f.lens === "persona" && !f.persona)
1693
+ add(["persona"], "a finding of the persona lens names its persona");
1694
+ if (f.lens !== "persona" && f.persona)
1695
+ add(["persona"], "only a finding of the persona lens names a persona");
1689
1696
  if (f.state === "open") {
1690
1697
  if (f.resolution)
1691
1698
  add(["resolution"], "an open finding has no resolution");
@@ -2026,7 +2033,7 @@ function gitRefProblem(ref2) {
2026
2033
  function StepModelId() {
2027
2034
  return z11.string().min(1).regex(/^\S+$/, "a model id, without spaces");
2028
2035
  }
2029
- var ORGPACK_SCHEMA_VERSION, V2, Semver, Kind2, Ids, PackManifest, CORE_ROLES, OPTIONAL_ROLES, BUILT_IN_ROLES, NonGitAction, Approver, ROLES_SCHEMA_VERSION, TeamPerson, Team, Roles, PHASES, Phase, PRE_BUILD, ChangeArtifact, ChangeType, CHANGE_TYPES_SCHEMA_VERSION, V2_FIELDS, ChangeTypes, Gate, GATES_SCHEMA_VERSION, Gates, PatternCode, IntegrationPattern, RelPath, SourceTags, SOURCES_SCHEMA_VERSION, SOURCE_AUTHORITIES, PAGE_STATUSES, SourceScope, PageGlob, SOURCES_V2_FIELDS, SOURCES_V3_FIELDS, SOURCES_V3_TYPES, PageOverride, Sources, SECRET_KEY2, AdapterSettings, adapter, BuildEngine, Autonomy, RetrievalSettings, ASSISTANTS, AssistantId, STEP_CLASSES, StepClass, RUNTIME_SCHEMA_VERSION, DecideSettings, ConfiguredMode, CopilotAcpSettings, COPILOT_ACP_DEFAULTS, StepModel, RuntimeFields, Runtime, SkillMeta, ServiceRequestTemplate, StepSchema, Procedure, TestType, TestStrategy, DayRange, Estimates, OpenSpecSettings, DeclaredCall, PROFILE_SCHEMA_VERSION, Profile;
2036
+ var ORGPACK_SCHEMA_VERSION, V2, Semver, Kind2, Ids, PackManifest, CORE_ROLES, OPTIONAL_ROLES, BUILT_IN_ROLES, NonGitAction, Approver, ROLES_SCHEMA_VERSION, PersonHandle, TeamPerson, Team, Roles, PHASES, Phase, PRE_BUILD, ChangeArtifact, ChangeType, CHANGE_TYPES_SCHEMA_VERSION, V2_FIELDS, ChangeTypes, Gate, GATES_SCHEMA_VERSION, Gates, PatternCode, IntegrationPattern, RelPath, SourceTags, SOURCES_SCHEMA_VERSION, SOURCE_AUTHORITIES, PAGE_STATUSES, SourceScope, PageGlob, SOURCES_V2_FIELDS, SOURCES_V3_FIELDS, SOURCES_V3_TYPES, PageOverride, Sources, SECRET_KEY2, AdapterSettings, adapter, BuildEngine, Autonomy, RetrievalSettings, ASSISTANTS, AssistantId, STEP_CLASSES, StepClass, RUNTIME_SCHEMA_VERSION, DecideSettings, ConfiguredMode, CopilotAcpSettings, COPILOT_ACP_DEFAULTS, StepModel, RuntimeFields, Runtime, SkillMeta, ServiceRequestTemplate, StepSchema, Procedure, TestType, TestStrategy, DayRange, Estimates, OpenSpecSettings, DeclaredCall, PROFILE_SCHEMA_VERSION, PROFILE_TOPICS_VERSION, ArrowEnd, DeclaredLink, arrowEndKey, Profile;
2030
2037
  var init_orgpack = __esm({
2031
2038
  "packages/core/dist/schema/orgpack.js"() {
2032
2039
  "use strict";
@@ -2083,7 +2090,8 @@ var init_orgpack = __esm({
2083
2090
  people: z11.array(z11.string().min(1)).default([])
2084
2091
  }).refine((a) => a.roles.length + a.groups.length + a.people.length > 0, "name at least one role, group or person");
2085
2092
  ROLES_SCHEMA_VERSION = 3;
2086
- TeamPerson = z11.string().min(1).max(100).regex(/^@?[A-Za-z0-9][A-Za-z0-9._-]*$/, "a person's Git handle, such as pat or pat.doe");
2093
+ PersonHandle = z11.string().min(1).max(100).regex(/^@?[A-Za-z0-9][A-Za-z0-9._-]*$/, "a person's Git handle, such as pat or pat.doe");
2094
+ TeamPerson = PersonHandle;
2087
2095
  Team = z11.strictObject({
2088
2096
  /** The id a repo manifest's `owner` names, e.g. team-ledger. */
2089
2097
  id: RecordId,
@@ -2815,9 +2823,34 @@ var init_orgpack = __esm({
2815
2823
  }).refine((c) => c.name !== void 0 || c.route !== void 0, {
2816
2824
  message: "a declared call names the identity the gateway knows the caller by, or the route"
2817
2825
  });
2818
- PROFILE_SCHEMA_VERSION = 2;
2826
+ PROFILE_SCHEMA_VERSION = 3;
2827
+ PROFILE_TOPICS_VERSION = 2;
2828
+ ArrowEnd = z11.union([
2829
+ // The second review: a repo end is an id as the manifests' are, so it never reaches a path.
2830
+ z11.strictObject({ repo: RecordId }),
2831
+ z11.strictObject({ system: RecordId })
2832
+ ]);
2833
+ DeclaredLink = z11.strictObject({
2834
+ from: ArrowEnd,
2835
+ to: ArrowEnd,
2836
+ /** Why it is so: required, and only ever data (never an instruction to a reader). */
2837
+ why: z11.string().trim().min(3).max(500),
2838
+ /**
2839
+ * The Git user who declared it (their handle, one line: the second review, while version 3 is
2840
+ * unreleased), and when.
2841
+ */
2842
+ by: PersonHandle,
2843
+ at: z11.iso.datetime({ offset: true }),
2844
+ /** Not built yet: the Interface is `planned-new`. */
2845
+ planned: z11.boolean().optional()
2846
+ });
2847
+ arrowEndKey = (e) => "repo" in e ? `repo:${e.repo}` : `system:${e.system}`;
2819
2848
  Profile = z11.strictObject({
2820
- schemaVersion: z11.union([V2, z11.literal(PROFILE_SCHEMA_VERSION)]),
2849
+ schemaVersion: z11.union([
2850
+ V2,
2851
+ z11.literal(PROFILE_TOPICS_VERSION),
2852
+ z11.literal(PROFILE_SCHEMA_VERSION)
2853
+ ]),
2821
2854
  platform: RecordId,
2822
2855
  name: z11.string().min(1),
2823
2856
  systems: z11.array(z11.strictObject({
@@ -2854,12 +2887,33 @@ var init_orgpack = __esm({
2854
2887
  retire: z11.array(z11.string().min(1)).default(["Retire"])
2855
2888
  }).default({ new: ["New"], modify: ["Modify"], retire: ["Retire"] }),
2856
2889
  /** Gate ids from gates.yaml that are mandatory on this platform. */
2857
- gates: Ids.default([])
2890
+ gates: Ids.default([]),
2891
+ /** ADR 0204 (version 3): the arrows a person declared, each pair once. */
2892
+ links: z11.array(DeclaredLink).optional()
2858
2893
  }).superRefine((p2, ctx) => {
2859
2894
  unique(p2.systems, (s) => s.id, ctx, "systems");
2895
+ if (p2.links?.length && p2.schemaVersion < PROFILE_SCHEMA_VERSION)
2896
+ ctx.addIssue({
2897
+ code: "custom",
2898
+ path: ["links"],
2899
+ message: "links needs schemaVersion 3: set schemaVersion: 3, nothing else changes"
2900
+ });
2901
+ const pairs = /* @__PURE__ */ new Set();
2902
+ (p2.links ?? []).forEach((l, i) => {
2903
+ const k = `${arrowEndKey(l.from)}>${arrowEndKey(l.to)}`;
2904
+ if (arrowEndKey(l.from) === arrowEndKey(l.to))
2905
+ ctx.addIssue({ code: "custom", path: ["links", i], message: "an arrow's two ends differ" });
2906
+ if (pairs.has(k))
2907
+ ctx.addIssue({
2908
+ code: "custom",
2909
+ path: ["links", i],
2910
+ message: `the arrow ${k.replace(">", " \u2192 ")} is listed twice`
2911
+ });
2912
+ pairs.add(k);
2913
+ });
2860
2914
  const owned = /* @__PURE__ */ new Map();
2861
2915
  p2.systems.forEach((s, i) => {
2862
- if (s.topics?.length && p2.schemaVersion < PROFILE_SCHEMA_VERSION)
2916
+ if (s.topics?.length && p2.schemaVersion < PROFILE_TOPICS_VERSION)
2863
2917
  ctx.addIssue({
2864
2918
  code: "custom",
2865
2919
  path: ["systems", i, "topics"],
@@ -4331,12 +4385,20 @@ var init_component_type = __esm({
4331
4385
  });
4332
4386
 
4333
4387
  // packages/core/dist/orgpack-defaults.js
4334
- var all, DEFAULT_CHANGE_TYPES, DEFAULT_GATES, DEFAULT_ROLES, DEFAULT_RUNTIME, DEFAULT_SOURCES, DEFAULT_TEST_STRATEGY;
4388
+ var all, QUICK_CHANGE_TYPE, DEFAULT_CHANGE_TYPES, DEFAULT_GATES, DEFAULT_ROLES, DEFAULT_RUNTIME, DEFAULT_SOURCES, DEFAULT_TEST_STRATEGY;
4335
4389
  var init_orgpack_defaults = __esm({
4336
4390
  "packages/core/dist/orgpack-defaults.js"() {
4337
4391
  "use strict";
4338
4392
  init_orgpack();
4339
4393
  all = ["true", "complete", "safe", "ship"];
4394
+ QUICK_CHANGE_TYPE = ChangeType.parse({
4395
+ id: "quick",
4396
+ name: "Quick path",
4397
+ description: "From a requirements file to a plain OpenSpec change: proposal, spec deltas, design and tasks, written by your personas and grounded in the map. No stage runs. One hand-off before build.",
4398
+ phases: ["plan", "build", "release"],
4399
+ artifacts: ["proposal", "specs", "design", "tasks"],
4400
+ lenses: all
4401
+ });
4340
4402
  DEFAULT_CHANGE_TYPES = ChangeTypes.parse({
4341
4403
  // Version 2 (ADR 0113): a small type takes the fast path; the others stay standard.
4342
4404
  schemaVersion: 2,
@@ -4435,7 +4497,8 @@ var init_orgpack_defaults = __esm({
4435
4497
  phases: ["plan", "build", "release"],
4436
4498
  artifacts: ["brief", "proposal", "design", "stories", "tasks"],
4437
4499
  lenses: all
4438
- }
4500
+ },
4501
+ QUICK_CHANGE_TYPE
4439
4502
  ]
4440
4503
  });
4441
4504
  DEFAULT_GATES = Gates.parse({
@@ -5284,7 +5347,32 @@ init_common();
5284
5347
  // packages/core/dist/facts.js
5285
5348
  init_common();
5286
5349
  init_kinds();
5350
+
5351
+ // packages/core/dist/app-memory.js
5352
+ var appMemory = {
5353
+ on: false,
5354
+ idleMs: 10 * 60 * 1e3,
5355
+ lowAt: 0.75,
5356
+ lowFree: 0.1,
5357
+ lowFreeMinBytes: 256 * 1024 * 1024,
5358
+ checkMs: 30 * 1e3,
5359
+ systemEveryMs: 1e3
5360
+ };
5361
+ var keepers = /* @__PURE__ */ new Set();
5362
+ function onAppMemoryRelease(release, held) {
5363
+ keepers.add({ release, ...held ? { held } : {} });
5364
+ }
5365
+
5366
+ // packages/core/dist/facts.js
5287
5367
  var KNOWN_KINDS = new Set(FACT_KINDS);
5368
+ var factsParses = /* @__PURE__ */ new Map();
5369
+ var factsParseBytes = 0;
5370
+ var FACTS_PARSES_MAX = 256 * 1024 * 1024;
5371
+ function forgetFactsParses() {
5372
+ factsParses.clear();
5373
+ factsParseBytes = 0;
5374
+ }
5375
+ onAppMemoryRelease(forgetFactsParses, () => ({ "facts parses (core's memo)": factsParseBytes }));
5288
5376
 
5289
5377
  // packages/core/dist/host-questions.js
5290
5378
  import { isAlias, isMap as isMap4, isNode, isSeq as isSeq2, parseDocument as parseDocument4, visit, YAMLSeq } from "yaml";
@@ -6025,6 +6113,14 @@ init_question();
6025
6113
  import { z as z31 } from "zod";
6026
6114
  init_workspace();
6027
6115
  var NextStep = z31.object({ step: z31.literal("sync"), repos: z31.array(z31.string()) });
6116
+ var UndoWay = z31.object({
6117
+ n: z31.number().int().min(1),
6118
+ files: z31.number().int().min(0),
6119
+ plan: z31.string().regex(/^[0-9a-f]{64}$/),
6120
+ command: z31.string(),
6121
+ at: z31.string(),
6122
+ ofThis: z31.boolean()
6123
+ });
6028
6124
  var Problem = z31.object({
6029
6125
  type: z31.string(),
6030
6126
  title: z31.string(),
@@ -6050,7 +6146,9 @@ var Problem = z31.object({
6050
6146
  * 3.13.0 (beta.28): a 422 of POST /api/map/edits: each staged change that can't be made, by its
6051
6147
  * place in the list (from 0), with why. Nothing was written.
6052
6148
  */
6053
- problems: z31.array(z31.object({ edit: z31.number().int().nonnegative(), message: z31.string() })).optional()
6149
+ problems: z31.array(z31.object({ edit: z31.number().int().nonnegative(), message: z31.string() })).optional(),
6150
+ /** 3.19.0 (ADR 0202 point 3): on a build route's 409, the build that can be taken back. */
6151
+ undo: UndoWay.optional()
6054
6152
  });
6055
6153
  var Kind3 = z31.enum(RECORD_KINDS);
6056
6154
  var CatalogRecord2 = z31.union(RECORD_KINDS.map((k) => RECORD_SCHEMAS[k]));
@@ -6164,6 +6262,8 @@ var LINK_HOWS = [
6164
6262
  "unknown"
6165
6263
  ];
6166
6264
  var HierJoin = z31.object({
6265
+ /** 3.19.0 (ADR 0204): a declared arrow's (flag `declared-link`): who declared it. */
6266
+ declaredBy: z31.string().optional(),
6167
6267
  /** The catalog Interface the call is. */
6168
6268
  interface: z31.string(),
6169
6269
  from: z31.string(),
@@ -6328,6 +6428,22 @@ var Coverage = z31.object({
6328
6428
  }))
6329
6429
  });
6330
6430
  var JobState = z31.enum(["queued", "running", "done", "failed", "cancelled"]);
6431
+ var JOB_ACTIONS = [
6432
+ "apply",
6433
+ "apply-all",
6434
+ "build",
6435
+ "undo",
6436
+ "upgrade",
6437
+ "propose",
6438
+ "bring-in",
6439
+ "sync",
6440
+ "scan",
6441
+ "map-edits",
6442
+ // 3.19.0 (ADR 0204 decision 4): Sync, read and apply these N.
6443
+ "repos-run"
6444
+ ];
6445
+ var JobFor = z31.object({ action: z31.enum(JOB_ACTIONS), repo: z31.string().optional() });
6446
+ var StopLands = z31.enum(["now", "after-write"]);
6331
6447
  var Job = z31.object({
6332
6448
  id: z31.string(),
6333
6449
  kind: z31.enum(["scan", "sync", "reconcile", "index", "intake", "step", "local", "work"]),
@@ -6338,12 +6454,33 @@ var Job = z31.object({
6338
6454
  startedAt: z31.string(),
6339
6455
  finishedAt: z31.string().optional(),
6340
6456
  errors: z31.array(z31.string()),
6341
- /** Kind-specific outcome, e.g. scan diff counts. */
6457
+ /**
6458
+ * Kind-specific outcome, e.g. scan diff counts. 3.19.0 (ADR 0202 point 3): a local job that
6459
+ * ended failed or refused carries `undo` (an `UndoWay`) when a build can be taken back.
6460
+ */
6342
6461
  result: z31.record(z31.string(), z31.unknown()).optional(),
6343
6462
  /** 3.12.0: Stop was asked and the job is ending (it stops at its next safe point). */
6344
- stopping: z31.boolean().optional()
6463
+ stopping: z31.boolean().optional(),
6464
+ /**
6465
+ * 3.19.0 (ADR 0202 point 2): true while the job runs, is not stopping, and a Stop would end
6466
+ * it: before its write, or during a write of a job of several. False otherwise. A server from
6467
+ * 3.19.0 always sends it; an older one never does (Stop is then offered while it runs).
6468
+ */
6469
+ stoppable: z31.boolean().optional(),
6470
+ /** 3.19.0: only when `stoppable`: now, or when the write a job of several is inside has ended. */
6471
+ stopLands: StopLands.optional(),
6472
+ /** 3.19.0 (ADR 0202 point 5): the page action that started it. */
6473
+ for: JobFor.optional()
6345
6474
  });
6346
6475
  var JobAccepted = z31.object({ jobId: z31.string() });
6476
+ var JobList = z31.object({ jobs: z31.array(Job) });
6477
+ var SupportBundleView = z31.object({
6478
+ file: z31.string(),
6479
+ name: z31.string(),
6480
+ bytes: z31.number().int().min(0),
6481
+ files: z31.array(z31.string()),
6482
+ zip: z31.string().optional()
6483
+ });
6347
6484
  var ArtifactStatus = z31.object({
6348
6485
  artifact: ChangeArtifact,
6349
6486
  path: z31.string(),
@@ -6382,6 +6519,11 @@ var ChangeSummary = z31.object({
6382
6519
  updatedAt: z31.string(),
6383
6520
  /** ADR 0113: it takes the fast path, one step from brief to tasks (its type is small, or its brief says so). */
6384
6521
  fastPath: z31.boolean().optional(),
6522
+ /**
6523
+ * 3.18.0 (ADR 0201): it takes the quick path (its type's only phase before build is plan, and
6524
+ * it lists no stories): no stage runs; its proposal, spec deltas, design and tasks, then one hand-off.
6525
+ */
6526
+ quickPath: z31.boolean().optional(),
6385
6527
  /**
6386
6528
  * 3.9.0 (beta.23 review): the viewer's roles on the change, from its owners (any case, the
6387
6529
  * words people write for a role, roles.yaml's custom roles); empty when it names them nowhere.
@@ -6479,7 +6621,14 @@ var Task = z31.object({
6479
6621
  /** 3.3.0: a person decided the task's work isn't needed in the change, and why. */
6480
6622
  decision: z31.object({ by: z31.string(), at: z31.string(), reason: z31.string() }).optional(),
6481
6623
  /** 3.3.0: whether the task's repo has a build command now (repos.manifest.yaml). */
6482
- repoBuilds: z31.boolean().optional()
6624
+ repoBuilds: z31.boolean().optional(),
6625
+ /**
6626
+ * 3.19.0 (ADR 0202 point 6): the ready plan's sentence for a task that is not done and not
6627
+ * ready, whatever holds it ("it names task t9 in (after …), which tasks.md doesn't have").
6628
+ */
6629
+ why: z31.string().optional(),
6630
+ /** 3.19.0: the ready plan's note about the task (a title read as "(after …)" words). */
6631
+ note: z31.string().optional()
6483
6632
  });
6484
6633
  var RunView = RunSummary.extend({
6485
6634
  /**
@@ -7023,6 +7172,18 @@ var BuildRefusalView = z31.object({
7023
7172
  * record file); its edits are not to be made curated.
7024
7173
  */
7025
7174
  unreadableManifest: z31.literal(true).optional(),
7175
+ /**
7176
+ * 3.19.0 (ADR 0124 addendum E-ids): a `not-upgraded` refusal of a catalog from before the slots
7177
+ * (no build.json, or an undo took the upgrade back): `atticus upgrade --yes` adopts it.
7178
+ */
7179
+ beforeSlots: z31.literal(true).optional(),
7180
+ /**
7181
+ * 3.19.0 (ADR 0124 addendum E-ids): a `not-upgraded` refusal of a build that would name again
7182
+ * with their repo loose ends your changes name by their old ids: how many. `atticus upgrade`
7183
+ * renames them and carries your changes in one write (`--dry-run` shows what it would write).
7184
+ * A `not-upgraded` refusal with neither field is one from before the slots.
7185
+ */
7186
+ renames: z31.number().int().optional(),
7026
7187
  /**
7027
7188
  * 3.15.0 (beta.28.2, ADR 0197): a `newer-atticus` refusal's files a newer Atticus wrote
7028
7189
  * (build.json, a slot), each with its version field, the version it has and the newest one
@@ -7037,8 +7198,18 @@ var BuildRefusalView = z31.object({
7037
7198
  field: z31.string(),
7038
7199
  version: z31.number().int(),
7039
7200
  /** The newest version of it this Atticus reads. */
7040
- reads: z31.number().int()
7201
+ reads: z31.number().int(),
7202
+ /**
7203
+ * 3.19.0 (ADR 0202 point 7): the Atticus that wrote it, when a newer build.json says so
7204
+ * in the shape of a version; `command` then installs exactly that version.
7205
+ */
7206
+ atticus: z31.string().optional()
7041
7207
  })).optional(),
7208
+ /**
7209
+ * 3.19.0 (ADR 0202 point 8): where the metarepo stands, in the one line `atticus status`
7210
+ * prints (worked out without the upgrade steps' dry runs), when a command refused.
7211
+ */
7212
+ standing: z31.string().optional(),
7042
7213
  /** What goes on in a terminal (the build, the hand edits' curate, or the upgrade). */
7043
7214
  command: z31.string(),
7044
7215
  /**
@@ -7073,7 +7244,15 @@ var BuildReportView = z31.object({
7073
7244
  slots: z31.array(z31.string()),
7074
7245
  /** The undo copy a written build took. */
7075
7246
  undo: z31.number().int().optional(),
7076
- discarded: z31.array(BuildHandEdit).optional()
7247
+ discarded: z31.array(BuildHandEdit).optional(),
7248
+ /** 3.19.0 (ADR 0204 1.7): the declared arrows the code now shows, not drawn by this build. */
7249
+ declaredSuperseded: z31.array(z31.object({
7250
+ from: z31.string(),
7251
+ to: z31.string(),
7252
+ by: z31.string(),
7253
+ at: z31.string(),
7254
+ calls: z31.number().int()
7255
+ })).optional()
7077
7256
  });
7078
7257
  var BuildSourceView = z31.object({
7079
7258
  repo: z31.string(),
@@ -7102,7 +7281,13 @@ var CatalogBuildView = z31.object({
7102
7281
  why: z31.enum(["not-listed", "archived"]),
7103
7282
  files: z31.array(z31.string())
7104
7283
  })),
7105
- problems: z31.array(z31.object({ file: z31.string(), message: z31.string() }))
7284
+ problems: z31.array(z31.object({ file: z31.string(), message: z31.string() })),
7285
+ /**
7286
+ * 3.19.0 (the review of b30/review2-fixes): what the build warns of and never counts as a
7287
+ * problem, each in words (two repo ids that name one loose-end id). Optional: none, or an
7288
+ * older server.
7289
+ */
7290
+ warnings: z31.array(z31.string()).optional()
7106
7291
  });
7107
7292
  var CatalogBuildRequest = z31.strictObject({
7108
7293
  allowRemovals: z31.number().int().min(0).max(1e6).optional(),
@@ -7191,13 +7376,39 @@ var MapEditAdd = z31.discriminatedUnion("kind", [
7191
7376
  kind: z31.literal("call"),
7192
7377
  system: z31.string().min(1).max(200),
7193
7378
  route: z31.string().min(1).max(300)
7379
+ }),
7380
+ /** 3.19.0 (ADR 0204): a declared arrow between two boxes, into the profile's `links`. */
7381
+ z31.strictObject({
7382
+ kind: z31.literal("link"),
7383
+ from: z31.strictObject({ repo: z31.string().min(1).optional(), system: z31.string().min(1).optional() }).refine((b) => !!b.repo !== !!b.system, { message: "name a repo or a system" }),
7384
+ to: z31.strictObject({ repo: z31.string().min(1).optional(), system: z31.string().min(1).optional() }).refine((b) => !!b.repo !== !!b.system, { message: "name a repo or a system" }),
7385
+ why: z31.string().trim().min(3).max(500),
7386
+ planned: z31.boolean().optional(),
7387
+ /** ADR 0204 3.1: the end that is a system only the code names, added in the same write. */
7388
+ addSystem: z31.strictObject({
7389
+ name: z31.string().min(1).max(120),
7390
+ boundary: z31.enum(["vendor", "internal"])
7391
+ }).optional()
7194
7392
  })
7195
7393
  ]);
7196
7394
  var MapEditPair = z31.strictObject({
7197
7395
  from: z31.string().min(1).max(200),
7198
7396
  /** The other box: a repo of the manifest or an outside system (Connect to…'s `to`). */
7199
7397
  to: z31.strictObject({ repo: z31.string().min(1).optional(), system: z31.string().min(1).optional() }).refine((b) => !!b.repo !== !!b.system, { message: "name a repo or a system" }),
7200
- pairs: z31.array(z31.object({ call: z31.string().min(1), api: z31.string().min(1) })).min(1).max(500)
7398
+ pairs: z31.array(z31.object({
7399
+ call: z31.string().min(1),
7400
+ api: z31.string().min(1),
7401
+ /** 3.19 (ADR 0204): why, as Connect to…'s pair takes it; required where the call's line names another box. */
7402
+ reason: z31.string().trim().min(3).max(500).optional()
7403
+ })).min(1).max(500)
7404
+ });
7405
+ var PairNeedsReason = z31.object({
7406
+ call: z31.string(),
7407
+ /** The call's cited line, `file:line`. */
7408
+ at: z31.string(),
7409
+ /** The box the line names, and what is written there. */
7410
+ box: z31.string(),
7411
+ text: z31.string()
7201
7412
  });
7202
7413
  var MapEditDelete = z31.strictObject({
7203
7414
  interfaces: z31.array(z31.string().min(1).max(300)).max(5e3),
@@ -7214,7 +7425,9 @@ var MapEdit = z31.union([
7214
7425
  var MapEditsRequest = z31.strictObject({ edits: z31.array(MapEdit).min(1).max(100) });
7215
7426
  var MapEditProblem = z31.object({
7216
7427
  edit: z31.number().int().nonnegative(),
7217
- message: z31.string()
7428
+ message: z31.string(),
7429
+ /** 3.19 (ADR 0204): the change's pairs that lack a reason; the request is then a 409. */
7430
+ needsReason: z31.array(PairNeedsReason).optional()
7218
7431
  });
7219
7432
  var MapEditsResult = z31.object({
7220
7433
  code: z31.number().int(),
@@ -7234,9 +7447,28 @@ var MapEditsResult = z31.object({
7234
7447
  waitsOn: z31.array(z31.string()),
7235
7448
  /**
7236
7449
  * The build refused after the changes were saved (a large removal it lists, a hand edit): its
7237
- * listing, as Apply's job gives it, which Set up › Scans › Catalog builds confirms.
7450
+ * listing, as Apply's job gives it, which Set up › Activity › Catalog builds confirms.
7238
7451
  */
7239
- refused: BuildRefusalView.optional()
7452
+ refused: BuildRefusalView.optional(),
7453
+ /**
7454
+ * 3.19.0 (ADR 0204 2.4): what each saved change wrote (corrections lines, or a declared arrow),
7455
+ * as POST /api/map/edits/undo takes it.
7456
+ */
7457
+ wrote: z31.array(z31.union([
7458
+ z31.object({ edit: z31.number().int(), file: z31.string(), lines: z31.array(z31.string()) }),
7459
+ z31.object({
7460
+ edit: z31.number().int(),
7461
+ file: z31.string(),
7462
+ link: z31.record(z31.string(), z31.unknown()),
7463
+ addedSystem: z31.string().optional(),
7464
+ raisedFrom: z31.number().int().optional()
7465
+ }),
7466
+ z31.object({
7467
+ edit: z31.number().int(),
7468
+ file: z31.string(),
7469
+ route: z31.object({ system: z31.string(), value: z31.string() })
7470
+ })
7471
+ ])).optional()
7240
7472
  });
7241
7473
  var FactsApplyResult = z31.object({
7242
7474
  code: z31.number().int(),
@@ -7905,6 +8137,22 @@ var StageComment = z31.object({
7905
8137
  /** A draft of the stage has read it. */
7906
8138
  read: z31.boolean()
7907
8139
  });
8140
+ var StageAcceptRefusal = z31.enum([
8141
+ "constitution",
8142
+ "assistant",
8143
+ "assistant-session",
8144
+ "document-over-code",
8145
+ "nothing-to-plan",
8146
+ "needs-catalog",
8147
+ "contradicts-fact",
8148
+ "data-safety",
8149
+ "archived-repo",
8150
+ "cites-missing-code",
8151
+ "order",
8152
+ "answer-shape",
8153
+ "next-stage-needs"
8154
+ ]);
8155
+ var StageAcceptance = z31.object({ by: z31.string(), why: z31.string(), at: z31.string() });
7908
8156
  var StageFindingView = z31.object({
7909
8157
  finding: Finding,
7910
8158
  /** The finding's file, from the metarepo's root. */
@@ -7932,6 +8180,32 @@ var StageFindingView = z31.object({
7932
8180
  by: z31.string(),
7933
8181
  at: z31.string(),
7934
8182
  reason: z31.string().optional()
8183
+ }).optional(),
8184
+ /**
8185
+ * 3.19.0 (ADR 0203 A): on an open blocking finding of a stage's own gate (`stage-<stage>`),
8186
+ * whether the person using the app may accept it (POST .../stages/{stage}/accept), and if not,
8187
+ * why (`StageAcceptRefusal`); `as` is who an acceptance would be recorded as. Optional.
8188
+ */
8189
+ accept: z31.object({
8190
+ can: z31.boolean(),
8191
+ why: StageAcceptRefusal.optional(),
8192
+ as: z31.string()
8193
+ }).optional(),
8194
+ /**
8195
+ * 3.19.0 (ADR 0203 A): a stage's finding a person accepted, as the stages read it (never an
8196
+ * assistant's resolution): who, why and when. Optional.
8197
+ */
8198
+ accepted: StageAcceptance.optional(),
8199
+ /**
8200
+ * 3.19.0 (ADR 0115 addendum, the review of b30/review2-fixes): on an open blocking or risk
8201
+ * finding of the critic's, where the app runs inside a Copilot session Atticus started
8202
+ * (`assistant-session`) or a coding assistant's terminal (`assistant-terminal`, `because`
8203
+ * names the variable): Not relevant, Apply without a patch and Waive are left out of `options`,
8204
+ * since POST /api/findings/{changeId}/{findingId}/action refuses them there. Optional.
8205
+ */
8206
+ personOnly: z31.object({
8207
+ why: z31.enum(["assistant-session", "assistant-terminal"]),
8208
+ because: z31.string().optional()
7935
8209
  }).optional()
7936
8210
  });
7937
8211
  var StageReviewView = z31.object({
@@ -8116,6 +8390,33 @@ var StageThreadPostResult = z31.object({
8116
8390
  files: z31.array(z31.string()),
8117
8391
  thread: StageThreadView
8118
8392
  });
8393
+ var StageAcceptRequest = z31.strictObject({
8394
+ finding: z31.string().regex(/^stage-[0-9a-f]{12}$/),
8395
+ reason: z31.string().trim().min(1)
8396
+ });
8397
+ var StageAcceptThen = z31.object({
8398
+ kind: z31.enum([
8399
+ "done",
8400
+ "questions",
8401
+ "stopped",
8402
+ "drafting",
8403
+ "waiting",
8404
+ "failed",
8405
+ "held",
8406
+ "not-resumed"
8407
+ ]),
8408
+ runId: z31.string().optional(),
8409
+ held: z31.number().int().positive().optional(),
8410
+ lines: z31.array(z31.string()).optional()
8411
+ });
8412
+ var StageAcceptResult = z31.object({
8413
+ /** The finding's file, from the metarepo's root. */
8414
+ files: z31.array(z31.string()),
8415
+ accepted: StageAcceptance,
8416
+ thread: StageThreadView,
8417
+ /** What the app did with the stage next. Optional: an older server says nothing. */
8418
+ goesOn: StageAcceptThen.optional()
8419
+ });
8119
8420
  var DRAFT_PAGES = ["feature", "architecture", "stories", "tasks"];
8120
8421
  var DraftPage = z31.enum(DRAFT_PAGES);
8121
8422
  var DraftProvenance = z31.object({
@@ -8370,6 +8671,12 @@ var ChangeMap = z31.object({
8370
8671
  mermaid: z31.string(),
8371
8672
  /** How many target flows it is drawn from. */
8372
8673
  flows: z31.number().int(),
8674
+ /**
8675
+ * 3.19.0 (ADR 0206, additive): a change with no target flow is drawn from its design.md's In
8676
+ * the code (`design`, with how many rows) or, before that is written, tasks.md's repos.
8677
+ */
8678
+ from: z31.enum(["design", "tasks"]).optional(),
8679
+ rows: z31.number().int().optional(),
8373
8680
  /** Target flows that don't read, or whose today isn't in the spec. */
8374
8681
  problems: z31.array(z31.string())
8375
8682
  });
@@ -8386,7 +8693,12 @@ var ChangeEstimate = z31.object({
8386
8693
  what: z31.string(),
8387
8694
  class: z31.string(),
8388
8695
  days: Days.optional(),
8389
- source: z31.string()
8696
+ source: z31.string(),
8697
+ /**
8698
+ * 3.19.0 (ADR 0206, additive): a unit no target flow gives: a row of design.md's In the
8699
+ * code, an operation's task, or a quick change's task before its table is written.
8700
+ */
8701
+ from: z31.enum(["design", "operations", "tasks"]).optional()
8390
8702
  })),
8391
8703
  needsClass: z31.number().int(),
8392
8704
  effort: Days.optional(),
@@ -8417,6 +8729,39 @@ var ChangeImpact = z31.object({
8417
8729
  change: RecordId,
8418
8730
  /** How many target flows the change has; none means the architecture stage hasn't run. */
8419
8731
  flows: z31.number().int(),
8732
+ /**
8733
+ * 3.19.0 (ADR 0206, additive): a change with no target flow is read from design.md's In the
8734
+ * code: for each row, the records of the map it names and who receives them, never counted
8735
+ * as breaks (a quick change states no fields). Empty before the table is written. A
8736
+ * `deployment` row's reach (the persona check of beta.30): its `name` is every component the
8737
+ * repo deploys, comma-joined (`ids` those the catalog has), and its `receivers` the components
8738
+ * outside them linked to one of them, `events` where every such link is async.
8739
+ */
8740
+ from: z31.literal("design").optional(),
8741
+ reaches: z31.array(z31.object({
8742
+ line: z31.number().int(),
8743
+ has: z31.string(),
8744
+ name: z31.string(),
8745
+ ids: z31.array(z31.string()),
8746
+ owner: z31.string().optional(),
8747
+ receivers: z31.array(z31.object({
8748
+ id: z31.string(),
8749
+ kind: z31.string(),
8750
+ owner: z31.string().optional(),
8751
+ /**
8752
+ * 3.19.0 (the persona check of beta.30): in a `deployment` row's reach, true when
8753
+ * this component only sends the deployed one events (every link async), not calls.
8754
+ */
8755
+ events: z31.boolean().optional()
8756
+ })),
8757
+ further: z31.number().int()
8758
+ })).optional(),
8759
+ /**
8760
+ * 3.19.0 (the persona check of beta.30, additive): the rows of In the code that are operations
8761
+ * (a route, a config, a secret, a pipeline, a cut-over, a migration, other), which name nothing
8762
+ * the map can follow; conform checks them. A table of these alone is a table, not none.
8763
+ */
8764
+ operations: z31.array(z31.object({ line: z31.number().int(), has: z31.string() })).optional(),
8420
8765
  breaks: z31.number().int(),
8421
8766
  mayBreak: z31.number().int(),
8422
8767
  /** 2.81.0 (ADR 0181): of the callers that break, those whose every link the AI decided. */
@@ -8499,6 +8844,29 @@ var ConformItem = z31.object({
8499
8844
  /** The finding it became on the conform gate, and its state; none for what was found. */
8500
8845
  finding: z31.object({ id: z31.string(), state: z31.string() }).optional()
8501
8846
  });
8847
+ var ConformClaim = z31.object({
8848
+ outcome: z31.enum(["present", "present-differently", "missing", "not-checkable", "unconfirmed"]),
8849
+ check: z31.string(),
8850
+ repo: z31.string(),
8851
+ /** Where the claim is stated: target-flows/_operations.yaml or design.md, and its line. */
8852
+ from: z31.object({
8853
+ file: z31.string(),
8854
+ line: z31.number().int().positive(),
8855
+ operation: z31.string().optional(),
8856
+ task: z31.string().optional(),
8857
+ spec: z31.string().optional()
8858
+ }),
8859
+ expected: z31.string(),
8860
+ found: z31.string().optional(),
8861
+ what: z31.string(),
8862
+ at: z31.array(ConformCite),
8863
+ why: z31.string().optional(),
8864
+ next: z31.string(),
8865
+ /** The fact it rests on. */
8866
+ fact: z31.string().optional(),
8867
+ /** The finding it became on the conform gate, and its state; none for present and unconfirmed. */
8868
+ finding: z31.object({ id: z31.string(), state: z31.string() }).optional()
8869
+ });
8502
8870
  var ConformRepoResult = z31.object({
8503
8871
  schemaVersion: z31.literal(1),
8504
8872
  change: RecordId,
@@ -8514,9 +8882,19 @@ var ConformRepoResult = z31.object({
8514
8882
  found: z31.number().int(),
8515
8883
  missing: z31.number().int(),
8516
8884
  stillThere: z31.number().int(),
8517
- unexpected: z31.number().int()
8885
+ unexpected: z31.number().int(),
8886
+ /** 3.19.0 (ADR 0206): the claims' outcomes. */
8887
+ claims: z31.object({
8888
+ present: z31.number().int(),
8889
+ differs: z31.number().int(),
8890
+ missing: z31.number().int(),
8891
+ notCheckable: z31.number().int(),
8892
+ unconfirmed: z31.number().int()
8893
+ }).optional()
8518
8894
  }),
8519
8895
  items: z31.array(ConformItem),
8896
+ /** 3.19.0 (ADR 0206): each claim of the change in this repo, with its outcome. */
8897
+ claims: z31.array(ConformClaim).optional(),
8520
8898
  /**
8521
8899
  * Steps no scan can show (a branch, a transform), and (2.76.0) what the facts don't cover at
8522
8900
  * the commit, so the code couldn't confirm it: a person or a test checks them.
@@ -8534,6 +8912,17 @@ var ChangeConformance = z31.object({
8534
8912
  title: z31.string(),
8535
8913
  /** How many target flows the change has; 0: nothing to compare yet. */
8536
8914
  flows: z31.number().int(),
8915
+ /**
8916
+ * 3.19.0 (ADR 0203): how many operations the change has (target-flows/_operations.yaml); absent
8917
+ * when it has none. ADR 0206 checks what each states (`claims`, below, and each repo's).
8918
+ * Additive only.
8919
+ */
8920
+ operations: z31.number().int().positive().optional(),
8921
+ /**
8922
+ * 3.19.0 (ADR 0206): how many claims the change states (each operation in each of its repos,
8923
+ * each row of design.md's In the code); absent when it states none. Additive only.
8924
+ */
8925
+ claims: z31.number().int().positive().optional(),
8537
8926
  results: z31.array(ConformRepoResult),
8538
8927
  /** The built-in gate the findings are on, and its newest round. */
8539
8928
  gate: z31.literal("conform"),
@@ -8747,7 +9136,17 @@ var ProposePlanView = z31.object({
8747
9136
  * map in the PR would miss them; a repo applied since its last correction isn't listed. 2.70.0
8748
9137
  * (seventh UX walk): and the repos whose answered map questions are newer than their last Apply.
8749
9138
  */
8750
- applyFirst: z31.array(z31.string()).optional()
9139
+ applyFirst: z31.array(z31.string()).optional(),
9140
+ /**
9141
+ * 3.19.0 (ADR 0204, Migration): the profiles the proposal raises to a version an older Atticus
9142
+ * refuses (each from its committed version to its own): the team upgrades before it merges.
9143
+ */
9144
+ raisesProfile: z31.array(z31.object({ file: z31.string(), from: z31.number().int(), to: z31.number().int() })).optional(),
9145
+ /**
9146
+ * 3.19.0 (the third review): a profile at version 3 whose version on the proposal's target
9147
+ * branch couldn't be read, so whether this raises it isn't known: each with the target.
9148
+ */
9149
+ raisesProfileUnread: z31.array(z31.object({ file: z31.string(), target: z31.string() })).optional()
8751
9150
  });
8752
9151
  var CONFIRMED_WRITES = [
8753
9152
  "handoff",
@@ -9686,6 +10085,30 @@ var CandidateCallView = z31.object({
9686
10085
  now: z31.string().optional(),
9687
10086
  /** 3.14: who paired the call with the box it goes to now, when a person did. */
9688
10087
  pairedBy: z31.string().optional(),
10088
+ /**
10089
+ * 3.19 (ADR 0204, a field report: "it's connected to the wrong box"): for a call that goes
10090
+ * somewhere already, how that was decided: `code`, the call's own fact names the box;
10091
+ * `address`, its host or base path is the box's; `path`, only its path matched (a guess);
10092
+ * `gateway`, a gateway's route forwards it there (`through`: the gateway's repo); `answer`, a
10093
+ * person's answer to `question`; `paired`, a person's pairing (with its `reason`, if they gave
10094
+ * one); `ai`, the AI's; `kept`, an arrow the map keeps from an earlier read, which this
10095
+ * read's join doesn't place. `who` answered or paired, and `at` when.
10096
+ */
10097
+ how: z31.object({
10098
+ by: z31.enum(["code", "address", "path", "gateway", "answer", "paired", "ai", "kept"]),
10099
+ who: z31.string().optional(),
10100
+ at: z31.string().optional(),
10101
+ question: z31.string().optional(),
10102
+ through: z31.string().optional(),
10103
+ reason: z31.string().optional()
10104
+ }).optional(),
10105
+ /**
10106
+ * 3.19 (ADR 0204): the call's cited line names another box than the one connected to: `box`
10107
+ * that box, `text` what is written (its host, or the target the fact read there). Pairing the
10108
+ * call with this box overrides what the code says, so POST /api/links/connect takes the pair
10109
+ * only with a `reason`.
10110
+ */
10111
+ codeNames: z31.object({ box: z31.string(), text: z31.string() }).optional(),
9689
10112
  suggestion: CandidateSuggestion.optional(),
9690
10113
  /** 2.57: the APIs it most likely is, best first, at most three. */
9691
10114
  suggestions: z31.array(CandidateSuggestion).max(3).optional(),
@@ -9982,6 +10405,45 @@ var UpgradeView = z31.object({
9982
10405
  */
9983
10406
  newerCatalog: z31.string().optional()
9984
10407
  });
10408
+ var UpgradeRequest = z31.strictObject({
10409
+ allowRemovals: z31.number().int().min(0).max(1e6).optional(),
10410
+ /**
10411
+ * The whole-release review of beta.30 (B2), additive: the hand edits under catalog/generated a
10412
+ * step's build listed, discarded with their count as `atticus upgrade --discard-edits <n>` does
10413
+ * (the refused run's `confirm.discardEdits`; a copy is kept for undo).
10414
+ */
10415
+ discardEdits: z31.number().int().min(0).max(1e6).optional(),
10416
+ /** The refused run's `confirm.plan`: required with a count (the list it confirms). */
10417
+ plan: z31.string().regex(/^[0-9a-f]{64}$/).optional()
10418
+ });
10419
+ var StandingView = z31.object({
10420
+ /** This Atticus. */
10421
+ atticus: z31.string(),
10422
+ /** The first of these that holds, in this order. */
10423
+ state: z31.enum([
10424
+ "no-metarepo",
10425
+ "catalog-newer",
10426
+ "atticus-behind",
10427
+ "metarepo-behind",
10428
+ "up-to-date"
10429
+ ]),
10430
+ /** The Atticus the metarepo's stamp names (.atticus/metarepo.yaml). */
10431
+ stamp: z31.string().optional(),
10432
+ /** The stamp is there but isn't one this Atticus reads. */
10433
+ stampUnread: z31.literal(true).optional(),
10434
+ /** `none`: no catalog yet; `read`: this Atticus reads it; `newer`: a newer Atticus built it. */
10435
+ catalog: z31.enum(["none", "read", "newer"]),
10436
+ /** The Atticus that built the catalog, when a newer build.json says so (ADR 0202 point 7). */
10437
+ catalogBuiltBy: z31.string().optional(),
10438
+ /** The Atticus the editor's extension needs, when it said so (ATTICUS_EXTENSION_NEEDS). */
10439
+ extensionNeeds: z31.string().optional(),
10440
+ /** The upgrade steps that wait. */
10441
+ pendingSteps: z31.number().int(),
10442
+ /** The one command to run; none when up to date. */
10443
+ do: z31.string().optional(),
10444
+ /** All of it in one line, as `atticus status` prints it. */
10445
+ line: z31.string()
10446
+ });
9985
10447
  var FileEditView = z31.object({
9986
10448
  path: z31.string(),
9987
10449
  changes: z31.array(z31.object({ was: z31.string().optional(), now: z31.string().optional() })),
@@ -10143,7 +10605,15 @@ var SourceRequest = z31.strictObject({
10143
10605
  var ConnectLinksRequest = z31.object({
10144
10606
  from: z31.string().min(1),
10145
10607
  to: LinkBox,
10146
- pairs: z31.array(z31.object({ call: z31.string().min(1), api: z31.string().min(1) })).max(500).default([]),
10608
+ pairs: z31.array(z31.object({
10609
+ call: z31.string().min(1),
10610
+ api: z31.string().min(1),
10611
+ /**
10612
+ * 3.19 (ADR 0204): why, in the person's words, kept on the pairing's line. Required
10613
+ * (409 without) for a call whose cited line names another box (`codeNames`).
10614
+ */
10615
+ reason: z31.string().trim().min(3).max(500).optional()
10616
+ })).max(500).default([]),
10147
10617
  /** Answer A's open target question with /** to B, so calls read later follow it too. */
10148
10618
  rule: z31.boolean().optional(),
10149
10619
  /** Say what it would write and what the next verify --write changes; write nothing. */
@@ -10349,7 +10819,8 @@ var AddSystemRequest = z31.object({
10349
10819
  var BoxCorrections = z31.object({
10350
10820
  items: z31.array(z31.object({
10351
10821
  /** 2.81.0 (ADR 0181): `unlink`, a person said the call reaches none of these. */
10352
- kind: z31.enum(["edit", "wrong", "link", "topic", "call", "unlink"]),
10822
+ /** 3.19.0 (ADR 0204): `arrow`, a declared arrow at either end of the box. */
10823
+ kind: z31.enum(["edit", "wrong", "link", "topic", "call", "unlink", "arrow"]),
10353
10824
  /** In words: what it says. */
10354
10825
  says: z31.string(),
10355
10826
  by: z31.string().optional(),
@@ -10362,10 +10833,16 @@ var BoxCorrections = z31.object({
10362
10833
  /** What undoes exactly it: the line to remove, or the declaration. */
10363
10834
  undo: z31.union([
10364
10835
  z31.object({ repo: z31.string(), line: z31.string() }),
10365
- z31.object({ kind: z31.enum(["topic", "call"]), system: z31.string(), value: z31.string() })
10836
+ z31.object({ kind: z31.enum(["topic", "call"]), system: z31.string(), value: z31.string() }),
10837
+ z31.object({ kind: z31.literal("link"), from: LinkBox, to: LinkBox })
10366
10838
  ]),
10367
10839
  /** A correction the latest read didn't meet: kept, said. */
10368
- stale: z31.boolean().optional()
10840
+ stale: z31.boolean().optional(),
10841
+ /**
10842
+ * 3.19 (ADR 0204): a pairing that goes over what the call's cited line names: the box it
10843
+ * names (the pairing moved the call from it), what is written, and the person's reason.
10844
+ */
10845
+ over: z31.object({ box: z31.string(), text: z31.string(), reason: z31.string().optional() }).optional()
10369
10846
  }))
10370
10847
  });
10371
10848
  var SavedCanvasView = z31.object({
@@ -10399,6 +10876,181 @@ var RuleFromPairingResult = z31.object({
10399
10876
  rule: z31.string(),
10400
10877
  activate: z31.string()
10401
10878
  });
10879
+ var DeclaredArrowView = z31.object({
10880
+ from: LinkBox,
10881
+ to: LinkBox,
10882
+ why: z31.string(),
10883
+ by: z31.string(),
10884
+ at: z31.string(),
10885
+ planned: z31.boolean().optional(),
10886
+ file: z31.string()
10887
+ });
10888
+ var FindOutcome = z31.enum(["found", "found-loose", "elsewhere", "not-found"]);
10889
+ var FindEntryView = z31.object({
10890
+ to: LinkBox,
10891
+ at: z31.string(),
10892
+ commit: z31.string().optional(),
10893
+ outcome: FindOutcome,
10894
+ facts: z31.array(z31.string()),
10895
+ looked: z31.array(z31.string()),
10896
+ other: z31.string().optional(),
10897
+ rejected: z31.array(z31.object({ fact: z31.string(), why: z31.string() })).optional(),
10898
+ shape: z31.object({ type: z31.string(), why: z31.string().optional(), at: z31.string(), value: z31.string() }).optional()
10899
+ });
10900
+ var ConnectNeed = z31.object({
10901
+ need: z31.enum(["pick-repo", "no-repo", "read", "verify", "add-system"]),
10902
+ /** Which end it is about. */
10903
+ end: z31.enum(["from", "to"]),
10904
+ /** The box's name as the map draws it. */
10905
+ label: z31.string(),
10906
+ /** `pick-repo`: the repos the system holds; `read`/`verify`: the repo. */
10907
+ repos: z31.array(z31.string()).optional(),
10908
+ /** The step the panel's button runs (the same as In a terminal). */
10909
+ command: z31.string().optional()
10910
+ });
10911
+ var ConnectView = z31.object({
10912
+ from: LinkBox,
10913
+ to: LinkBox,
10914
+ fromName: z31.string(),
10915
+ toName: z31.string(),
10916
+ mechanism: z31.enum(["calls", "connected", "declared", "declare", "needs"]),
10917
+ needs: z31.array(ConnectNeed),
10918
+ candidates: LinkCandidatesView.optional(),
10919
+ existing: z31.number().int().nonnegative(),
10920
+ declared: DeclaredArrowView.optional(),
10921
+ superseded: z31.object({ calls: z31.number().int().positive() }).optional(),
10922
+ /** The callee is a gateway and the caller an outside system: its routes can be declared. */
10923
+ routes: z31.boolean().optional(),
10924
+ /** A.6: the last find's entry for these two boxes, when there is one. */
10925
+ find: FindEntryView.optional(),
10926
+ /** A.7: after `not-found`, `again` (the clone moved, or a reading rule became active) or `anyway`. */
10927
+ findAgain: z31.enum(["again", "anyway"]).optional()
10928
+ });
10929
+ var ArrowOfInterfaceView = z31.object({ declared: DeclaredArrowView });
10930
+ var SupersededArrowsView = z31.object({
10931
+ items: z31.array(z31.object({
10932
+ from: LinkBox,
10933
+ to: LinkBox,
10934
+ by: z31.string(),
10935
+ at: z31.string(),
10936
+ calls: z31.number().int().positive()
10937
+ }))
10938
+ });
10939
+ var AddSystemOnArrow = z31.strictObject({
10940
+ name: z31.string().min(1).max(120),
10941
+ boundary: z31.enum(["vendor", "internal"])
10942
+ });
10943
+ var ArrowRequestFields = {
10944
+ from: LinkBox,
10945
+ to: LinkBox,
10946
+ why: z31.string().trim().min(3).max(500),
10947
+ planned: z31.boolean().optional(),
10948
+ addSystem: AddSystemOnArrow.optional()
10949
+ };
10950
+ var DeclareArrowRequest = z31.strictObject({
10951
+ kind: z31.literal("link"),
10952
+ ...ArrowRequestFields,
10953
+ preview: z31.boolean().optional()
10954
+ });
10955
+ var UndeclareArrowRequest = z31.strictObject({
10956
+ kind: z31.literal("link"),
10957
+ from: LinkBox,
10958
+ to: LinkBox,
10959
+ preview: z31.boolean().optional()
10960
+ });
10961
+ var MapEditWrote = z31.union([
10962
+ z31.strictObject({ edit: z31.number().int(), file: z31.string(), lines: z31.array(z31.string()).min(1) }),
10963
+ z31.strictObject({
10964
+ edit: z31.number().int(),
10965
+ file: z31.string(),
10966
+ link: DeclaredArrowView,
10967
+ /** The system the same write added (3.1), taken away with it while still as added. */
10968
+ addedSystem: z31.string().optional(),
10969
+ /** The profile's version before the write raised it to 3: Undo puts it back. */
10970
+ raisedFrom: z31.number().int().optional()
10971
+ }),
10972
+ /** A gateway route a system was declared to call (1.3's "Say which routes"). */
10973
+ z31.strictObject({
10974
+ edit: z31.number().int(),
10975
+ file: z31.string(),
10976
+ route: z31.object({ system: z31.string(), value: z31.string() })
10977
+ })
10978
+ ]);
10979
+ var MapEditsUndoRequest = z31.strictObject({ wrote: z31.array(MapEditWrote).min(1).max(100) });
10980
+ var ReposRunRequest = z31.strictObject({
10981
+ platform: RecordId.optional(),
10982
+ /** The repos (as POST /api/setup/repos takes them); the same list again continues. */
10983
+ repos: AddReposRequest.shape.repos,
10984
+ /** After the hand-off pause: the person read them with their assistant; go on to Apply. */
10985
+ read: z31.boolean().optional()
10986
+ });
10987
+ var ReposRunPart = z31.object({
10988
+ part: z31.enum(["add", "sync", "read", "apply"]),
10989
+ state: z31.enum(["done", "waiting", "stopped", "failed"]),
10990
+ repos: z31.array(z31.object({
10991
+ repo: z31.string(),
10992
+ state: z31.enum(["done", "waiting", "stopped", "failed"]),
10993
+ why: z31.string().optional()
10994
+ }))
10995
+ });
10996
+ var ReposRunResult = z31.object({
10997
+ parts: z31.array(ReposRunPart),
10998
+ handoff: z31.object({ command: z31.string() }).optional(),
10999
+ /**
11000
+ * The second review: an Apply whose build refused (a large removal, a hand edit) waits for the
11001
+ * person's confirm: its listing, which Set up › Activity › Catalog builds confirms.
11002
+ */
11003
+ refused: BuildRefusalView.optional(),
11004
+ /** How many of the repos are on the map (applied), of how many. */
11005
+ done: z31.number().int().nonnegative(),
11006
+ of: z31.number().int().nonnegative()
11007
+ });
11008
+ var ConnectFindRequest = z31.strictObject({
11009
+ /** The second review: a repo id (the record id rule), so it never reaches a path as `../x`. */
11010
+ from: RecordId,
11011
+ to: LinkBox,
11012
+ mode: z31.enum(["copilot-acp", "hand-off"]).optional(),
11013
+ /** Hand-off: the person's assistant wrote the answer; read it and go on. */
11014
+ read: z31.boolean().optional(),
11015
+ job: z31.boolean().optional()
11016
+ });
11017
+ var FindResult = z31.object({
11018
+ /** The read waits for the person's assistant: the brief, where its answer goes, what to paste. */
11019
+ handoff: z31.object({ brief: z31.string(), answer: z31.string(), command: z31.string() }).optional(),
11020
+ /**
11021
+ * The third review (A.2's first part): B, a repo with no facts on record, is read whole first,
11022
+ * and here the app can't start the assistant: what to paste to read it, then the find to run.
11023
+ */
11024
+ readFirst: z31.object({ repo: z31.string(), command: z31.string(), then: z31.string() }).optional(),
11025
+ entry: FindEntryView.optional(),
11026
+ brief: z31.string(),
11027
+ report: z31.string().optional(),
11028
+ /** What of the answer was left out (an id that is no call fact of A, a file A doesn't have). */
11029
+ leftOut: z31.array(z31.string()),
11030
+ /**
11031
+ * The second review: `verify <A> --write` didn't build (its build refused, or verify refused the
11032
+ * facts). The session's facts and answer are saved; no outcome is told from the catalog before
11033
+ * this build, and the report isn't written. `refused` is the build's refusal (its listing, which
11034
+ * Set up › Activity › Catalog builds confirms); `lines` what verify said; `command` the way on once
11035
+ * it is confirmed or fixed (the find's --read, which checks the answer and builds again).
11036
+ */
11037
+ notBuilt: z31.object({
11038
+ /**
11039
+ * The final review: B's, when the stop is B's read whole first (A.2's first part): its build
11040
+ * refused (`refused`), or the read itself didn't finish (`readFailed`). A's otherwise.
11041
+ */
11042
+ repo: z31.string().optional(),
11043
+ readFailed: z31.literal(true).optional(),
11044
+ message: z31.string(),
11045
+ lines: z31.array(z31.string()),
11046
+ refused: BuildRefusalView.optional(),
11047
+ command: z31.string()
11048
+ }).optional()
11049
+ });
11050
+ var RuleFromFindRequest = z31.strictObject({
11051
+ repo: RecordId,
11052
+ to: LinkBox
11053
+ });
10402
11054
  var CopilotRunKind = z31.enum(["stale", "gaps", "all", "repos"]);
10403
11055
  var StartCopilotRunRequest = z31.object({
10404
11056
  /** stale: the repos whose clone moved past their facts; gaps: the second pass; all: every repo not read yet; repos: the repos named, read whole. */
@@ -10565,6 +11217,9 @@ var ActivityEntry = z31.object({
10565
11217
  stop: z31.string().optional(),
10566
11218
  /** 3.12.0: Stop was asked and it is ending. */
10567
11219
  stopping: z31.boolean().optional(),
11220
+ /** 3.19.0 (ADR 0202 point 2): a job's `stoppable` and `stopLands`, on its entry. */
11221
+ stoppable: z31.boolean().optional(),
11222
+ stopLands: StopLands.optional(),
10568
11223
  /**
10569
11224
  * 3.12.0 (beta.27 review): how a `done` entry ended when it isn't plain done: `refused`, it
10570
11225
  * refused and wrote nothing (a scan's safety stop), neither done work nor a failure.
@@ -10906,6 +11561,7 @@ var OPS = {
10906
11561
  p("kind", { schema: { type: "string", enum: RECORD_KINDS } }),
10907
11562
  q("status"),
10908
11563
  q("system"),
11564
+ q("repo", str3, "3.19.0: only records of this repo (a component's own repo field)"),
10909
11565
  q("q", str3, "Text search over id and name"),
10910
11566
  q("confidence", str3, "2.63.0: only records of this confidence (verified, inferred, ...)"),
10911
11567
  q("limit", { type: "integer", minimum: 1, maximum: 500 }),
@@ -11051,7 +11707,7 @@ var OPS = {
11051
11707
  "/api/triage/{itemId}/decide": {
11052
11708
  post: {
11053
11709
  id: "decideTriage",
11054
- summary: "Choose a triage item's option as the signed-in person; writes a curated decision",
11710
+ summary: "Choose a triage item's option as the signed-in person; writes your choice (one of your changes)",
11055
11711
  tag: "views",
11056
11712
  params: [p("itemId")],
11057
11713
  body: TriageDecideRequest,
@@ -11211,7 +11867,7 @@ var OPS = {
11211
11867
  "/api/ask": {
11212
11868
  get: {
11213
11869
  id: "ask",
11214
- summary: "Answer a plain-language question from the catalog; the query used is always returned. 3.6.0 (ADR 0191): `knowledge` (KnowledgeAnswerView) says what the organisation's knowledge items, wiki snapshots and inputs/ files say to it, each cited",
11870
+ summary: "Answer a plain-language question from the catalog; the query used is always returned. 3.6.0 (ADR 0191): `knowledge` (KnowledgeAnswerView) says what the organisation's knowledge items, wiki snapshots and inputs/ files say to it, each cited. 3.19.0 (beta.30): when the answer is who receives a topic, `receivers` (root, roots?, receivers, affected, further, gaps: every Endpoint of the topic, each record once); `also` (the topic's other Endpoints, one per consumer) and `named` (its name); `query` and `impact` stay the first Endpoint's walk",
11215
11871
  tag: "catalog",
11216
11872
  params: [q("q", str3, "The question, e.g. who calls ledger-api?")],
11217
11873
  ok: {
@@ -11525,7 +12181,7 @@ var OPS = {
11525
12181
  "/api/changes/{changeId}/conformance": {
11526
12182
  get: {
11527
12183
  id: "getChangeConformance",
11528
- summary: "Does the code do what the design says: the newest check of each repo's branch against the change's target flows, with what is missing, still there or unexpected and where (ADR 0114)",
12184
+ summary: "Does the code do what the design says: the newest check of each repo's branch against the change's target flows, with what is missing, still there or unexpected and where (ADR 0114), and against each claim the change states, each operation's sets in its repos and each of a quick change's In the code rows, as present, present differently, missing, not checkable or unconfirmed (ADR 0206)",
11529
12185
  tag: "changes",
11530
12186
  params: [p("changeId")],
11531
12187
  ok: { status: 200, schema: "ChangeConformance", description: "OK" },
@@ -11578,9 +12234,23 @@ var OPS = {
11578
12234
  "/api/trust": {
11579
12235
  get: {
11580
12236
  id: "getTrust",
11581
- summary: "How far to trust each repo's map: its facts, the verifier's report (kept, rejected, coverage, unknown files), the facts' commit against the checkout's, and whether its catalog records come from the facts or the readers (ADR 0124)",
12237
+ summary: "How far to trust each repo's map: its facts, the verifier's report (kept, rejected, coverage, unknown files), the facts' commit against the checkout's, and whether its catalog records come from the facts or the readers (ADR 0124). 3.19.0 (ADR 0202 point 4): with repo, only that repo's row (404 for an id that is no repo); with repo and rejected=1, its lists hold only the rejected lines, every one (the other lists are empty); rejected=1 without repo is 400",
11582
12238
  tag: "workspace",
11583
- ok: { status: 200, schema: "TrustView", description: "OK" }
12239
+ params: [
12240
+ q("repo", str3, "3.19.0: only this repo's row"),
12241
+ q("rejected", { type: "string", enum: ["1"] }, "3.19.0: with repo, only its rejected facts")
12242
+ ],
12243
+ ok: { status: 200, schema: "TrustView", description: "OK" },
12244
+ errors: [400, 404]
12245
+ }
12246
+ },
12247
+ "/api/support/bundle": {
12248
+ post: {
12249
+ id: "saveSupportBundle",
12250
+ summary: "3.19.0 (ADR 0202 point 1): save a support bundle, as atticus support bundle does: the same files in the same zip under .atticus/logs/, given back for the person to save. Not a job, no network call, and no parameter names a destination: nothing is sent anywhere, and a person reads every file before it leaves",
12251
+ tag: "system",
12252
+ ok: { status: 200, schema: "SupportBundleView", description: "Saved on this machine" },
12253
+ errors: [400]
11584
12254
  }
11585
12255
  },
11586
12256
  "/api/trust/answer-boxes/ignore": {
@@ -11712,7 +12382,7 @@ var OPS = {
11712
12382
  "/api/build/edits/curate": {
11713
12383
  post: {
11714
12384
  id: "curateHandEdits",
11715
- summary: "3.12.0 (ADR 0195 point 4): atticus catalog edits --curate then atticus catalog build, as one local job: each hand edit listed becomes a curated decision in catalog/curated/ (an edit to propose), and the build with them keeps what the edited files hold. 409 when the edits are no longer the count listed",
12385
+ summary: "3.12.0 (ADR 0195 point 4): atticus catalog edits --curate then atticus catalog build, as one local job: each hand edit listed becomes a kept edit (one of the person's changes) in catalog/curated/ (an edit to propose), and the build with them keeps what the edited files hold. 409 when the edits are no longer the count listed",
11716
12386
  tag: "scans",
11717
12387
  body: CatalogEditsRequest,
11718
12388
  ok: {
@@ -11748,7 +12418,7 @@ var OPS = {
11748
12418
  "/api/build/upgrade": {
11749
12419
  get: {
11750
12420
  id: "getCatalogUpgrade",
11751
- summary: "3.12.0 (ADR 0195 point 6): the upgrade to source slots as a dry run, as atticus upgrade --json lists it: every file atticus upgrade --yes writes with its size and hash, the copy kept in generated-before-upgrade/, and the first build's changes (none, or it refuses). Writes nothing",
12421
+ summary: "3.12.0 (ADR 0195 point 6): the upgrade to stored reads (source slots) as a dry run, as atticus upgrade --json lists it: every file atticus upgrade --yes writes with its size and hash, the copy kept in generated-before-upgrade/, and the first build's changes (none, or it refuses). Writes nothing",
11752
12422
  tag: "scans",
11753
12423
  ok: { status: 200, schema: "CatalogUpgradeView", description: "OK" }
11754
12424
  },
@@ -11950,6 +12620,19 @@ var OPS = {
11950
12620
  errors: [404, 409]
11951
12621
  }
11952
12622
  },
12623
+ "/api/jobs": {
12624
+ get: {
12625
+ id: "listJobs",
12626
+ summary: "3.19.0 (ADR 0202 point 5): the jobs a page action started, so its panel finds a running one again after a reload: the running ones that match, then the finished ones this server still keeps (100 in all, lost when atticus ui stops), newest first. With no parameter, every job kept",
12627
+ tag: "scans",
12628
+ params: [
12629
+ q("action", { type: "string", enum: [...JOB_ACTIONS] }, "The page action that started it"),
12630
+ q("repo", str3, "The repo it is for")
12631
+ ],
12632
+ ok: { status: 200, schema: "JobList", description: "OK" },
12633
+ errors: [400]
12634
+ }
12635
+ },
11953
12636
  "/api/jobs/{jobId}": {
11954
12637
  get: {
11955
12638
  id: "getJob",
@@ -12424,11 +13107,11 @@ var OPS = {
12424
13107
  "/api/runs/handoff": {
12425
13108
  post: {
12426
13109
  id: "prepareStep",
12427
- summary: "2.66.0 (UX review): prepare an AI step for the person's own assistant (`--handoff`): its run's page has the prompt to copy and Done",
13110
+ summary: "2.66.0 (UX review): prepare an AI step for the person's own assistant (`--handoff`): its run's page has the prompt to copy and Done. 3.19.0: a stage's step is refused (409) while an AI step runs on the server or the same stage of the change runs",
12428
13111
  tag: "ai",
12429
13112
  body: StartStepRequest,
12430
13113
  ok: { status: 201, schema: "PreparedStepView", description: "Prepared" },
12431
- errors: [400, 422]
13114
+ errors: [400, 409, 422]
12432
13115
  }
12433
13116
  },
12434
13117
  "/api/links/candidates": {
@@ -12469,7 +13152,7 @@ var OPS = {
12469
13152
  },
12470
13153
  post: {
12471
13154
  id: "matchLinks",
12472
- summary: "Start a Copilot session that proposes pairings of A's loose calls with B's APIs from a brief of their cited lines (ADR 0178, part 2); it writes only its answer file, and nothing is a correction until a person ticks and confirms it. Where copilot-acp isn't allowed, writes the brief for Copilot Chat and says so",
13155
+ summary: "Start a Copilot session that proposes pairings of A's calls with no arrow with B's APIs from a brief of their cited lines (ADR 0178, part 2); it writes only its answer file, and nothing is a correction until a person ticks and confirms it. Where copilot-acp isn't allowed, writes the brief for Copilot Chat and says so",
12473
13156
  tag: "views",
12474
13157
  body: MatchLinksRequest,
12475
13158
  ok: { status: 202, schema: "MatchLinksView", description: "Accepted" },
@@ -12563,6 +13246,14 @@ var OPS = {
12563
13246
  errors: [400]
12564
13247
  }
12565
13248
  },
13249
+ "/api/status": {
13250
+ get: {
13251
+ id: "getStatus",
13252
+ summary: "3.19.0 (ADR 0202): where this metarepo stands (atticus status --json): this Atticus, the metarepo's stamp, whether this Atticus reads its catalog, what the extension needs, the state that holds (no-metarepo, catalog-newer, atticus-behind, metarepo-behind, up-to-date), the one command to run and all of it in one line. Reads only",
13253
+ tag: "run",
13254
+ ok: { status: 200, schema: "StandingView", description: "OK" }
13255
+ }
13256
+ },
12566
13257
  "/api/upgrade": {
12567
13258
  get: {
12568
13259
  id: "getUpgrade",
@@ -12572,10 +13263,12 @@ var OPS = {
12572
13263
  },
12573
13264
  post: {
12574
13265
  id: "runUpgrade",
12575
- summary: "Run atticus upgrade as a local job on the person's click: it backs up every file it changes, runs each pending step and stamps the metarepo; the changes are files to propose for review",
13266
+ summary: "Run atticus upgrade as a local job on the person's click: it backs up every file it changes, runs each pending step and stamps the metarepo; the changes are files to propose for review. 3.19.0: a step whose build waits only for its removals over the limits ends the job refused, its result's `confirm` giving the count and the plan; sent back, they confirm exactly that list (--allow-removals), any other refuses again and writes nothing",
12576
13267
  tag: "run",
13268
+ body: UpgradeRequest,
13269
+ bodyOptional: true,
12577
13270
  ok: { status: 202, schema: "JobAccepted", description: "Job started" },
12578
- errors: [409]
13271
+ errors: [400, 409]
12579
13272
  }
12580
13273
  },
12581
13274
  // ADR 0190: settings and setup in the app, "Edit, then Propose".
@@ -12789,10 +13482,96 @@ var OPS = {
12789
13482
  errors: [400, 404]
12790
13483
  }
12791
13484
  },
13485
+ "/api/connect": {
13486
+ get: {
13487
+ id: "getConnect",
13488
+ summary: "3.19.0 (ADR 0204): what connecting box `from` to box `to` is, the direction as asked: the calls to connect (those going elsewhere first), connected already, declared already, declare the arrow, or what is needed first",
13489
+ tag: "views",
13490
+ params: [
13491
+ q("from", str3, "The caller: repo:<id> or system:<id>"),
13492
+ q("to", str3, "The callee: repo:<id> or system:<id>"),
13493
+ q("job", str3, "1 runs the read as a job (202 JobAccepted; its result `answer` is this view)")
13494
+ ],
13495
+ ok: { status: 200, schema: "ConnectView", description: "OK" },
13496
+ alsoOk: { status: 202, schema: "JobAccepted", description: "Started as a job (`job=1`)" },
13497
+ errors: [400, 404]
13498
+ }
13499
+ },
13500
+ "/api/declared-links/arrow": {
13501
+ get: {
13502
+ id: "getDeclaredArrowOf",
13503
+ summary: "3.19.0 (ADR 0204 1.6): the profile's declared arrow a drawn Interface flagged declared-link is, with who, when and why",
13504
+ tag: "views",
13505
+ params: [q("interface", str3, "The Interface's id")],
13506
+ ok: { status: 200, schema: "ArrowOfInterfaceView", description: "OK" },
13507
+ errors: [400, 404]
13508
+ }
13509
+ },
13510
+ "/api/declared-links/superseded": {
13511
+ get: {
13512
+ id: "getSupersededArrows",
13513
+ summary: "3.19.0 (ADR 0204 1.7): the declared arrows the code now shows, as the last build listed them, for the count above the map",
13514
+ tag: "views",
13515
+ ok: { status: 200, schema: "SupersededArrowsView", description: "OK" },
13516
+ errors: []
13517
+ }
13518
+ },
13519
+ "/api/connect/find": {
13520
+ post: {
13521
+ id: "findDeclaredArrow",
13522
+ summary: "3.19.0 (ADR 0204 A): find a declared arrow in the caller's code, as a job: the brief from the profile's item (a hint, never evidence), the assistant's session or the hand-off, the answer checked, verify --write, and the outcome told from the catalog after the build; its result `answer` is FindResult",
13523
+ tag: "scans",
13524
+ body: ConnectFindRequest,
13525
+ ok: {
13526
+ status: 202,
13527
+ schema: "JobAccepted",
13528
+ description: "Started: its result `answer` is FindResult"
13529
+ },
13530
+ errors: [400, 404, 409]
13531
+ }
13532
+ },
13533
+ "/api/reading-rules/from-find": {
13534
+ post: {
13535
+ id: "ruleFromFind",
13536
+ summary: "3.19.0 (ADR 0204 A.8): Make this a reading rule from a call a find confirmed: a draft in org-pack/reading-rules/types/<type>.yaml, given to no read until a person sets it active",
13537
+ tag: "workspace",
13538
+ body: RuleFromFindRequest,
13539
+ ok: { status: 200, schema: "RuleFromPairingResult", description: "OK" },
13540
+ errors: [400, 404, 409]
13541
+ }
13542
+ },
13543
+ "/api/setup/repos/run": {
13544
+ post: {
13545
+ id: "runNewRepos",
13546
+ summary: "3.19.0 (ADR 0204 decision 4): add, sync, read and apply new repos as one local job of four parts, worked out from disk so the same request continues where a Stop left it; Stop is heard between parts and repos; the read pauses with the command to paste where the app can't start the assistant. Its job's result carries ReposRunResult",
13547
+ tag: "workspace",
13548
+ body: ReposRunRequest,
13549
+ ok: {
13550
+ status: 202,
13551
+ schema: "JobAccepted",
13552
+ description: "Started: its result carries ReposRunResult"
13553
+ },
13554
+ errors: [400, 409]
13555
+ }
13556
+ },
13557
+ "/api/map/edits/undo": {
13558
+ post: {
13559
+ id: "undoMapEdits",
13560
+ summary: "3.19.0 (ADR 0204 2.4): take back exactly what an Apply of Edit the map or Connect wrote (its result's `wrote`), each only while it is as written, then build once, as a local job; its result is MapEditsResult",
13561
+ tag: "scans",
13562
+ body: MapEditsUndoRequest,
13563
+ ok: {
13564
+ status: 202,
13565
+ schema: "JobAccepted",
13566
+ description: "Started: its result is MapEditsResult"
13567
+ },
13568
+ errors: [400, 409]
13569
+ }
13570
+ },
12792
13571
  "/api/declared-links/undo": {
12793
13572
  post: {
12794
13573
  id: "undeclareLink",
12795
- summary: "Remove exactly one declared topic or call from a system in the profile (ADR 0174)",
13574
+ summary: "Remove exactly one declared topic or call from a system in the profile (ADR 0174), or (3.19.0, `kind: link`) one declared arrow from the profile's links",
12796
13575
  tag: "workspace",
12797
13576
  body: UndeclareLinkRequest,
12798
13577
  ok: { status: 200, schema: "FileChangeResult", description: "OK" },
@@ -13682,6 +14461,17 @@ var OPS = {
13682
14461
  errors: [400, 404, 409, 422]
13683
14462
  }
13684
14463
  },
14464
+ "/api/changes/{changeId}/stages/{stage}/accept": {
14465
+ post: {
14466
+ id: "acceptStageFinding",
14467
+ summary: "3.19.0 (ADR 0203 A): accept a blocking finding of the stage's own gate (stage-<stage>) with a reason, in the name of the person using the app, as atticus finding <change> <id> waive does; refused (403) for a constitution rule, a rule a person can't accept, an assistant (a coding assistant's terminal included), or inside a Copilot session Atticus started; 409 when it is no longer open. Then the app goes on with the stage, whoever started it, once nothing else holds it and no step of it runs, and says what it did (goesOn). Returns the file written, the thread and goesOn",
14468
+ tag: "changes",
14469
+ params: [p("changeId"), p("stage", { schema: { type: "string", enum: [...THREAD_STAGES] } })],
14470
+ body: StageAcceptRequest,
14471
+ ok: { status: 200, schema: "StageAcceptResult", description: "Accepted" },
14472
+ errors: [400, 403, 404, 409]
14473
+ }
14474
+ },
13685
14475
  "/api/changes/{changeId}/knowledge": {
13686
14476
  get: {
13687
14477
  id: "getChangeKnowledge",
@@ -13782,13 +14572,29 @@ init_common();
13782
14572
  init_kinds();
13783
14573
  init_kept_files();
13784
14574
 
14575
+ // packages/core/dist/record-cache.js
14576
+ var inMemory = /* @__PURE__ */ new Map();
14577
+ var HELD = "the catalog's parses (a writer's read)";
14578
+ onAppMemoryRelease(() => inMemory.clear(), () => ({ [HELD]: [...inMemory.values()].reduce((n, m) => n + m.bytes, 0) }));
14579
+ var MEMORY_MAX = 160 * 1024 * 1024;
14580
+
13785
14581
  // packages/core/dist/gates-migrate.js
13786
14582
  init_orgpack();
13787
14583
  import { isMap as isMap6, isSeq as isSeq4, parseDocument as parseDocument6 } from "yaml";
13788
14584
 
13789
14585
  // packages/core/dist/change-types-migrate.js
14586
+ init_orgpack_defaults();
13790
14587
  init_orgpack();
13791
- import { isMap as isMap7, parseDocument as parseDocument7 } from "yaml";
14588
+ import { isMap as isMap7, isSeq as isSeq5, parseDocument as parseDocument7 } from "yaml";
14589
+ var QUICK_ENTRY_ONE_LINE = `{ id: ${QUICK_CHANGE_TYPE.id}, name: ${QUICK_CHANGE_TYPE.name}, phases: [${QUICK_CHANGE_TYPE.phases.join(", ")}], artifacts: [${QUICK_CHANGE_TYPE.artifacts.join(", ")}], lenses: [${QUICK_CHANGE_TYPE.lenses.map((l) => l === "true" ? '"true"' : l).join(", ")}] }`;
14590
+ var QUICK_ENTRY = [
14591
+ `- id: ${QUICK_CHANGE_TYPE.id}`,
14592
+ ` name: ${QUICK_CHANGE_TYPE.name}`,
14593
+ ` description: ${JSON.stringify(QUICK_CHANGE_TYPE.description)}`,
14594
+ ` phases: [${QUICK_CHANGE_TYPE.phases.join(", ")}]`,
14595
+ ` artifacts: [${QUICK_CHANGE_TYPE.artifacts.join(", ")}]`,
14596
+ ` lenses: [${QUICK_CHANGE_TYPE.lenses.map((l) => l === "true" ? '"true"' : l).join(", ")}]`
14597
+ ];
13792
14598
 
13793
14599
  // packages/core/dist/sources-migrate.js
13794
14600
  init_orgpack();
@@ -14358,7 +15164,7 @@ var QuestionProposal = z33.strictObject({
14358
15164
  });
14359
15165
 
14360
15166
  // packages/core/dist/setup-edit.js
14361
- import { isMap as isMap10, isNode as isNode2, isScalar, isSeq as isSeq5, parseDocument as parseDocument10, stringify as stringify6 } from "yaml";
15167
+ import { isMap as isMap10, isNode as isNode2, isScalar, isSeq as isSeq6, parseDocument as parseDocument10, stringify as stringify6 } from "yaml";
14362
15168
  init_ai();
14363
15169
  init_conventions();
14364
15170
  init_orgpack();
@@ -14403,7 +15209,7 @@ import { parse as parse15, stringify as stringify7 } from "yaml";
14403
15209
  init_question();
14404
15210
 
14405
15211
  // packages/core/dist/declared-links.js
14406
- import { isMap as isMap11, isScalar as isScalar2, isSeq as isSeq6, parseDocument as parseDocument11 } from "yaml";
15212
+ import { isMap as isMap11, isScalar as isScalar2, isSeq as isSeq7, parseDocument as parseDocument11 } from "yaml";
14407
15213
  init_orgpack();
14408
15214
 
14409
15215
  // packages/core/dist/declarable-routes.js
@@ -15399,6 +16205,42 @@ function spawnSandbox(o) {
15399
16205
  name: `atticus-plugin-${o.id}`
15400
16206
  });
15401
16207
  }
16208
+ var HEAP_WATCH_MS = 25;
16209
+ function watchHeap(worker, memoryMb, over) {
16210
+ const read = worker.getHeapStatistics?.bind(worker);
16211
+ if (!read)
16212
+ return () => void 0;
16213
+ const MB = 2 ** 20;
16214
+ const young = Math.max(4, Math.min(16, Math.floor(memoryMb / 4)));
16215
+ let stopped = false;
16216
+ let reading = false;
16217
+ const stop = () => {
16218
+ stopped = true;
16219
+ clearInterval(timer);
16220
+ };
16221
+ const timer = setInterval(() => {
16222
+ if (reading || stopped)
16223
+ return;
16224
+ reading = true;
16225
+ read().then(
16226
+ (h) => {
16227
+ reading = false;
16228
+ if (stopped)
16229
+ return;
16230
+ if (h.heap_size_limit <= (memoryMb + 3 * young + 16) * MB)
16231
+ return stop();
16232
+ if (h.used_heap_size > (2 * memoryMb + young) * MB) {
16233
+ stop();
16234
+ over();
16235
+ }
16236
+ },
16237
+ // Not running yet, or ended: the next read, or the worker's exit, says.
16238
+ () => reading = false
16239
+ );
16240
+ }, HEAP_WATCH_MS);
16241
+ timer.unref();
16242
+ return stop;
16243
+ }
15402
16244
  function runInWorker(p2, repo, ctx) {
15403
16245
  const records = [];
15404
16246
  const emits = new Set(p2.emits);
@@ -15420,12 +16262,14 @@ function runInWorker(p2, repo, ctx) {
15420
16262
  return;
15421
16263
  settled = true;
15422
16264
  clearTimeout(timer);
16265
+ unwatch();
15423
16266
  void worker.terminate();
15424
16267
  if (err)
15425
16268
  reject(err);
15426
16269
  else
15427
16270
  resolve2(records);
15428
16271
  };
16272
+ const unwatch = watchHeap(worker, memoryMb, () => finish(new PluginRunError(`stopped: it used more than its ${memoryMb} MB memory limit`, "memory")));
15429
16273
  const timer = setTimeout(() => finish(new PluginRunError(`stopped after ${p2.limits.timeoutMs} ms, its time limit`, "timeout")), p2.limits.timeoutMs);
15430
16274
  const outside = (what, path) => finish(new PluginRunError(`blocked: tried to ${what} ${JSON.stringify(path)}, which is outside the repo`, "blocked"));
15431
16275
  const answer = (id, ok, text3) => {
@@ -15511,12 +16355,14 @@ function runTranslator(p2, fn, arg) {
15511
16355
  return;
15512
16356
  settled = true;
15513
16357
  clearTimeout(timer);
16358
+ unwatch();
15514
16359
  void worker.terminate();
15515
16360
  if (err)
15516
16361
  reject(err);
15517
16362
  else
15518
16363
  resolve2(value);
15519
16364
  };
16365
+ const unwatch = watchHeap(worker, p2.limits.memoryMb, () => finish(new PluginRunError(`stopped: it used more than its ${p2.limits.memoryMb} MB memory limit`, "memory")));
15520
16366
  const timer = setTimeout(() => finish(new PluginRunError(`stopped after ${p2.limits.timeoutMs} ms, its time limit`, "timeout")), p2.limits.timeoutMs);
15521
16367
  worker.on("message", (m) => {
15522
16368
  if (settled)