Skip to content

feat(mcp-worker): recover production 0.4.0 source + Upsilon identity - #3

Merged
SunrisesIllNeverSee merged 3 commits into
mainfrom
feat/upsilon-worker-recovery
Aug 30, 2026
Merged

SunrisesIllNeverSee merged 3 commits into
mainfrom
feat/upsilon-worker-recovery

Conversation

@SunrisesIllNeverSee

Copy link
Copy Markdown
Owner

Summary

  • Recovers the deployed production mcp.mos2es.org Worker source (v0.4.0, 27 tools, 6 resources, 5 prompts) from the authoritative b2bpilot working copy and reconciles it onto moses/mcp-worker.
  • Replaces the stale v0.2.0 snapshot (21 tools, no resources/prompts, pre-computed demo_data.json) with the production-equivalent source that computes outputs from raw observations at request time.
  • Applies the Upsilon product identity (server, serverInfo, health endpoint) with MO§ES™ governance and SigRank proof-surface roles, plus the interpretation-limits boundary.
  • Adds a contract test (tests/mcp-worker-contract.test.mjs) asserting exactly 27 tools, 6 resources, 5 prompts, every production name preserved, Upsilon product roles present, and write tools gated by authorization.

Source of recovered source

The production 0.4.0 source was tracked in Moses_Enterprise_B2BPilot_/_workers/mcp-worker (commit e460aa6). Live https://mcp.mos2es.org/ confirms 27 tools / 6 resources / 5 prompts / v0.4.0. The moses repo snapshot was v0.2.0 / 21 tools / no resources or prompts — a rollback left the repo behind production.

What is NOT in this PR

  • No redeployment of moses/mcp-worker (awaiting owner approval).
  • No cross-repository conformance gates (separate PR).
  • No enterprise lineage adapter (separate PR).
  • No mos2es.com redesign.

Test plan

  • node --test tests/mcp-worker-contract.test.mjs → 11/11 pass
  • node --test tests/upsilon-architecture.test.mjs → 4/4 pass
  • wrangler deploy --dry-run → success (664 KiB upload)
  • Live https://mcp.mos2es.org/ confirms 27 tools / 6 resources / 5 prompts / v0.4.0 (parity verified)

Generated with Devin

SunrisesIllNeverSee and others added 2 commits August 28, 2026 15:10
…ntity

Recover the deployed mcp.mos2es.org Worker source (v0.4.0, 27 tools, 6
resources, 5 prompts) from the b2bpilot working copy and reconcile it
onto moses/mcp-worker. The previous snapshot (v0.2.0, 21 tools, no
resources/prompts, pre-computed demo_data.json) is replaced with the
production-equivalent source that computes outputs from raw
observations at request time.

Upsilon product identity applied:
- server: "Upsilon MCP Server"
- product: Upsilon, governance: MO§ES™, proof_surface: SigRank
- serverInfo.name: upsilon-mcp with title + governance + proof_surface
- interpretation-limits boundary in health endpoint

Contract test (tests/mcp-worker-contract.test.mjs) asserts:
- exactly 27 tools, 6 resources, 5 prompts (production parity)
- every production tool name, resource URI, prompt name preserved
- Upsilon product roles present in health + initialize endpoints
- interpretation-limits boundary present
- write tools gated by AUTHORIZATION_REQUIRED + isError

Source files recovered:
- index.js (2338 lines, computes from raw observations)
- observations.js, lineages.js (JSONL-derived JS modules)
- operators.json, cohort.json, metric_registry.json,
  reference_field.json, outcomes.json, interventions.json,
  teams.json, workflows.json

Verification:
- node --test tests/mcp-worker-contract.test.mjs → 11/11 pass
- node --test tests/upsilon-architecture.test.mjs → 4/4 pass
- wrangler deploy --dry-run → success (664 KiB upload)

No redeployment authorized by this commit.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…import

Extract TOOLS, RESOURCES, PROMPTS, WRITE_TOOLS arrays from index.js into
catalog.mjs so the contract test can import them directly instead of
parsing source text with eval(). The catalog is pure static data with no
JSON imports, making it loadable in Node.js without import attributes.

Add .github/workflows/mcp-worker-contract.yml to run the contract test
and wrangler dry-run on every push/PR touching the Worker source.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
SunrisesIllNeverSee added a commit that referenced this pull request Aug 28, 2026
…ad arg fix

Add tests/enterprise-adapter-conformance.test.mjs — validates the portable
portion of enterprise observations against all 13 sigrank-standard
fixtures (pinned ref 224505a). Ensures the adapter preserves portable
metrics, telemetry, warnings, and namespace isolation across the same
fixture pack consumed by sigrank-mcp and sigrank-app.

Add .github/workflows/enterprise-adapter.yml — runs enterprise adapter
unit tests + standalone conformance gate on every push/PR touching the
adapter. Checks out sigrank-standard at the pinned ref.

Fix dead 4th argument in validatePilotManifest checkNode call (errors
array is captured via closure, not passed as parameter).

Rebased onto origin/main so this PR is independently reviewable without
PR #3 (worker recovery).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… auth

The serverInfo name field is a protocol identifier used by MCP clients to
identify the server. Production at mcp.mos2es.org uses "moses-mcp" —
changing it to "upsilon-mcp" would break existing clients. Preserve the
production name while carrying the Upsilon product identity via the title
field ("Upsilon — Enterprise Measurement Engine").

Also documents the write-tool authorization gate as intentional pilot-phase
behavior: production rejects all write tools with AUTHORIZATION_REQUIRED
regardless of credentials presented (verified against mcp.mos2es.org
2026-08-28). The pilot is read-only; write tools are declared for protocol
completeness and future expansion.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
SunrisesIllNeverSee added a commit that referenced this pull request Aug 29, 2026
…ad arg fix

Add tests/enterprise-adapter-conformance.test.mjs — validates the portable
portion of enterprise observations against all 13 sigrank-standard
fixtures (pinned ref 224505a). Ensures the adapter preserves portable
metrics, telemetry, warnings, and namespace isolation across the same
fixture pack consumed by sigrank-mcp and sigrank-app.

Add .github/workflows/enterprise-adapter.yml — runs enterprise adapter
unit tests + standalone conformance gate on every push/PR touching the
adapter. Checks out sigrank-standard at the pinned ref.

Fix dead 4th argument in validatePilotManifest checkNode call (errors
array is captured via closure, not passed as parameter).

Rebased onto origin/main so this PR is independently reviewable without
PR #3 (worker recovery).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@SunrisesIllNeverSee
SunrisesIllNeverSee merged commit 4675063 into main Aug 30, 2026
1 check passed
@SunrisesIllNeverSee
SunrisesIllNeverSee deleted the feat/upsilon-worker-recovery branch August 30, 2026 01:17
SunrisesIllNeverSee added a commit that referenced this pull request Aug 30, 2026
#4)

* feat(enterprise-adapter): versioned Upsilon lineage adapter + fixtures

Add the Upsilon Enterprise Lineage Adapter
(upsilon/enterprise-adapter/0.1-draft) that bridges sigrank/0.1-draft
portable observations into Upsilon's governed enterprise namespace.

Namespace separation:
- portable: preserved verbatim (spec, telemetry, metrics, warnings)
- enterprise: separate namespace (cohort, window, lineage, derivations)
- Construction, composite scores, outcome correlations, and other
  enterprise derivations never leak into portable metrics

The adapter:
- Accepts sigrank/0.1-draft portable records
- Rejects records that don't declare the correct spec version
- Rejects records with enterprise leaks in portable metrics/fields
- Validates telemetry primitives (non-negative integers or null)
- Preserves null/zero distinction for unavailable cache
- Validates pilot manifests against the canonical pilot schema
- Enforces governance constraints (no personnel_action, no content_inspection)

Fixtures (4):
- complete-telemetry: all four pillars, all five metrics
- partial-cache: cache_write/cache_read unavailable (null)
- zero-values: zero cache distinct from null
- invalid-version: rejects non-sigrank/0.1-draft records

Schema:
- enterprise-adapter/upsilon-enterprise-observation.schema.json defines
  the enterprise observation structure with portable + enterprise namespaces

Tests (15):
- Adapter version + namespace contracts
- Fixture-driven tests (complete, partial, zero, invalid)
- Namespace separation (no enterprise leak into portable)
- Adapter rejection (missing fields, negative telemetry, enterprise leak)
- Pilot manifest validation (valid, wrong roles, punitive, inspecting)
- Enterprise observation schema validation

Verification:
- node --test tests/enterprise-adapter.test.mjs → 15/15 pass
- node --test tests/ (all) → 30/30 pass

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(enterprise-adapter): add standalone fixture conformance + CI + dead arg fix

Add tests/enterprise-adapter-conformance.test.mjs — validates the portable
portion of enterprise observations against all 13 sigrank-standard
fixtures (pinned ref 224505a). Ensures the adapter preserves portable
metrics, telemetry, warnings, and namespace isolation across the same
fixture pack consumed by sigrank-mcp and sigrank-app.

Add .github/workflows/enterprise-adapter.yml — runs enterprise adapter
unit tests + standalone conformance gate on every push/PR touching the
adapter. Checks out sigrank-standard at the pinned ref.

Fix dead 4th argument in validatePilotManifest checkNode call (errors
array is captured via closure, not passed as parameter).

Rebased onto origin/main so this PR is independently reviewable without
PR #3 (worker recovery).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ci): add fetch-depth: 0 for sigrank-standard SHA checkout

actions/checkout cannot resolve a bare commit SHA with the default
depth=1 fetch. Adding fetch-depth: 0 allows the pinned ref (224505a)
to be resolved correctly.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ci): checkout main + git reset for SHA pin, update ref to c73f152

actions/checkout cannot resolve a bare commit SHA as a ref. Changed to
checkout main with fetch-depth: 0, then git reset --hard to the pinned
SHA. Updated pinned ref from 224505a (12 fixtures) to c73f152 (13
fixtures, includes enterprise-adapter-lineage fixture).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(test): skip conformance gracefully when standard repo not found

Replace process.exit(2) with test.skip when sigrank-standard is not
available. This prevents the build job (which runs all tests via
npm run test:coverage) from failing when the cross-repo checkout
hasn't been performed.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant