@basou/core 0.38.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -107,21 +107,12 @@ declare function removeStopHook(settings: unknown): StopHookRemoval;
107
107
  declare function findBasouStopHookCommand(settings: unknown): string | null;
108
108
 
109
109
  /**
110
- * Schema for `.basou/manifest.yaml`. The minimal manifest carries
111
- * schema_version, basou_version, workspace metadata, project info, enabled
112
- * capabilities, approval policy, adapter config, and git policy. The
113
- * `adapters."claude-code"` key uses a hyphen; downstream code accesses it
114
- * via bracket notation.
115
- *
116
- * Every object here is `looseObject` (NOT the default strip), so unknown keys
117
- * at every level survive parse. The manifest is the declarative source of truth
118
- * and is git-tracked and read-modify-written by `basou project` commands; with
119
- * the default strip, a field this basou does not recognize — a newer version's
120
- * additive field, a future adapter under `adapters`, a hand-added key — would be
121
- * silently dropped on the next write. Preserving them keeps basou from destroying
122
- * config it does not understand (forward-compatible), while known fields are still
123
- * fully type-checked and validated. {@link unknownManifestKeys} surfaces the
124
- * unrecognized top-level keys so preservation is not silent.
110
+ * The manifest, plus one guard the loose object cannot express: a TOP-LEVEL
111
+ * `confidential` is refused. It belongs under `policies`, and because the
112
+ * object is loose, a stray top-level spelling would otherwise parse fine and be
113
+ * silently ignored an operator would believe the workspace is protected while
114
+ * the face is still written. A safety key that is not honoured must fail
115
+ * loudly, not quietly.
125
116
  */
126
117
  declare const ManifestSchema: z.ZodObject<{
127
118
  schema_version: z.ZodString;
@@ -197,6 +188,12 @@ declare const ManifestSchema: z.ZodObject<{
197
188
  self: "self";
198
189
  }>>;
199
190
  }, z.core.$loose>>>;
191
+ channels: z.ZodOptional<z.ZodObject<{
192
+ codex: z.ZodOptional<z.ZodBoolean>;
193
+ }, z.core.$loose>>;
194
+ policies: z.ZodOptional<z.ZodObject<{
195
+ confidential: z.ZodOptional<z.ZodBoolean>;
196
+ }, z.core.$loose>>;
200
197
  }, z.core.$loose>;
201
198
  /** Inferred runtime type for {@link ManifestSchema}. */
202
199
  type Manifest = z.infer<typeof ManifestSchema>;
package/dist/index.js CHANGED
@@ -1782,7 +1782,35 @@ var WorkspaceMetaSchema = z4.looseObject({
1782
1782
  */
1783
1783
  view: SourceRootSchema.optional()
1784
1784
  });
1785
- var ManifestSchema = z4.looseObject({
1785
+ var ChannelsSchema = z4.looseObject({
1786
+ /**
1787
+ * Render this workspace's orientation into `~/.codex/AGENTS.md` on `basou
1788
+ * refresh` / `basou run codex`. A boolean today; if a face ever needs
1789
+ * per-block control this widens to `boolean | object`, which existing
1790
+ * manifests keep parsing — so the boolean does not foreclose that.
1791
+ */
1792
+ codex: z4.boolean().optional().meta({
1793
+ description: "Opt in to rendering this workspace's orientation into the user-global ~/.codex/AGENTS.md on `basou refresh` and `basou run codex`. Off when absent: that file is auto-loaded by Codex for every project on the machine, so nothing is written there unless the workspace says so."
1794
+ })
1795
+ });
1796
+ var PoliciesSchema = z4.looseObject({
1797
+ /**
1798
+ * This workspace's provenance must not persist where another workspace's
1799
+ * tool reads it. That is the GOAL the key states; what it gates today is one
1800
+ * thing: rendering the orientation into the user-global `~/.codex/AGENTS.md`
1801
+ * (`basou refresh` / `basou run codex`) — never, regardless of `channels`, so
1802
+ * a confidential workspace cannot be re-enabled by a second declaration in
1803
+ * the same file. It does not yet govern `basou protocol sync` (a global
1804
+ * render, not a per-workspace one), and it gates writing only: it cannot keep
1805
+ * another workspace's block out of this workspace's tool (see `basou channel
1806
+ * clear`). Stated as a goal rather than as "never write" so that a transient
1807
+ * render removed before anyone else can read it remains permissible.
1808
+ */
1809
+ confidential: z4.boolean().optional().meta({
1810
+ description: "This workspace's provenance must not persist where another workspace's tool reads it. Today this means its orientation is never rendered into the user-global ~/.codex/AGENTS.md by `basou refresh` or `basou run codex`, regardless of `channels`. It does not yet govern `basou protocol sync`, and it gates writing only \u2014 it cannot keep another workspace's block out of this workspace's tool."
1811
+ })
1812
+ });
1813
+ var ManifestObjectSchema = z4.looseObject({
1786
1814
  schema_version: SchemaVersionSchema,
1787
1815
  // Same forward-compatible format gate as schema_version (accept 0.x.y, gate a
1788
1816
  // higher major with an upgrade error) rather than a hard literal. `basou_version`
@@ -1796,9 +1824,20 @@ var ManifestSchema = z4.looseObject({
1796
1824
  adapters: AdaptersSchema,
1797
1825
  git: GitConfigSchema,
1798
1826
  import: ImportConfigSchema.optional(),
1799
- repos: z4.array(RepoEntrySchema).min(1).optional()
1827
+ repos: z4.array(RepoEntrySchema).min(1).optional(),
1828
+ channels: ChannelsSchema.optional(),
1829
+ policies: PoliciesSchema.optional()
1830
+ });
1831
+ var ManifestSchema = ManifestObjectSchema.superRefine((manifest, ctx) => {
1832
+ if ("confidential" in manifest) {
1833
+ ctx.addIssue({
1834
+ code: "custom",
1835
+ path: ["confidential"],
1836
+ message: "`confidential` is declared under `policies` (policies.confidential: true). A top-level `confidential` is not honoured, so it is rejected rather than ignored."
1837
+ });
1838
+ }
1800
1839
  });
1801
- var KNOWN_TOP_LEVEL_KEYS = new Set(Object.keys(ManifestSchema.shape));
1840
+ var KNOWN_TOP_LEVEL_KEYS = new Set(Object.keys(ManifestObjectSchema.shape));
1802
1841
  function unknownManifestKeys(manifest) {
1803
1842
  return Object.keys(manifest).filter((k) => !KNOWN_TOP_LEVEL_KEYS.has(k)).sort();
1804
1843
  }