anhedral 0.17.0 → 0.19.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.
Files changed (174) hide show
  1. package/README.md +33 -68
  2. package/assets/contracts/LICENSE +201 -0
  3. package/assets/contracts/LICENSE.environment +201 -0
  4. package/assets/contracts/LICENSE.operations +201 -0
  5. package/assets/contracts/deployment-provenance.json +15 -0
  6. package/assets/contracts/environment-provenance.json +11 -0
  7. package/assets/contracts/operations-provenance.json +12 -0
  8. package/assets/launch/application.server.ts.txt +13 -0
  9. package/assets/launch/auth-client.ts.txt +4 -0
  10. package/assets/launch/home.tsx.txt +20 -0
  11. package/assets/launch/minimal-application.server.ts.txt +5 -0
  12. package/assets/launch/minimal-server.ts.txt +7 -0
  13. package/assets/launch/oj/OJ.LICENSE +21 -0
  14. package/assets/launch/oj/run.mjs +82 -0
  15. package/assets/launch/oj/runtime.json +21 -0
  16. package/assets/launch/request-context.ts.txt +3 -0
  17. package/assets/launch/root.tsx.txt +26 -0
  18. package/assets/launch/router.tsx.txt +21 -0
  19. package/assets/launch/server.ts.txt +15 -0
  20. package/assets/launch/sign-in.tsx.txt +53 -0
  21. package/assets/launch/styles.css.txt +19 -0
  22. package/assets/security/credential-patterns.d.mts +3 -0
  23. package/assets/security/credential-patterns.mjs +59 -0
  24. package/assets/stack/api-index.ts.txt +6 -1
  25. package/assets/stack/stripe.ts.txt +30 -13
  26. package/assets/ui/catalog.json +36 -324
  27. package/dist/{platforms/web.d.ts → api-proxy.d.ts} +1 -3
  28. package/dist/api-proxy.js +48 -0
  29. package/dist/bin.js +55 -36
  30. package/dist/capability-catalog.d.ts +36 -57
  31. package/dist/capability-catalog.js +65 -67
  32. package/dist/capability-command.d.ts +3 -3
  33. package/dist/capability-command.js +146 -59
  34. package/dist/capability-editor.js +6 -5
  35. package/dist/capability-recipes.js +9 -296
  36. package/dist/cli-arguments.d.ts +2 -0
  37. package/dist/cli-arguments.js +101 -50
  38. package/dist/cli-commands.d.ts +1 -1
  39. package/dist/cli-commands.js +31 -5
  40. package/dist/cli-errors.d.ts +18 -0
  41. package/dist/cli-errors.js +63 -0
  42. package/dist/cli-output.d.ts +22 -0
  43. package/dist/cli-output.js +42 -7
  44. package/dist/command-runner.js +88 -0
  45. package/dist/command-schema.d.ts +16 -0
  46. package/dist/command-schema.js +496 -21
  47. package/dist/command-types.d.ts +1 -0
  48. package/dist/command-types.js +1 -0
  49. package/dist/completion.d.ts +2 -0
  50. package/dist/completion.js +201 -0
  51. package/dist/composition.d.ts +25 -0
  52. package/dist/composition.js +28 -0
  53. package/dist/contracts/cli-transport.d.ts +316 -0
  54. package/dist/contracts/cli-transport.js +236 -0
  55. package/dist/contracts/deployment.d.ts +233 -0
  56. package/dist/contracts/deployment.js +198 -0
  57. package/dist/contracts/environment-file.d.ts +7 -0
  58. package/dist/contracts/environment-file.js +112 -0
  59. package/dist/contracts/environment-transport.d.ts +79 -0
  60. package/dist/contracts/environment-transport.js +110 -0
  61. package/dist/contracts/production-transport.d.ts +71 -0
  62. package/dist/contracts/production-transport.js +56 -0
  63. package/dist/contracts/runtime-logs-transport.d.ts +127 -0
  64. package/dist/contracts/runtime-logs-transport.js +50 -0
  65. package/dist/contracts/source-bundle.d.ts +11 -0
  66. package/dist/contracts/source-bundle.js +197 -0
  67. package/dist/contracts/source-profile.d.ts +4 -0
  68. package/dist/contracts/source-profile.js +5 -0
  69. package/dist/contracts/staging-transport.d.ts +79 -0
  70. package/dist/contracts/staging-transport.js +43 -0
  71. package/dist/dependencies.d.ts +9 -27
  72. package/dist/dependencies.js +19 -66
  73. package/dist/index.d.ts +4 -2
  74. package/dist/index.js +3 -1
  75. package/dist/launch.d.ts +27 -0
  76. package/dist/launch.js +262 -0
  77. package/dist/platform-command.d.ts +9 -0
  78. package/dist/platform-command.js +787 -0
  79. package/dist/platform-environment.d.ts +18 -0
  80. package/dist/platform-environment.js +257 -0
  81. package/dist/platform-operations.d.ts +26 -0
  82. package/dist/platform-operations.js +155 -0
  83. package/dist/platform-production.d.ts +16 -0
  84. package/dist/platform-production.js +135 -0
  85. package/dist/platform-source.d.ts +8 -0
  86. package/dist/platform-source.js +111 -0
  87. package/dist/platform-state.d.ts +15 -0
  88. package/dist/platform-state.js +229 -0
  89. package/dist/platforms/tanstack.d.ts +10 -0
  90. package/dist/platforms/tanstack.js +248 -0
  91. package/dist/registry/usage.d.ts +4 -1
  92. package/dist/registry/usage.js +59 -4
  93. package/dist/scaffold/bootstrap.d.ts +3 -3
  94. package/dist/scaffold/styling.d.ts +3 -2
  95. package/dist/transaction.js +28 -3
  96. package/dist/ui-catalog.d.ts +3 -5
  97. package/dist/ui-catalog.js +8 -24
  98. package/dist/ui-command.d.ts +3 -1
  99. package/dist/ui-command.js +74 -72
  100. package/dist/ui-project.d.ts +4 -2
  101. package/dist/ui-project.js +40 -38
  102. package/dist/util.js +40 -61
  103. package/dist/version.d.ts +1 -1
  104. package/dist/version.js +1 -1
  105. package/docs/capabilities.md +23 -89
  106. package/docs/software-factory.md +208 -9
  107. package/docs/stack-standard.md +7 -17
  108. package/docs/ui.md +9 -22
  109. package/package.json +26 -22
  110. package/assets/stack/ai-schema.ts.txt +0 -5
  111. package/assets/stack/ai.ts.txt +0 -30
  112. package/assets/stack/desktop.rs.txt +0 -21
  113. package/assets/stack/events-schema.ts.txt +0 -12
  114. package/assets/stack/events.ts.txt +0 -59
  115. package/assets/stack/mobile-auth.ts.txt +0 -25
  116. package/assets/stack/mobile-billing.tsx.txt +0 -63
  117. package/assets/stack/mobile-session.tsx.txt +0 -83
  118. package/assets/stack/native-button.tsx.txt +0 -108
  119. package/assets/stack/native-global.css.txt +0 -4
  120. package/assets/stack/native-lib-utils.ts.txt +0 -5
  121. package/assets/stack/native-metro.config.js.txt +0 -6
  122. package/assets/stack/native-nativewind-env.d.ts.txt +0 -1
  123. package/assets/stack/native-tailwind.config.js.txt +0 -73
  124. package/assets/stack/native-text.tsx.txt +0 -89
  125. package/assets/stack/purchases.ts.txt +0 -65
  126. package/assets/stack/revenuecat.ts.txt +0 -88
  127. package/assets/stack/rtc-schema.ts.txt +0 -10
  128. package/assets/stack/rtc.ts.txt +0 -122
  129. package/assets/stack/web-sign-in.tsx.txt +0 -51
  130. package/dist/capabilities.d.ts +0 -11
  131. package/dist/capabilities.js +0 -14
  132. package/dist/dependency-order.d.ts +0 -2
  133. package/dist/dependency-order.js +0 -24
  134. package/dist/platforms/lint.d.ts +0 -1
  135. package/dist/platforms/lint.js +0 -5
  136. package/dist/platforms/web.js +0 -251
  137. package/dist/project-config.d.ts +0 -3
  138. package/dist/project-config.js +0 -16
  139. package/dist/registry/context.d.ts +0 -3
  140. package/dist/registry/context.js +0 -20
  141. package/dist/registry/options.d.ts +0 -2
  142. package/dist/registry/options.js +0 -44
  143. package/dist/registry/resolve.d.ts +0 -11
  144. package/dist/registry/resolve.js +0 -46
  145. package/dist/registry/types.d.ts +0 -60
  146. package/dist/scaffold/api.d.ts +0 -2
  147. package/dist/scaffold/api.js +0 -38
  148. package/dist/scaffold/backend.d.ts +0 -2
  149. package/dist/scaffold/backend.js +0 -36
  150. package/dist/scaffold/compose.d.ts +0 -4
  151. package/dist/scaffold/compose.js +0 -30
  152. package/dist/scaffold/database.d.ts +0 -2
  153. package/dist/scaffold/database.js +0 -41
  154. package/dist/scaffold/documentation.d.ts +0 -2
  155. package/dist/scaffold/documentation.js +0 -71
  156. package/dist/scaffold/environment.d.ts +0 -4
  157. package/dist/scaffold/environment.js +0 -22
  158. package/dist/scaffold/stack-documentation.d.ts +0 -2
  159. package/dist/scaffold/stack-documentation.js +0 -6
  160. package/dist/scaffold/storage.d.ts +0 -2
  161. package/dist/scaffold/storage.js +0 -21
  162. package/dist/scaffold/workspace.d.ts +0 -3
  163. package/dist/scaffold/workspace.js +0 -131
  164. package/dist/stack-registry.d.ts +0 -35
  165. package/dist/stack-registry.js +0 -189
  166. package/dist/standard.d.ts +0 -8
  167. package/dist/standard.js +0 -94
  168. package/dist/workspace-graph.d.ts +0 -7
  169. package/dist/workspace-graph.js +0 -74
  170. package/docs/anhedral-stack.md +0 -12
  171. package/docs/assets/anhedral-stack-light.png +0 -0
  172. package/docs/assets/anhedral-stack.png +0 -0
  173. package/docs/native-ui.md +0 -47
  174. /package/dist/{registry/types.js → command-runner.d.ts} +0 -0
package/dist/util.js CHANGED
@@ -1,7 +1,10 @@
1
- import { chmodSync, closeSync, existsSync, fstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, rmSync, writeFileSync, } from 'node:fs';
1
+ import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { readBoundedFile } from './bounded-file.js';
3
+ import { mkdtempSync, rmSync } from 'node:fs';
4
+ import { tmpdir } from 'node:os';
5
+ import { fileURLToPath } from 'node:url';
2
6
  import { resolveCommand } from './command.js';
3
7
  import { spawnSync } from 'node:child_process';
4
- import { tmpdir } from 'node:os';
5
8
  import path from 'node:path';
6
9
  const FAILURE_TAIL_BYTES = 128 * 1024;
7
10
  function commandTimeout() {
@@ -42,77 +45,53 @@ export function appendGitignore(root, lines) {
42
45
  const separator = existing.length > 0 && !/(?:\r\n|\n|\r)$/.test(existing) ? newline : '';
43
46
  writeFile(filePath, `${existing}${separator}${additions.join(newline)}${newline}`);
44
47
  }
45
- function readTail(filePath) {
46
- const file = openSync(filePath, 'r');
47
- try {
48
- const size = fstatSync(file).size;
49
- const length = Math.min(size, FAILURE_TAIL_BYTES);
50
- if (length === 0)
51
- return '';
52
- const buffer = Buffer.allocUnsafe(length);
53
- readSync(file, buffer, 0, length, size - length);
54
- return buffer.toString();
55
- }
56
- finally {
57
- closeSync(file);
58
- }
59
- }
60
- function dumpFailure(cmd, status, stdoutPath, stderrPath, spawnError) {
61
- const stdoutText = readTail(stdoutPath);
62
- const stderrText = readTail(stderrPath);
63
- if (process.env.ANHEDRAL_QUIET !== '1') {
64
- if (stdoutText)
65
- process.stderr.write(stdoutText);
66
- if (stderrText)
67
- process.stderr.write(stderrText);
68
- }
69
- throw commandFailure(cmd, status, spawnError);
70
- }
71
48
  export function execFile(executable, args, cwd) {
72
49
  const invocation = resolveCommand(executable, args);
73
50
  const quiet = process.env.ANHEDRAL_QUIET === '1';
74
51
  const display = [executable, ...args].join(' ');
75
- const deadline = { timeout: commandTimeout(), killSignal: 'SIGKILL' };
76
- if (process.env.ANHEDRAL_VERBOSE === '1' && !quiet) {
77
- console.log(` $ ${display}`);
78
- const result = spawnSync(invocation.command, invocation.args, {
52
+ const verbose = process.env.ANHEDRAL_VERBOSE === '1' && !quiet;
53
+ const requested = Number(process.env.ANHEDRAL_COMMAND_OUTPUT_BYTES);
54
+ const maximum = Number.isSafeInteger(requested) && requested >= 1024 && requested <= 16 * 1024 * 1024
55
+ ? requested
56
+ : 16 * 1024 * 1024;
57
+ const root = mkdtempSync(path.join(tmpdir(), 'anhedral-command-'));
58
+ const configuration = path.join(root, 'input.json'), resultFile = path.join(root, 'result.json');
59
+ try {
60
+ const bytes = JSON.stringify({
61
+ ...invocation,
79
62
  cwd,
80
- stdio: 'inherit',
81
- shell: false,
82
- ...deadline,
63
+ timeout: commandTimeout(),
64
+ maximum,
65
+ verbose,
83
66
  });
84
- if (result.error || result.status !== 0) {
85
- throw commandFailure(display, result.status, result.error);
86
- }
87
- return;
88
- }
89
- const captureRoot = mkdtempSync(path.join(tmpdir(), 'anhedral-exec-'));
90
- const stdoutPath = path.join(captureRoot, 'stdout.log');
91
- const stderrPath = path.join(captureRoot, 'stderr.log');
92
- const stdout = openSync(stdoutPath, 'w');
93
- const stderr = openSync(stderrPath, 'w');
94
- try {
95
- const result = spawnSync(invocation.command, invocation.args, {
67
+ if (Buffer.byteLength(bytes) > 1024 * 1024)
68
+ throw Error('Command configuration exceeds its bound.');
69
+ writeFileSync(configuration, bytes, { flag: 'wx', mode: 0o600 });
70
+ const wrapper = spawnSync(process.execPath, [fileURLToPath(new URL('./command-runner.js', import.meta.url)), configuration, resultFile], {
96
71
  cwd,
97
72
  shell: false,
98
- stdio: ['ignore', stdout, stderr],
99
- ...deadline,
73
+ stdio: verbose ? 'inherit' : 'ignore',
74
+ timeout: commandTimeout() + 10000,
75
+ killSignal: 'SIGKILL',
100
76
  });
101
- closeSync(stdout);
102
- closeSync(stderr);
77
+ if (wrapper.error || wrapper.status !== 0 || !existsSync(resultFile))
78
+ throw commandFailure(display, wrapper.status, wrapper.error);
79
+ const result = JSON.parse(readBoundedFile(resultFile, 1024 * 1024).toString('utf8'));
103
80
  if (result.error || result.status !== 0) {
104
- dumpFailure(display, result.status, stdoutPath, stderrPath, result.error);
81
+ if (!quiet && !verbose)
82
+ for (const value of [result.stdout, result.stderr]) {
83
+ const tail = Buffer.from(value, 'base64');
84
+ if (tail.length)
85
+ process.stderr.write(tail.subarray(-FAILURE_TAIL_BYTES));
86
+ }
87
+ if (result.error === 'ENOBUFS')
88
+ throw Error(`Command output exceeded its capture limit: ${display}. Inspect the tool before retrying.`);
89
+ throw commandFailure(display, result.status, result.error
90
+ ? Object.assign(new Error('Command execution failed'), { code: result.error })
91
+ : undefined);
105
92
  }
106
93
  }
107
94
  finally {
108
- try {
109
- closeSync(stdout);
110
- }
111
- catch { }
112
- try {
113
- closeSync(stderr);
114
- }
115
- catch { }
116
- rmSync(captureRoot, { recursive: true, force: true });
95
+ rmSync(root, { recursive: true, force: true });
117
96
  }
118
97
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const GENERATOR_VERSION = "0.17.0";
1
+ export declare const GENERATOR_VERSION = "0.19.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const GENERATOR_VERSION = '0.17.0';
1
+ export const GENERATOR_VERSION = '0.19.0';
@@ -1,110 +1,44 @@
1
- # Progressive stack additions
1
+ # Anhedral Stack additions
2
2
 
3
- New projects start with Next.js, OpenNext for Cloudflare Workers and Anhedral UI. Add only the parts required by the product. Nothing is called a commercial tier, and the specific “if needed” decisions remain open.
3
+ There is one current **Anhedral Stack**. `anhedral init` creates its web foundation with TanStack Start SSR/server functions and source-owned shadcn Anhedral UI. Add the remaining services only when needed.
4
4
 
5
5
  ```sh
6
6
  anhedral init my-app
7
7
  cd my-app
8
- anhedral stack list
9
- anhedral add hono --dry-run --json
10
- anhedral add hono
11
- anhedral add database-auth
12
- anhedral stack status --json
13
- ```
14
-
15
- `anhedral add` writes editable source and local configuration, then installs dependencies unless `--skip-install` is selected. It does not create provider resources, install credentials, run migrations, deploy, publish clients, update installed plugins or register a managed project. These are source composition commands, separate from Anhedral Cloud operations.
16
-
17
- ## Capabilities
18
-
19
- | Name | Adds | Required source capabilities |
20
- | --- | --- | --- |
21
- | `hono` | API Worker, web proxy/service binding, health route | Next.js foundation |
22
- | `database-auth` | Drizzle/D1, Better Auth, schema/migration tooling, web sign-in starter | `hono` |
23
- | `r2` | Private R2 binding and authenticated owner-scoped file routes | `database-auth` |
24
- | `stripe` | Stripe SDK, Checkout subscription starter, signed webhook receipts, canonical access checks | `database-auth` |
25
- | `realtime` | Authenticated D1-backed events and resumable SSE | `database-auth` |
26
- | `rtc` | Cloudflare Realtime SFU session/track adapter with ownership checks | `database-auth` |
27
- | `ai` | Workers AI binding, authenticated text-generation route and atomic daily quota | `database-auth` |
28
- | `expo` | Expo app and Better Auth/SecureStore client | `database-auth` |
29
- | `native-ui` | NativeWind 4, shared theme CSS, RNR Button/Text starter, portal/root adapter, UI catalog metadata | `expo` |
30
- | `revenuecat` | Native subscription SDK/UI, scoped webhooks and server-side entitlement reconciliation | `expo`, `stripe` |
31
- | `wxt` | WXT React extension, scoped API host permission and editable popup | `database-auth` |
32
- | `side-panel` | Chromium Side Panel entrypoint and background registration | `wxt` |
33
- | `gpui` | Rust/GPUI desktop application and native build scripts | `database-auth` |
34
-
35
- The progression is Next.js → Hono → database/auth, followed by independently selected branches. These are Anhedral's source-builder rules, not intrinsic restrictions of those technologies. `anhedral ui` still requires only the target Next.js or Expo application; it has no backend prerequisite. See [UI commands](ui.md).
36
-
37
- ```sh
38
- anhedral add expo native-ui --dry-run --json
39
- anhedral add side-panel --with-dependencies --dry-run --json
8
+ anhedral add backend --dry-run --json
9
+ anhedral add backend
40
10
  anhedral add r2 stripe
41
- anhedral add realtime rtc ai
42
- ```
43
-
44
- Missing prerequisites stop the command before writes. Explicitly list the parents in the same command, or choose `--with-dependencies` to include them in dependency order. There is no `add all` shortcut that silently chooses every optional branch.
45
-
46
- ## Protecting existing applications
47
-
48
- Additions require an Anhedral workspace with a Next.js foundation. They do not reinitialize it. All selected recipes are planned in memory before any installation. A late collision rejects the entire plan. JSON/JSONC changes preserve unrelated keys and comments; existing bindings and dependency pins that conflict require reconciliation. New source files never replace existing files.
49
-
50
- CLI-owned composition adapters are fingerprinted in `anhedral.json`. Their edits are protected too: if an adapter was customized, a later addition stops rather than replacing it. Add business routes in `apps/api/src/index.ts`, custom binding/variable types in `custom-environment.ts`, auth methods in `auth-features.ts`/`auth.ts`, and native product UI in `apps/mobile/App.tsx`. Keep additional application behavior outside composition adapters.
51
-
52
- Source writes use the existing journaled transaction/recovery implementation. Dependency resolution/install follows source commit; if installation fails, the CLI reports a post-commit error and retains the source for review and retry. Reviewed dependency patches are configured before the frozen install. `--skip-install` leaves dependency resolution/patch staging to a subsequent normal CLI installation or explicit consumer setup. `--dry-run` makes no writes or network requests, including transaction metadata.
53
-
54
- Repeated additions leave source unchanged; the normal command still resolves and installs dependencies so it can recover from an earlier install failure. Use `--skip-install` for a source-only no-op. There is no removal command, provider deletion or implicit D1/R2 data deletion. An inconsistent parent/child declaration is rejected. Earlier full-stack generators and arbitrary custom layouts are not automatically adopted or overlaid; inspect their source and reconcile conflicts explicitly.
55
-
56
- ## Source state and activation
57
-
58
- `stack list` shows the complete catalog. `stack status` reports `locked`, `available`, `installed` or `incomplete` source state. `stack doctor` exits unsuccessfully when declared source is missing. Neither command inspects live providers or proves deployment/activation. An installed capability can still need credentials, migrations, resource IDs and runtime verification.
59
-
60
- The intended operational sequence remains source selection → resource provisioning → bindings/secrets/migrations → runtime validation/deployment → verified active service. Client binaries run on their target platforms, independently of Cloudflare server deployments.
61
-
62
- ## Configuration and local validation
63
-
64
- Run dependency installation, inspect the generated files, then run `pnpm check`. The normal `add` path resolves lockfiles, stages any applicable reviewed patches and performs a frozen install. The consumer's `audit:deps` retains raw findings and accepts only the existing reviewed exact patches. Source-only generation does not apply a patch to a dependency that has not been resolved yet.
65
-
66
- For API development, use the web service binding in production and `API_INTERNAL_URL=http://127.0.0.1:8787` in `apps/web/.env.local` locally. Copy selected API values from `apps/api/.dev.vars.example` to `.dev.vars`; never put server secrets in client public variables. Set a sufficiently long auth secret and the actual `PUBLIC_APP_URL` before enabling identity-dependent features.
67
-
68
- D1's initial resource ID is deliberately a placeholder. Configure the actual D1 identity and private R2 bucket yourself. Keep R2 public access disabled. Generate and review additional SQL, then deliberately apply it to an isolated local database:
69
-
70
- ```sh
71
- pnpm db:generate
72
- pnpm db:migrate --local
11
+ anhedral stack status --json
73
12
  ```
74
13
 
75
- Builds and startup never migrate. Remote migration requires explicit `--remote` and deliberate resource selection. No configured database is migrated by this repository's tests.
76
-
77
- Better Auth starts with email/password disabled, and no OAuth, passkeys, MFA or organization plugins silently activated. Enable chosen methods explicitly after configuring their credentials, email/policies, schemas and client flows. The included sign-in UI is an email/password example, not automatic method activation. Regenerate/review migrations when adding auth plugins.
78
-
79
- ## Payments
80
-
81
- The included routes form a subscription starter, rather than a complete commerce product. Choose the allowed Stripe price and RevenueCat entitlement. `BILLING_PROVIDER` selects `stripe`, `revenuecat` or `either` for the shared server access guard. The default billing environment is `sandbox`; a deliberate `BILLING_ENVIRONMENT=live` selection must match the provider key and webhook environment. The CLI sets neither live credentials nor live mode.
82
-
83
- Checkout derives identity from the authenticated session, uses a server-selected price and requires an idempotency key. Stripe verifies the untouched body/signature through the web proxy. RevenueCat validates its configured authorization header, app scope and environment. D1 receipts deduplicate delivery. Webhook order, redirects and SDK callbacks never grant access.
84
-
85
- The server re-reads canonical provider state, checks identity/product/environment/expiry, and fails closed on unavailable or unconfigured providers. Reuse `requireSession` and `requireEntitlement` on paid application routes. `/api/billing/access` demonstrates that guard. SDK account changes are serialized; native sign-out disconnects purchases before clearing the app session. One-time fulfillment, credits, tax, marketplace/Connect, pricing and store-policy decisions remain application work.
14
+ | Selection | Source added | Requires |
15
+ | --------- | ----------------------------------------------------------------------- | ----------------------------- |
16
+ | `backend` | Hono API, Drizzle/D1, Better Auth and web sign-in starter | Anhedral Stack web foundation |
17
+ | `r2` | Private storage binding and authenticated owner-scoped file routes | `backend` |
18
+ | `stripe` | Subscription Checkout, signed webhooks and canonical entitlement checks | `backend` |
86
19
 
87
- Use provider test credentials and store sandboxes for acceptance. No real charge, live activation, signing or store submission is part of `add` or these tests.
20
+ `backend` is one public selection; its provenance records the concrete Hono and database/auth capabilities. Use `--with-dependencies` to include missing prerequisites in the same planned source transaction. `stack list` describes this stack's additions. `status`/`doctor` check source completeness, not live service activation.
88
21
 
89
- ## Events, RTC and AI
22
+ ## Source protection
90
23
 
91
- Events are durable, owner-scoped D1 records. SSE uses `(created_at, id)` cursors and `Last-Event-ID`; batches do not advance past undelivered records. The starter is a private event feed, not an automatic room/membership model. Choose retention and application topics deliberately.
24
+ Adding a capability also upgrades a canonical earlier TanStack Start foundation to the pinned OJ launchers and runtime helpers in the same source transaction, including when that capability is already installed. The exact earlier canonical document also receives the OJ-compatible side-effect CSS import; safe customized documents stay untouched, while edited documents retaining the earlier stylesheet URL import require reconciliation. Customized launchers or generated configuration require reconciliation before any writes. Additions never reinitialize an application. They plan all selected changes before writing, reject collisions and preserve unrelated JSON/JSONC settings. Composition adapters are fingerprinted in `anhedral.json`; modified adapters require reconciliation instead of silent replacement. Add product routes in `apps/api/src/index.ts`, custom types in `custom-environment.ts`, and auth method configuration in `auth-features.ts`/`auth.ts`.
92
25
 
93
- The initial RTC adapter uses Cloudflare Realtime SFU. It provides session creation, tracks, renegotiation and close operations, keeps app secrets server-side, bounds session allocation and checks session ownership. Remote tracks are limited to the same authenticated user's sessions. A multi-user product must add its reviewed room/membership rules and WebRTC client flow. Configure provider lifecycle/retention and validate media behavior before rollout; an adapter install is not a working conference UI.
26
+ Journaled transactions preserve recovery evidence and refuse ambiguous recreated files. Dependency installation follows source commit; a post-commit install failure keeps source for repair/retry. Reviewed dependency patches precede the frozen install. `--skip-install` writes source only. `--dry-run` performs no writes or network requests. Repeating an addition preserves source; normal installation may still retry dependencies.
94
27
 
95
- Workers AI requires explicit model and daily quota configuration. Authentication and an atomic D1 counter gate requests; failed provider calls consume quota as well. No model or provider resource is activated by generation. Alternative realtime/AI provider choices remain application decisions.
28
+ There is no implicit capability removal or resource/data deletion. Existing applications retain their source and identity. Only the OJ/TanStack Start foundation and these three additions are supported.
96
29
 
97
- ## Additional clients
30
+ ## Local setup and validation
98
31
 
99
- Expo uses public API configuration and SecureStore-backed Better Auth cookies. Set the device-reachable `EXPO_PUBLIC_API_URL`, and add the exact generated scheme origin to the API's `AUTH_TRUSTED_ORIGINS`. Native API helpers preserve the verified session; a browser Origin cannot be bypassed by an `expo-origin` header. Rebuild native clients when native dependencies/configuration change; Expo exports do not establish device or store acceptance.
32
+ Minimal `pnpm dev` runs the web Worker. After backend is added, Vite also runs its auxiliary Hono Worker in the same process using isolated local D1 and optional R2. Copy `apps/api/.dev.vars.example` to `.dev.vars`; configure `PUBLIC_APP_URL` and a private `BETTER_AUTH_SECRET`. Never put server secrets in web/public variables.
100
33
 
101
- `native-ui` adds a bounded Button/Text bootstrap from RNR, not the legacy native fork. Shared semantic CSS is imported from `packages/styling`. Use `anhedral ui add` for other components and retain MIT attribution. The audit configuration treats the two upstream button variant exports as intentional public UI APIs. Its narrow runner/peer dependency entries account for Babel/NativeWind usage that static import analysis cannot see; source, duplication and complexity checks remain enabled.
34
+ Review initial SQL, then deliberately run `pnpm db:migrate --local`. For later schema additions, run `pnpm db:generate`, inspect the SQL and apply it explicitly. Remote migration requires deliberate `--remote` selection. Builds, startup and ordinary checks never migrate a configured database.
102
35
 
103
- WXT defaults to Chromium Manifest V3, with an explicit API-origin host permission. Side Panel support is Chromium-specific. Configure extension authentication and browser acceptance separately; no extension is installed into a user's browser by the CLI.
36
+ Better Auth methods start disabled. Configure credentials, email/policy, schema and client flows before enabling chosen methods. The sign-in page is an example, not automatic activation. R2 remains private and file routes enforce authenticated ownership.
104
37
 
105
- GPUI uses the upstream `runtime_shaders` feature, without a vendored fork or web renderer. Rust and platform libraries are required. Its application is a native starter; backend account UX, packaging, signing and distribution belong to the product. Commit the generated Cargo lockfile after resolving native dependencies.
38
+ Stripe adds source/schema, not a live payment service. Generate and review its billing migration before webhook tests. Configure test credentials, allowed prices and signed webhooks deliberately. Server-side canonical provider state controls entitlements; redirects, client claims and webhook ordering do not grant access. Live mode and real charges require separate activation.
106
39
 
40
+ ## Source and hosting contracts
107
41
 
108
- ## Repository acceptance fixture
42
+ `anhedral.json` records nonsecret generator/capability versions and identity. Source provenance never grants hosting authority. The public deployment manifest uses runtime profile `anhedral-stack` for the web foundation and selected backend/R2/Stripe composition. Artifact identity, resource provisioning, secrets, migrations, runtime checks and production approval remain server-owned. See [the workflow](software-factory.md#platform-cli-access-and-source-upload).
109
43
 
110
- After generating/installing a local consumer under this CLI checkout's `.artifacts/`, mark it with `.anhedral-fixture.json` containing `{"fixture":true}` and run `node tests/test-capability-runtime.mjs <fixture-directory>`. The fixture must include R2, Stripe, RevenueCat, events, RTC and AI source. This test refuses other paths, applies SQL only to isolated Miniflare D1, blocks unexpected outbound requests, and restores its temporary auth-method opt-in. Its billing providers are local read-only fixtures. Keep this marker out of deployed application source. Keep revision-scoped build results and limitations in the CLI repository’s `docs/agent-notes/`.
44
+ Run `pnpm check` and `pnpm audit:deps` in generated applications. Framework/runtime, provider and browser acceptance are distinct; source installation alone establishes none of them.
@@ -1,4 +1,6 @@
1
- # Scaffold workflow
1
+ # Anhedral Stack workflow
2
+
3
+ The Anhedral Stack has one current web foundation and progressive backend/storage/payment additions. There is no public stack selection or independent stack-registry repository.
2
4
 
3
5
  1. Preview an empty destination with `anhedral init my-app --dry-run --json`, then
4
6
  run `anhedral init my-app` and `pnpm dev` inside it.
@@ -23,17 +25,214 @@ with revision, checks, failures and remaining gaps. Keep raw reports in ignored
23
25
  `.artifacts/`. Historical notes are not current instructions.
24
26
 
25
27
  Canonical docs live in `docs/`; `pnpm build` refreshes bundled plugin references.
26
- Generated app guidance lives in `src/scaffold/documentation.ts`. Preserve shipped
28
+ Current generated app guidance lives in `src/launch.ts`. OJ runs development and builds for the single TanStack Start foundation. Preserve shipped
27
29
  reference paths, source-generation safety, dependency patch gates, UI provenance,
28
30
  licenses and exact-artifact packaging. A build does not publish npm or update an
29
31
  installed plugin. See [Contributing](https://github.com/anhedral/anhedral-cli/blob/main/.github/CONTRIBUTING.md)
30
32
  for staging, release identity and validation tiers.
31
33
 
32
- ## Next/OpenNext runtime gate
34
+ This repository also works as a Git submodule. Its own `pnpm-workspace.yaml`,
35
+ lockfile and safe `.npmrc` keep installs independent of a parent workspace;
36
+ the parent must exclude the CLI from its package graph. Run install/build/tests
37
+ inside this checkout with its pinned package manager. Commit public changes here
38
+ separately, then update the parent's Git pointer only after that commit is reviewed
39
+ and available in this repository. Never copy parent configuration, credentials or
40
+ implementation into this checkout. Public CI checks out only this repository,
41
+ without recursive submodules; publishing rejects calls from another repository.
42
+ These checks do not make a submodule a security sandbox: review tracked files,
43
+ package contents, inherited environment and publication authority independently.
44
+
45
+ The reviewed public module inventory in `scripts/public-package-policy.json` and
46
+ `pnpm check:boundaries` constrain compilation and package preparation; an unexpected
47
+ dist module or private import requires explicit review. Portable contracts are
48
+ synced only from a reviewed, licensed Platform projection with exact provenance,
49
+ never as a build side effect. Local credential scanning additionally retains the
50
+ CLI's stricter source-upload policy. Plugin packaging accepts its explicit reviewed
51
+ skills-only file set, refuses linked distribution roots and verifies the bounded
52
+ publisher archive format before npm publication. Oversized unscanned text is an
53
+ explicit review failure, not a clean secret scan.
54
+
55
+ ## Runtime verification
56
+
57
+ Routine CI compiles the CLI once and runs fast source/security checks and selected
58
+ contract tests. Generated applications are not installed or built in that path.
59
+ Dispatch [CI](https://github.com/anhedral/anhedral-cli/blob/main/.github/workflows/ci.yml) with `runtime_proof` enabled for the
60
+ Anhedral Stack proof and one-day measurements. Broader compatibility and generated
61
+ application matrices remain in [Full validation](https://github.com/anhedral/anhedral-cli/blob/main/.github/workflows/validation.yml).
62
+
63
+ `node scripts/tanstack-runtime-smoke.mjs` installs a disposable Anhedral Stack
64
+ application and exercises local workerd, SSR/server functions, progressive backend,
65
+ private storage and the generated Stripe build/migration path. The compiled web
66
+ and API Workers run together with the migrated local D1 state. Bundle measurements
67
+ follow OJ’s emitted Worker configuration and count its runtime modules. It uses
68
+ isolated local data, never a configured database or live payment provider. Preserve source/tool/lock identities and distinguish prepared,
69
+ passed and failed evidence. Tests are not provider deployment acceptance. Run
70
+ `node tests/test-generated-config-lint.mjs <installed-workspace>` to exercise the
71
+ generated web ESLint policy; runtime proof checks both web-only and composed source.
72
+
73
+ Backend server entries call TanStack’s `createStartHandler(defaultStreamHandler)` directly so request-local API bindings survive OJ compilation. Source additions repair the exact previous owned adapter and preserve customer edits.
74
+
75
+ OJ dev commands attach an explicit host value with `--host=<hostname>`, as required by the pinned runtime. Generated workspaces explicitly allow dependency build scripts only for esbuild and workerd through the pnpm `allowBuilds` map. This keeps installation noninteractive under the pinned pnpm release and pnpm11 without allowing arbitrary dependency scripts.
76
+
77
+ ## Platform CLI access and source upload
78
+
79
+ `login --start` prints browser approval instructions; `login --resume` redeems the
80
+ saved approval. Interactive `login` polls after showing the URL and confirmation
81
+ code. Tokens and device secrets use macOS Keychain or Linux Secret Service;
82
+ `--credential-file <path>` explicitly selects an owner-only file. Credential
83
+ storage is currently unsupported on Windows. Credentials are
84
+ bound to the explicit `--api-url` origin (HTTPS, with literal loopback for fixtures).
85
+ Do not use repository configuration to select the credential destination. `logout`
86
+ revokes server access before removing the saved credential; `whoami` checks live
87
+ identity. Add `whoami --context --human` (or `--context --json`) to inspect the
88
+ selected origin, credential-store kind and saved local team/project link. Identity
89
+ is checked live; the saved project link is explicitly not proof of current project
90
+ access. A link for a different origin or principal fails closed. Normal `whoami`
91
+ JSON is unchanged and context inspection never creates a project or starts login.
92
+ Explicit `--api-url` and `--credential-file` select the origin/store; saved state
93
+ cannot override either. API access must be separately enabled by Platform operators.
94
+
95
+ After generating source, run `projects list --human` to discover the selected
96
+ team's projects and accessible team IDs. Use `--team <uuid>` to select another
97
+ team and `--cursor <uuid>` for the next page. `projects create --name <name>
98
+ --link --human` registers a new Platform project and links the current directory;
99
+ omit `--link` to register it without changing local context. `--summary <text>`
100
+ is optional. Creation registers existing source for upload; it does not generate
101
+ another application or start a deployment. `projects create --dry-run` validates
102
+ the proposed input locally without authentication or network access.
103
+
104
+ Creation saves its request identity under `.anhedral/platform/` before sending
105
+ it. Repeat the same command after interruption to recover the same project;
106
+ changed input, identity or team requires review and an explicit `--new` request.
107
+ `--link` refuses a different existing local link. Init's source identity remains
108
+ unchanged. Platform checks current team membership and project permissions.
109
+ Project creation, linking and unlinking share a workspace lock. After a process
110
+ crash, inspect `.anhedral/platform/project-operation.lock` and remove only that
111
+ lock after confirming no project operation is running; preserve the request journal.
112
+
113
+ `link --project <uuid> --team <uuid>` checks current build authority and saves an
114
+ origin/principal-bound link under ignored `.anhedral/platform/`. `unlink` removes
115
+ that local link. `source upload --dry-run` inspects packaging; `source upload`
116
+ resumes the same immutable source request after interruption, including lost
117
+ responses. `source status` reads its server receipt. Changed source requires an
118
+ explicit `source upload --new`; an expired request also requires a new request.
119
+ The client honors nested `.gitignore`, excludes generated output and secret paths,
120
+ rejects symlinks and recognized credential material, and hashes every bounded
121
+ chunk plus the complete archive and canonical source inventory. The generated
122
+ `apps/web/src/routeTree.gen.ts` is excluded because the router regenerates it during
123
+ checks/builds; authored routes, router configuration and server source remain
124
+ included. Credential scanning is deliberately conservative; inspect source before uploading.
125
+
126
+ Public upload limits and message shapes live in `src/contracts`; protocol code is
127
+ in `src/platform-command.ts`. The server independently authenticates the caller,
128
+ checks current tenant/project authority and revocation, validates source, and
129
+ enforces admission. Client checks and supplied IDs cannot grant access. Upload
130
+ does not deploy, activate providers, migrate a database or replace identities.
131
+ Run `tests/test-platform.test.mjs` after building for isolated client fixtures.
132
+
133
+ `deploy plan --manifest <file>` plans from the saved sealed upload, independently
134
+ of subsequent local edits. The manifest follows Platform's `deploymentManifestSchema`
135
+ in `src/contracts/deployment.ts`; it must match the archive's recorded composition,
136
+ capabilities, CLI version and existing standalone identity. Runtime-profile admission is server-owned. Staged server sources include Hono/D1
137
+ and web candidates; source support does not establish a deployed cohort or provider readiness. Plans bind source/lockfile/migrations,
138
+ routing state, principal epoch and project authority. Signed plans report current artifact, source-version and dependency-lock compatibility.
139
+ A null project configuration revision means deployment has not yet captured its environment snapshot; it is not a request to find an operator approver.
140
+ Anhedral Stack source composition version 2 records framework foundation
141
+ `tanstack-start`; the public runtime profile is `anhedral-stack`. Its five compositions are
142
+ web-only, backend (`hono` plus `database-auth`), backend/R2, backend/Stripe and
143
+ backend/R2/Stripe. Backend manifests preserve `better-auth-d1-v1`; web-only uses
144
+ `none`. Broader retained capability/protocol values are compatibility implementation,
145
+ not current public selections or hosted support.
146
+ Continue selecting an explicit manifest; the CLI never infers an admitted artifact
147
+ from locally generated source. Native candidate receipts name an immutable registry
148
+ image with `scope: candidate-workspace`; legacy isolated-build receipts remain valid.
149
+ Both describe automatic build compatibility, not a requirement for a human artifact approver. Plans list exact runtime, source-version or lockfile mismatches and remediation. Do not relabel source provenance to clear a mismatch.
150
+
151
+ `deploy prepare` reserves an immutable candidate. `deploy status` reads
152
+ `awaiting-runtime`, `building`, `built`, `ready` or `failed`. A built candidate grants no
153
+ preview or publishing capability. A `ready` receipt reports Platform-admitted hosted
154
+ readiness; it does not approve production publication. Runtime admission and build
155
+ enforcement remain server-owned. These commands never provision, migrate, activate a preview or
156
+ deploy. Lost responses resume the same saved request. Changed manifest inputs or
157
+ routing require `deploy plan --manifest <file> --new`. Plan/source expiry and
158
+ revocation fail closed. State under `.anhedral/platform/deployment.json` contains
159
+ no credentials and cannot select a network origin or change the signed-in identity.
160
+
161
+ `env list` returns names, types, environments and versions. `env import --environment
162
+ staging|production --file <path>` reads a private dotenv file; `--stdin` accepts a
163
+ pipe. `env set <NAME>` reads one literal value from a file or pipe. Values are
164
+ never arguments, output or retry-state contents. Non-public names default to
165
+ secrets; `--type config` is explicit readable configuration. Public-prefixed
166
+ secrets, reserved names, duplicate names and oversized input fail before upload.
167
+ Files require owner-only permissions and a regular non-symlink final file;
168
+ ancestor checks reject observed symlinks but are not an atomic directory lock.
169
+ Use `--dry-run` without authentication for names/types only. Actual imports bind
170
+ API origin, principal, team, project and environment, require `--replace` for
171
+ existing variables, and resume one request after a lost response. Use `--new` for
172
+ a different import. Receipts are checked against names, types and expected versions.
173
+ Production changes remain subject to Platform approval and deployment policy.
174
+
175
+ `staging status` reads persistent staging history. `staging deploy --candidate
176
+ <uuid>` selects a ready candidate, freezes the current staging configuration and
177
+ retains one generation-bound request across retries. `--new` starts another
178
+ deployment after reviewing the current state. Saved receipts must match their
179
+ project, candidate, request and generation before replay. CLI runtime admission remains a
180
+ separate server gate; a built source upload alone is not a ready candidate.
181
+ `production status` reads current production generation, deployment history and approval policy. `production deploy --candidate <uuid> --name <slug>` freezes production configuration and publishes through the signed-in user's existing production permissions. Self-service teams need no second approver; an explicit independent-review policy remains enforced. Lost responses reuse the saved request and generation; use `--new` only for another candidate, name or deliberate deployment.
182
+
183
+ `logs` reads bounded, redacted runtime events, defaulting to staging. Select
184
+ production explicitly with `--environment production`; filter by deployment,
185
+ level, source or range, and pass `--cursor` for the next page. Coverage, dropped
186
+ events and seven-day retention are part of the response.
187
+
188
+ The plugin contains CLI usage instructions only. It registers no MCP server, remote
189
+ app, OAuth connection or executable hook, and it does not bundle a CLI runtime.
190
+ Users run the reviewed CLI version in a host terminal; managed project operations
191
+ use the separately configured CLI client described above. Packaging admits only
192
+ reviewed skills, references, assets and host manifests, and rejects connection files
193
+ or executable declarations. `tests/test-plugin-codex.test.mjs` installs the exact
194
+ archive in an isolated Codex home and verifies both skills with no MCP, app or hook
195
+ registration when Codex is available (`ANHEDRAL_CODEX_BIN` overrides the binary).
196
+
197
+ One distribution directory, `plugin/`, serves Codex and Claude Code. Codex reads
198
+ `plugin.json` and `skills/*/agents/openai.yaml`; Claude Code reads
199
+ `.claude-plugin/plugin.json` and the same `skills/*/SKILL.md`. Packaging validates
200
+ both manifests against one release identity. Root `.claude-plugin/marketplace.json`
201
+ is the Claude marketplace; add it with `claude plugin marketplace add
202
+ anhedral/anhedral-cli`, then install `anhedral@anhedral`. The existing pinned tag
203
+ predates the Claude files and this cleanup; a coordinated versioned release is
204
+ required before those changes are installable from the public marketplace. Local
205
+ review uses `claude plugin validate --strict plugin`, `claude --plugin-dir plugin`
206
+ and a temporary Codex marketplace, without account connection.
207
+
208
+ The CLI and plugin share one release version. Build prepares the
209
+ marketplace pointer to that version's immutable `plugin-v<version>` tag; it does
210
+ not create the tag or publish either artifact. During review that pointer may be
211
+ unavailable. Install an already published version until the coordinated release
212
+ has completed and its tag and artifact integrities have been verified.
213
+
214
+ ## CLI presentation compatibility
215
+
216
+ The command schema owns options, nested help and offline shell completion. Root
217
+ help is an index; leaf help includes examples. Keep executable and exported parser
218
+ contracts covered by `test-cli-discovery`, `test-cli-experience`, `test-cli-output`,
219
+ `test-completion` and `test-platform-ux`. The CI gate runs these alongside existing
220
+ contracts; the executable suite accepts `ANHEDRAL_CLI_BIN` to validate an installed
221
+ exact candidate without contacting Platform.
222
+
223
+ Results belong on stdout; errors and permitted diagnostics belong on stderr.
224
+ Platform retains implicit compact JSON for compatibility, with opt-in `--human`.
225
+ Other families retain human defaults and explicit `--json`. Quiet suppresses
226
+ ordinary results unless JSON was explicitly requested. Explicit JSON, quiet,
227
+ headless input/output, CI and `--non-interactive` cannot initiate interactive
228
+ approval polling; `login --resume` explicitly redeems an existing approval.
33
229
 
34
- Relevant generator/build changes compile an isolated foundation and exercise it
35
- in workerd. Run `pnpm test:next-runtime` for SSR/RSC, Server Actions/cookies,
36
- prerendering and static cache checks. Hono proxy contracts have separate tests.
37
- The harness owns the module-size budget and short-lived `.artifacts/next-runtime/`
38
- receipts. Review measurement changes before adjusting limits. The smoke never
39
- deploys or migrates a configured database; it is not production acceptance.
230
+ Numeric failure status remains 1. Existing error fields/code families remain;
231
+ usage errors classify invalid origins and selectors before credential/network
232
+ access, including environment, staging and log selectors. Credential-store helpers
233
+ have bounded execution. Logout revokes server access first; a failed local deletion
234
+ reports cleanup still pending instead of successful logout. Categories and retryability are additive diagnostics, not authorization
235
+ to repeat a mutation. In particular, post-commit failures retain source, expose
236
+ committed paths and require repairing only the failed follow-up. Upload/deployment
237
+ retries keep the existing immutable request identity. None of these presentation
238
+ changes alters server admission or activates hosted execution.
@@ -1,21 +1,11 @@
1
- # Stack standard
1
+ # Anhedral Stack
2
2
 
3
- Start with Next.js App Router, OpenNext for Cloudflare Workers and source-owned
4
- Anhedral UI. Add Hono, then Drizzle/D1 and Better Auth. Add private R2, payments,
5
- realtime, AI and other clients as required. The [README](https://github.com/anhedral/anhedral-cli#readme) lists every
6
- addition; [capabilities](capabilities.md) owns prerequisites and safety.
3
+ **Anhedral Stack** is the single current stack. The CLI generates its editable source; Platform independently owns managed builds, resource admission, deployment and operations. There is no public multi-stack registry or framework selector.
7
4
 
8
- Hono owns privileged data and application authorization. Next server actions
9
- adapt forms and call the API. Share framework-independent contracts and tokens
10
- without cross-importing application source. Keep R2 private and enforce identity,
11
- ownership and limits before exposing files. Apply reviewed database migrations
12
- explicitly, separately from builds and startup.
5
+ The web foundation uses TanStack Start SSR/server functions and source-owned shadcn Anhedral UI. `anhedral init` creates only that foundation. `add backend` composes Hono, Drizzle/D1 and Better Auth together. Add private R2 or Stripe subscriptions later when needed. See [additions](capabilities.md).
13
6
 
14
- UI source belongs to the consumer: official shadcn for web, React Native Reusables
15
- for Expo and a small reviewed native extension layer. Preserve licenses, semantic
16
- tokens and local edits. See [UI commands](ui.md).
7
+ When selected, Hono owns privileged business/auth/data/storage operations. Web server functions call its scoped service binding; application source is never imported across application boundaries. Keep resources private, enforce identity/ownership/limits and configure secrets per environment.
17
8
 
18
- The CLI writes editable source/configuration; consumers configure services,
19
- credentials and deployment. Platform separately owns its managed operations.
20
- Existing applications, legacy native work and runtime artifacts retain their
21
- reviewed pins until deliberately adopted and validated.
9
+ Auth methods and payment providers require explicit activation. Apply reviewed migrations separately from builds/startup. Source-owned UI preserves semantic tokens, consumer edits and upstream licensing; see [UI ownership](ui.md).
10
+
11
+ Recorded source provenance is not a hosting receipt. Runtime profile `anhedral-stack` identifies the current deployment contract; exact artifact/runtime policy, current authority and production approval still apply. Legacy generators, framework aliases and compatibility stack selection are removed. OJ is pinned by the generated runtime manifest.