@descix/platform-api 2.1.2 → 2.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descix/platform-api",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Shared platform infrastructure: Firestore models, auth/session, permissions, entitlements, email",
5
5
  "repository": {
6
6
  "type": "git",
@@ -83,6 +83,12 @@ export const EVIDENCE_CONTRACT_FRAME = Object.freeze({
83
83
  "HOW claims are settled is per-app/community. Each publishes a SETTLEMENT PROFILE naming its admissible evidence and runnable verification commands. Fetch a specific one with get_evidence_contract({ app_id }).",
84
84
  });
85
85
 
86
+ /**
87
+ * The ONE owner of the EGPT public seed repo URL (GitHub transfer 2026-10-09:
88
+ * eabadir/EGPT -> DeSciX/egpt-lean, old URLs 301). Every repo field below consumes it.
89
+ */
90
+ const EGPT_SEED_REPO = 'https://github.com/DeSciX/egpt-lean';
91
+
86
92
  /**
87
93
  * PER-APP SETTLEMENT PROFILES, keyed by app_id/community_id. EGPT (the formal-mathematics
88
94
  * community) is the first instance — it settles on the Lean 4 kernel. Every field is
@@ -94,9 +100,10 @@ export const SETTLEMENT_PROFILES = Object.freeze({
94
100
  domain: 'formal-mathematics (Lean 4)',
95
101
  settles_on:
96
102
  'The Lean 4 kernel typechecking the proof chains sorry-free, plus an axiom-closure audit on the capstone theorems.',
97
- // The PUBLIC contributable seed users clone (full Lean/EGPT + EGPTMath trees).
103
+ // The PUBLIC contributable seed users clone (the Lean/EGPT tree; measured 2026-10-09
104
+ // post-transfer: the EGPTMath tree is NOT in this repo — see egpt_tests below).
98
105
  // The private research remote (egpt_research) is intentionally NOT surfaced here.
99
- repo: 'https://github.com/eabadir/EGPT',
106
+ repo: EGPT_SEED_REPO,
100
107
  burden_of_proof: Object.freeze({
101
108
  // R3 (voice round 2): LEAD with the verifiability invitation — you can check this
102
109
  // yourself, here is the exact command, it takes minutes — and present the default
@@ -131,21 +138,22 @@ export const SETTLEMENT_PROFILES = Object.freeze({
131
138
  verification_commands: Object.freeze([
132
139
  Object.freeze({
133
140
  id: 'lean_build',
134
- repo: 'https://github.com/eabadir/EGPT',
141
+ repo: EGPT_SEED_REPO,
135
142
  cwd: 'Lean/EGPT',
136
143
  cmd: 'lake build',
137
144
  expected_when_green: 'The Lean 4 proof chain typechecks sorry-free (~2 min).',
138
145
  }),
139
146
  Object.freeze({
147
+ // EGPTMath ships as the published Rust->WASM SDK (no JS math-core source is
148
+ // public); the command is self-contained and runs from any directory, so it
149
+ // carries no repo/cwd root.
140
150
  id: 'egpt_tests',
141
- repo: 'https://github.com/eabadir/EGPT',
142
- cwd: 'EGPTMath',
143
- cmd: 'node test/EGPTTestSuite.js',
144
- expected_when_green: 'The integer-only (IOP, not FLOP) JS math library passes its main suite (157 tests).',
151
+ cmd: 'npx -y -p @descix/egpt-math-sdk@0.3.1 egpt-math-bench --quiet',
152
+ expected_when_green: 'Exit 0, ending "EGPT-MATH BENCH: 157 canonical assertions | 157 runnable | 157/157 pass | 0 structurally-gapped (pinned) → RESULT: PASS", preceded by the "wasm sha256 …" provenance line and the "… WASM calls …" counter line — the integer-only (IOP, not FLOP) EGPT math, compiled Rust→WASM; a corrupted WASM exits 1 (no JS fallback ships).',
145
153
  }),
146
154
  Object.freeze({
147
155
  id: 'axiom_audit',
148
- repo: 'https://github.com/eabadir/EGPT',
156
+ repo: EGPT_SEED_REPO,
149
157
  cwd: 'Lean/EGPT',
150
158
  cmd: '#print axioms InformationTheory.P_eq_NP (and .P_eq_NP_info, .P_eq_NP_info_standard)',
151
159
  expected_when_green: 'Axiom closure is {propext, Quot.sound} on all three capstones — no Classical.choice, no sorryAx, no custom axioms.',
@@ -36,6 +36,13 @@ export {
36
36
  MCP_HANDSHAKE_INSTRUCTIONS,
37
37
  PLATFORM_BOOTSTRAP_SUMMARY,
38
38
  } from './handshake.js';
39
+ // CEO 2026-10-09 — PLATFORM BASICS SSOT: the app-lane-safe identity model + naming rules.
40
+ // One owner, two consumers: tellMeHowBootstrap serves the SUMMARY on scope:'bootstrap';
41
+ // DeSciX/scripts/generate-platform-basics.mjs renders the DOC into V2_docs (→ KB tier-1).
42
+ export {
43
+ PLATFORM_BASICS_SUMMARY,
44
+ PLATFORM_BASICS_DOC,
45
+ } from './platform-basics.js';
39
46
  // ws-chat-multimodal-image-attach — THE canonical media-on-a-chat-turn contract: kinds, MIME
40
47
  // vocabulary, byte policy, normalize(partial)->bag, and the ONE provider-block encoder. Both
41
48
  // the Cloud chat pipeline and the advertised nativeTools schema consume this; nobody
@@ -0,0 +1,115 @@
1
+ /**
2
+ * @descix/platform-api/mcp-tools — PLATFORM BASICS SSOT (CEO 2026-10-09, "we're going to
3
+ * need a platform basics … that gets into the bootstrap sequence").
4
+ *
5
+ * THE single owner of the app-lane-safe "platform basics": the canonical identity model,
6
+ * naming rules, environments, and the developer entry path. Two consumers, zero mirrors:
7
+ * - DeSciX_Cloud communityCommands.tellMeHowBootstrap serves PLATFORM_BASICS_SUMMARY as
8
+ * the `platform_basics` section of the tell_me_how scope:'bootstrap' payload;
9
+ * - DeSciX/scripts/generate-platform-basics.mjs renders PLATFORM_BASICS_DOC into
10
+ * V2_docs/architecture/platform-basics.md (GENERATED), which the daita General corpus
11
+ * manifest carries tier-1 into the KB and the public docs dist.
12
+ *
13
+ * Three-audience rule (same contract as handshake.js): this text is for the EXTERNAL
14
+ * app-lane reader. It must never name load balancers, GCP projects, secret names, or
15
+ * platform source paths. Dependency-free leaf. Do NOT hand-mirror these strings; import
16
+ * them, or regenerate the doc.
17
+ */
18
+
19
+ /**
20
+ * The compact basics served inline on every scope:'bootstrap' response. Deterministic —
21
+ * no RAG lookup. Keep it under ~250 words; the full treatment is PLATFORM_BASICS_DOC,
22
+ * reachable through the KB (query_knowledge_base on daita/General).
23
+ */
24
+ export const PLATFORM_BASICS_SUMMARY = [
25
+ "PLATFORM BASICS — the identity model everything else derives from:",
26
+ "1. A community IS its ERC-20 token, per environment: community_id == app_id == lowercased(token_symbol). One token symbol, one on-chain contract, one community.",
27
+ "2. Every community is itself an app (its default app), and every app belongs to exactly one community. Sub-apps are named {community_id}-{short_name} (e.g. egpt-frqtl, daita-docs); the short name never contains '-'.",
28
+ "3. 'descix' is a BRAND, never an identifier. The community branded 'DeSciX' has id 'daita' (token DAITA). No app or community id is ever 'descix' or 'descix-*'.",
29
+ "4. Identifiers are environment-invariant; records are per-environment. A community or app existing in one environment (dev/demo/prod) says nothing about another — each env materializes its own records.",
30
+ "5. An app is three slots: site/ (any web framework), assets/ (its agent instructions and description), microservice/ (optional backend). Each app has knowledge bases; RAG answers are metered against USD AI credits.",
31
+ "6. Developers build with the published @descix/cli and @descix/app-sdk as external users: `app init` creates the record + default KB + scaffold, `descix serve` runs it locally, `kb corpus sync` publishes the KB, `site upload` publishes the site. Start with `descix tell-me-how`.",
32
+ ].join('\n');
33
+
34
+ /**
35
+ * The full app-lane-safe basics document, rendered to V2_docs/architecture/platform-basics.md
36
+ * by DeSciX/scripts/generate-platform-basics.mjs. Markdown body WITHOUT the generated-file
37
+ * banner (the generator owns that).
38
+ */
39
+ export const PLATFORM_BASICS_DOC = `# DeSciX Platform Basics
40
+
41
+ What every reader — a person or an agent — must internalize before doing anything on DeSciX.
42
+ This is the app-developer / consumer view; it deliberately contains no platform internals.
43
+
44
+ ## The canonical identity model
45
+
46
+ Everything on DeSciX derives from one model:
47
+
48
+ 1. **Token ⟷ contract, 1:1.** Every token has exactly one on-chain ERC-20 contract. One
49
+ symbol means one contract — a second contract is never deployed for an existing symbol.
50
+ 2. **Community ⟷ token, per environment.** Every community is linked to exactly one token —
51
+ the token whose symbol it carries — and its identifiers derive from it:
52
+ \`community_id == lowercased(token_symbol)\` (DAITA → \`daita\`, EGPT → \`egpt\`).
53
+ 3. **A community IS an app — its default app.** Every community is itself an agentic app:
54
+ \`app_id == community_id == lowercased(token_symbol)\`. Creating a community creates its
55
+ default app; the two are inseparable.
56
+ 4. **Apps belong to communities; not every app is a community.** Every app belongs to exactly
57
+ one community. Sub-apps are named \`{community_id}-{short_name}\` (for example
58
+ \`egpt-frqtl\`, \`daita-docs\`); the short name never contains \`-\` (the reserved
59
+ separator). Only communities have on-chain tokens — sub-apps have no on-chain presence.
60
+ 5. **Identifiers are environment-invariant; records are per-environment.** The same id names
61
+ the same thing across dev, demo and prod, but each environment materializes its own
62
+ community and app records. Existence in one environment says nothing about another, and an
63
+ environment name is never part of an id.
64
+
65
+ ## Brand vs identifier
66
+
67
+ \`descix\` is the platform's **brand and infrastructure namespace** (the descix.net domain,
68
+ the \`descix\` CLI) — it is **never an identifier**. The community branded "DeSciX" has
69
+ \`community_id\` and \`app_id\` \`daita\` (its token is DAITA). There is no \`descix\`
70
+ community, so no app is ever named \`descix\` or \`descix-*\`. Display names are free-form
71
+ ("DeSciX" stays a display name); ids are always the lowercased token symbol.
72
+
73
+ ## What an app is
74
+
75
+ An app is an agentic service with three slots:
76
+
77
+ \`\`\`
78
+ {app_root}/
79
+ ├── site/ ← its web UI — any framework (VitePress, React, …)
80
+ ├── assets/ ← system_instructions.md, app_description.md, icon.png
81
+ └── microservice/ ← optional backend service
82
+ \`\`\`
83
+
84
+ Every app has one or more **knowledge bases** (KBs). RAG queries against them
85
+ (\`ask_question_to_app\`, \`query_knowledge_base\`) are metered against a shared USD
86
+ AI-credit balance (\`get_credit_balance\` shows it). Apps are served inside the platform's
87
+ App Shell — on the web at \`/p/{app_id}\` under the platform origin — and self-custody
88
+ wallet auth (Powch) comes with the shell automatically.
89
+
90
+ ## How developers work
91
+
92
+ Developers build as **external users of the published SDK** — \`@descix/cli\` and
93
+ \`@descix/app-sdk\` from npm — never against platform internals:
94
+
95
+ - \`descix tell-me-how\` — capability discovery; the canonical first command.
96
+ - \`descix app init -a <app_id> -c <community_id>\` — creates the platform record, the
97
+ default KB, and the local scaffold. The only way an app comes into existence.
98
+ - \`descix serve\` — local dev: one HTTPS origin serving your app in the shell, proxying a
99
+ dev server (vite-like, with HMR) or serving your built site, exactly as the cloud will.
100
+ - \`descix kb corpus sync -a <app_id> -k <kb>\` — the one KB publishing surface: a
101
+ git-tracked corpus manifest, synced from your repo.
102
+ - \`descix site upload -a <app_id>\` — publishes the built site to the platform.
103
+
104
+ Agents connect over MCP at the platform origin + \`/mcp\`; \`tell_me_how({ scope:
105
+ 'bootstrap' })\` is the canonical first call and returns these basics, the caller's context,
106
+ and the essential tool schemas.
107
+
108
+ ## Where to go deeper
109
+
110
+ - \`descix tell-me-how\` (CLI) or \`tell_me_how({ question })\` (MCP) — ask in your own words.
111
+ - The app-developer runbook in the daita docs — the end-to-end path from \`app init\` to a
112
+ published, listed app.
113
+ - \`fetch_my_purchases()\` — what the signed-in caller owns; \`get_credit_balance()\` — the
114
+ AI-credit balance platform AI usage draws on.
115
+ `;