Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (local gate): name the schemas the brief caps serve, drop a phantom export from the integrity row, and say uuid.js keeps a leaf importable rather than browser-callable
[._.]/ Adam Eivyfc388e2dd079
diff --git a/client/src/lib/README.md b/client/src/lib/README.mdindex fdefe1cde7..f94bb1fb7b 100644--- a/client/src/lib/README.md+++ b/client/src/lib/README.md@@ -14,7 +14,8 @@ direction: nothing under `server/` may import from `client/`, because a client-odependency added to such a file breaks the server CI job. A server module the clientimports must reach no Node built-in and nothing outside `server/lib`; when the naturalhome does (`storyBible.js` pulls `crypto`), split the pure part into its own leaf — or,-when the only impurity is an id, mint it through `uuid.js`, which reads the global WebCrypto.+when the only impurity is an id the browser never mints, take it from `uuid.js`, which reads+the global WebCrypto and so keeps the leaf importable (browser code mints through `client/src/lib/uuid.js`).`scripts/client-server-import-purity.test.js` and `scripts/server-imports-no-client.test.js`enforce both halves.diff --git a/server/lib/README.md b/server/lib/README.mdindex c43c9142fa..2eada33019 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -77,7 +77,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `brainValidation.js` | Brain/memory route schemas (search, ingest, edit). || `catalogValidation.js` | Creative ingredients catalog route schemas (scraps, ingredients, links, relations, tags, revisions, sync envelope). || `cosValidation.js` | Chief-of-Staff task/job/loop/learning schemas, the Code-Review settings slice, and the task-metadata sanitizer. The Review-Loop reviewer vocabulary lives in `reviewerConfig.js` (#5702) and is re-exported flat from here. |-| `creativeBriefLimits.js` | `COMMISSION_NAME_MAX` / `COMMISSION_INTENT_MAX` / `COMMISSION_STYLE_SPEC_MAX` / `COMMISSION_BRIEF_TAG_MAX` and `CREATIVE_DIRECTOR_GOAL_MAX` — the creative brief caps the two Zod schemas above enforce and the browser forms use as a silent input `maxLength`. A pure leaf (the schemas pull `zod`) so `client/src/components/creative-commission/commissionForm.js` and `client/src/lib/creativeDirectorPlan.js` re-export one definition instead of copying the numbers. |+| `creativeBriefLimits.js` | `COMMISSION_NAME_MAX` / `COMMISSION_INTENT_MAX` / `COMMISSION_STYLE_SPEC_MAX` / `COMMISSION_BRIEF_TAG_MAX` and `CREATIVE_DIRECTOR_GOAL_MAX` — the creative brief caps `creativeCommissionValidation.js` and `creativeDirectorValidation.js` enforce and the browser forms use as a silent input `maxLength`. A pure leaf (the schemas pull `zod`) so `client/src/components/creative-commission/commissionForm.js` and `client/src/lib/creativeDirectorPlan.js` re-export one definition instead of copying the numbers. || `creativeCommissionValidation.js` | Creative Commission (Autonomous Creation Engine) create/update + brief/schedule/generation schemas. The brief field caps it enforces come from `creativeBriefLimits.js`. || `creativeDirectorValidation.js` | Creative Director project/treatment/scene + Create-Suite importer schemas. The directive `goal` cap it enforces comes from `creativeBriefLimits.js`. || `digitalTwinValidation.js` | Digital twin document/category schemas. |@@ -117,7 +117,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `characterEvolutionValidation.js` | Zod schemas for the evolution lens — `characterEvolutionSchema` (one lens), `characterEvolutionStageSchema`, `characterEvolutionEvidenceSchema` and `characterEvolutionListSchema` (the FableLoom plan's per-character list). Its own module rather than a `sharedSchemas.js` fragment so `validation.js` (which nearly every suite reaches) doesn't grow an eager edge for a shape only two hosts validate. || `characterFramework.js` | The narrative-character framework as one definition: `CHARACTER_ARC_TYPES`, `CHARACTER_FRAMEWORK_TEXT_FIELDS` / `CHARACTER_FRAMEWORK_FIELDS` (the Ghost→Wound→Lie→Need→Want chain plus motivations, arc type, secrets, relationship links, the psychology profile and the Three Sliders), `CHARACTER_FRAMEWORK_LIMITS`, the psychology/slider/link vocabularies re-exported by `storyBible.js` (`PSYCHOLOGY_DRIVE_AXES`, `PSYCHOLOGY_ASSESSMENTS`, `CHARACTER_PSYCHOLOGY_TEXT_FIELDS`, `CHARACTER_PSYCHOLOGY_LIMITS`, `CHARACTER_SLIDER_AXES`, `RELATIONSHIP_LINK_TYPES`), and `pickCharacterFramework` / `pickCastFramework` (framework-only projection for an author-side review prompt, empty entries dropped). A pure leaf over `bibleLimits.js` so the store editableFields, the Zod schemas, and the client editors share one list (#6417). || `characterIntegrityVocabulary.js` | The vocabulary the cast-integrity contract (#6415) reports in, as a pure leaf: `INTEGRITY_FINDING_KINDS` (`missing` / `underspecified` / `contradictory`) and the machine-repairable `AUGMENTABLE_FINDING_KINDS`, the five `INTEGRITY_DIMENSIONS` (+ `INTEGRITY_DIMENSION_IDS`), `CHARACTER_REVIEW_STATUSES` (`passed` vs `not-reviewed` / `truncated` / `stale`) and the `INCOMPLETE_REVIEW_STATUSES` that can never read as clean, `INTEGRITY_DEPTHS`, and `castIntegrityPassed(report)`. Split out of `characterIntegrity.js` (which reaches `crypto` through `storyBible.js`) so `client/src/lib/characterIntegrity.js` re-exports one definition for the report UI. |-| `characterIntegrity.js` | The shared cast-integrity contract (#6415), stated in `characterIntegrityVocabulary.js`'s terms: `characterIntegrityDepth` (minor roles / flat arcs / an explained `unknown` psychology get lighter requirements), the no-provider `characterCompletenessFindings` / `buildCastIntegrityReport`, the validating `mergeSemanticFindings`, and `characterFingerprint` / `staleReportCharacterIds` (reports are derived, never persisted — the fingerprint is what makes a stale one detectable). |+| `characterIntegrity.js` | The shared cast-integrity contract (#6415), stated in `characterIntegrityVocabulary.js`'s terms: `characterIntegrityDepth` (minor roles / flat arcs / an explained `unknown` psychology get lighter requirements), the no-provider `characterCompletenessFindings` / `buildCastIntegrityReport`, the validating `mergeSemanticFindings`, and `characterFingerprint` (reports are derived, never persisted — the fingerprint is what makes a stale one detectable). || `castIntegrityPrompt.js` | The prompt-facing render of a `characterIntegrity.js` report (#6415): `renderCastIntegrity` (gap rows first, header always kept, so a budget-truncated block can never read as a clean cast) and `INTEGRITY_DEPTH_NOTES` (the `explained` / `light` / `full` rulings in the reviewer's own words). Shared by the Series foundation judge and the FableLoom whole-series editor so the two cannot drift on what a `light` character owes. || `bibleLimits.js` | `BIBLE_LIMITS` — the canon field length/count caps every story-bible sanitizer, Zod schema, and catalog payload upgrade measures against. A pure leaf split out of `storyBible.js` (which pulls `crypto` + `fileUtils`) so `catalogTypes.js` and the browser bundle can read the numbers alone. || `storyArc.js` | Canonical Arc + Season + Reader-Map shapes for pipeline arc planning. |@@ -565,7 +565,7 @@ pm` default, `NPM_CONFIG_PREFIX`, nvm/Volta) installed `codex` successfully and| `untrustedContent.js` | Shared source policies, strict settings schema, data framing and API-only/local-private provider eligibility for untrusted GitHub and messaging content. || `uploadLimits.js` | Single source of truth for upload size caps — `JSON_BODY_LIMIT`/`JSON_BODY_LIMIT_BYTES` (the express.json limit applied in `index.js`), `MAX_BASE64_UPLOAD_BYTES` derived from it (base64 ×4/3, so a bigger per-route cap is unreachable), `MAX_SCREENSHOT_BYTES`. Mirrored client-side as `JSON_UPLOAD_MAX_FILE_SIZE`. || `userActionTypes.js` | Closed vocabulary for the operator-action ledger (`user_action_events`, #5594 / #5596): `USER_ACTION_TYPES` (CoS task/feedback/schedule + settings + instance-feature toggles + event-only creative/Brain pointers), `USER_ACTION_ACTORS` (`user` / `mind` / `schedule` / `system`), and the `isUserActionType` / `isUserActionActor` predicates. `recordUserAction` (`services/userActions.js`) throws on a type absent from the list, so a typo fails a test instead of writing a row nothing can filter on. |-| `uuid.js` | `v4()` thin wrapper over the global `crypto.randomUUID()` — import-free, so a leaf the browser imports can mint ids through it without a Node built-in. |+| `uuid.js` | `v4()` thin wrapper over the global `crypto.randomUUID()`. Import-free, so a leaf the browser imports may reach it without a Node built-in — importable, not browser-callable: `randomUUID` needs a secure context there, so client code mints through `client/src/lib/uuid.js`. || `versionUtils.js` | `compareSemver(a, b)` — semver ordering (-1/0/1) with pre-release precedence and build-metadata stripping. Shared by the self-update checker (`updateChecker.js`) and the local-LLM Ollama update detector (`localLlm.js`). Inputs must be `v`-stripped. || `workTracker.js` | `WORK_TRACKERS`/`CONCRETE_WORK_TRACKERS`/`DEFAULT_WORK_TRACKER`, `workTrackerLabel`, `hostToWorkTracker`, `isGithubHost` (GitHub-family host test — github.com + enterprise github.*; enterprise-aware replacement for the github.com-only `isGithub` gate), `githubRepoSpec(origin)` (host-qualified `HOST/OWNER/REPO` selector for `gh --repo`, or null for a non-GitHub origin — pairs the isGithubHost gate with the selector so prWatcher/branchReconcile/issueReconcile share one "resolvable GitHub repo" definition), `forgeCliForTracker`, `isFileTracker` (true when the tracker records work as repo files — PLAN.md — so an agent's proposal necessarily dirties the worktree; false for github/gitlab/jira), `trackerToClaimTaskType`, `hostFromOriginUrl` (subgroup-tolerant host parse), pure `resolveWorkTracker({configured,host})`, async `resolveAppWorkTracker(app)` — resolves a managed app's autonomous work source (PLAN.md / GitHub / GitLab / JIRA), defaulting `'auto'` to the git origin host. Async `resolveRepoForgeTarget(repoPath)` — the ONE definition of "which forge can we query for this checkout", returning `{ forge, fullName, repoSpec, apiHost }` (enterprise-aware `gh --repo` selector for GitHub; `repoSpec: null` for GitLab, which `glab` resolves from its cwd) or null for a non-forge origin; shared by `issueReconcile.js` and `appIssues.js`. Async `resolveAppForgeTarget(app, {repoPath})` — the composed `resolveAppWorkTracker` + `resolveRepoForgeTarget` for callers holding the managed-app record, returning `{ tracker, target }` with the app's github/gitlab pin threaded in as `preferredForge` (so a self-hosted forge on a hostname matching neither pattern still resolves); use this instead of re-threading the pin by hand. Also owns the `{trackerInstructions}` prompt block shared by the TRACKER-FILING task types (types that read the app read-only and deliver findings as tracker items, not a commit): `TRACKER_FILING_PRESETS` (per-task-type slug prefix / label / body requirements — `reference-watch`, `ux`, `repo-study`), `TRACKER_FILING_TASK_TYPES` (derived from the presets, so a gated type always has wording), and `formatTrackerInstructions(tracker, options)` which renders the plan/github/gitlab/jira block (reference-watch is the default option set, so a bare call stays byte-identical for it). Consumed by the `claim-work` router in `cosTaskGenerator.js`, `referenceRepos.js`, and `routes/apps.js`. || `eidoverseProxyRoutes.js` | Allowlist + path helpers for the same-origin Eidoverse reverse-proxy on `:5555` (`/eidoverse-host` prefix strip and root routes like `/ws` / `/version` while the host is active). Shared by `services/eidoverseProxy.js` so the main server and the optional `:5563` bridge stay in sync with eidoverse-worlds `server/routes.ts`. |diff --git a/server/lib/characterEvolutionCoverage.js b/server/lib/characterEvolutionCoverage.jsindex e97018422d..674c0b0ca3 100644--- a/server/lib/characterEvolutionCoverage.js+++ b/server/lib/characterEvolutionCoverage.js@@ -52,7 +52,7 @@ const hasText = (value) => typeof value === 'string' && value.trim().length > 0;/*** Per-lens and whole-report coverage. Mirrors `CHARACTER_REVIEW_STATUSES` in- * `characterIntegrity.js` on purpose — the two answer the same shaped question+ * `characterIntegrityVocabulary.js` on purpose — the two answer the same shaped question* about a cast, and a second vocabulary for "we did not actually look" is how* one of them quietly starts meaning "clean".* - `verified` — every stage resolved, every reachable path enumerated,diff --git a/server/lib/importScoping.test.js b/server/lib/importScoping.test.jsindex af1b29300d..b884d9889c 100644--- a/server/lib/importScoping.test.js+++ b/server/lib/importScoping.test.js@@ -245,9 +245,12 @@ describe('deferred imports stay deferred (#6156)', () => {// browser bundle reads: `lib/characterIntegrityVocabulary.js`// (split out of `characterIntegrity.js`, which reaches `crypto`) and// `lib/creativeBriefLimits.js` (the caps both creative validation modules-// enforce). Measured 95,414 (+168): each leaf is reached by every suite that-// crosses its parent or the lib barrel, with nothing behind it to defer — the-// tolerated leaf shape, not an eager edge. Restore the ~1.5k allowance.+// enforce). Measured 95,470 (+223 over main's 95,247): `creativeBriefLimits.js`+// +206 (every suite that reaches `creativeCommissionValidation.js` through+// `validation.js`'s flat re-export), `uuid.js` +56 (newly reached through+// `seriesCharacterArc.js`), the vocabulary leaf +24, less the five deleted+// mirror suites — leaves with nothing behind them to defer, the tolerated shape,+// not an eager edge. Restore the ~1.5k allowance.const MAX_STATIC_INSTANTIATIONS = 96900;const SKIP_DIRS = new Set(['node_modules', 'coverage', 'dist', 'data']);diff --git a/server/lib/seriesCharacterArc.js b/server/lib/seriesCharacterArc.jsindex 2fff0bbf56..ffcb30952e 100644--- a/server/lib/seriesCharacterArc.js+++ b/server/lib/seriesCharacterArc.js@@ -35,8 +35,8 @@* `TRANSITION_KINDS` and `TRANSITION_KIND_LABELS` from here (the arc editor in* `PipelineSeries.jsx` caps its inputs at the numbers the PATCH route enforces),* so this module must reach no Node built-in — ids come from `uuid.js`, which- * reads the global WebCrypto — and `scripts/client-server-import-purity.test.js`- * walks its import graph.+ * reads the global WebCrypto (the browser never mints one) — and+ * `scripts/client-server-import-purity.test.js` walks its import graph.*/import { BIBLE_LIMITS } from './bibleLimits.js';