# V7-001 Mawu and Forge executable-boundary closure

## Work-package charter

- **Task ID:** `V7-001`
- **Owner:** V7 Mawu, Forge Assist, Moremi realm-runtime, and shared
  authorization maintainers; implementation owner: Elikem Agudogo
- **Accountable product:** V7 Mawu/Moremi creator and realm platform
- **Priority:** P0
- **Target milestone:** 2026-07-15 SOTA gap-closure program
- **Dependencies:** PROMPT-002/PROMPT-003 trust zoning, AUTH-001 capability
  grants, SAFETY-001 static/invocation safety, Wasmtime 45, the Mawu semantic
  grounding contract, and the authenticated internal Moremi boundary
- **Affected schemas and content slots:** Mawu output-grounding and provenance,
  Forge restricted-language/admission receipts, AUTH-bound invocation records,
  and Moremi Wasmtime host-call traces. No production realm, player-visible
  content slot, or cooked artifact changed.
- **Scope closed here:** semantic source-to-output grounding, honest
  procedural-backend labeling, per-refinement and invocation-time Forge policy
  checks, AUTH-001 limit binding, and complete execution of the supported
  restricted Forge program
- **Scope deliberately excluded:** arbitrary JavaScript is not an accepted Forge
  language and is rejected rather than partially projected
- **Risk tier:** Critical creator-code execution, delegated authority, source
  faithfulness, and provenance
- **Source commits:** `18b6b990a5` (Forge Wasmtime admission), `2af8c9f1d6`
  (semantic grounding), `b8f637a8d7` (AUTH-bound invocation), and `16d3588f78`
  (complete restricted-program execution)
- **Rollout strategy:** Keep the procedural and semantic-reference backends
  explicitly labeled, fail closed without an injected production backend, and
  admit Forge programs only through the complete restricted grammar, exact
  AUTH-001 bindings, and Wasmtime host-call trace equality.
- **Rollback strategy:** Revert this evidence commit to reopen the five closed
  checklist bullets. Reverting source requires reverting the applicable source
  commit; no persistence migration is involved.
- **Evidence-pack location:** This file

## Mawu semantic grounding is output-bound

The Mawu Studio generation route no longer treats the presence of Sophia source
metadata as proof that an output is grounded. After generation, an injected
`MawuStudioSemanticGroundingVerifier` must describe the factual claims made by
the actual generated descriptor and return claim/citation assessments. The route
builds the portfolio semantic proof bundle over:

1. retrieval proofs for the exact approved Sophia passages;
2. passage-match proofs binding citations to those passages; and
3. claim-entailment proofs binding generated-output claims to cited passages.

The canonical `evaluateSemanticGroundingProofBundle` gate must pass before an
artifact is emitted. Missing verifier configuration returns
`semantic-verifier-not-configured`; unsupported output claims or invalid proof
coverage return `semantic-grounding-failed`. Both outcomes return a null
artifact. The owning regression also injects an unsupported “made of gold” claim
and proves it cannot become an artifact.

This is semantic source-to-output evidence, not source-list decoration. The
proof bundle is preserved on the successful artifact and its summary reports the
entailed-claim numerator and denominator.

## The reference backend is explicitly procedural

The local deterministic backend identifies itself as
`isis.mawu-studio.reference-procedural-backend.v1`. That exact identifier is
written into artifact provenance and asserted by the owning generation-policy
eval. The route never silently substitutes it for an advertised model backend:
when no backend is injected, the result is `backend-not-configured` and no
artifact is fabricated.

The reference semantic verifier is likewise labeled
`isis.mawu-studio.reference-semantic-verifier.v1`. It exists for deterministic
evaluation of the procedural descriptor; it is not described as a production
model or independent human assessment.

## Forge policy is rechecked across generation and invocation

Forge Assist applies its static capability policy inside `generateProposal`. The
initial attempt and every quality refinement therefore traverse the same policy,
AUTH-001, and sandbox-admission sequence. The regression records the source hash
authorized for a low-quality attempt and its refined replacement and proves both
distinct hashes received independent authorization.

The Moremi admission service then:

- accepts only constant string bindings and direct top-level
  `oshun.invoke(capability, strictJsonPayload);` statements, rejecting every
  unsupported statement before instantiation;
- resolves literal, concatenated, bound, and template-computed capabilities;
  unresolved runtime-dynamic, aliased, optional, indexed, or hidden access fails
  closed;
- independently enforces realm-only and declared-capability policy over the
  resolved runtime call set;
- parses each payload as strict JSON, recursively rejects credential- and
  secret-shaped fields, canonicalizes it, and applies a 16 KiB per-call limit;
- compiles every accepted statement, in order, into a real core Wasmtime 45
  module whose data segments contain the exact canonical payload bytes and whose
  `run` export invokes only declared, policy-clean, authority-bound imports;
- rechecks expiry and wall time inside each actual host callback and records the
  corresponding AUTH-001 use ID after reading and revalidating the payload from
  guest memory; and
- requires the host-call, authority-use, and SHA-256 payload traces to match the
  compiled program.

The HTTP boundary requires configured bearer authentication and binds the v3
receipt to artifact ID, source SHA-256, declarations, program-module SHA-256,
host calls, AUTH-001 uses, and payload hashes. Forge Assist refuses substituted
use IDs, malformed hashes, missing module identity, or trace-length mismatches.

## AUTH-001 is bound into the executable request

`Auth001ForgeInvocationAuthority` is a narrow adapter over the canonical
`PortfolioCapabilityBroker`; the broker structurally satisfies the adapter port
without creating a reverse package dependency from Maya into Agentic Studio. For
every declared capability, it resolves:

- exact agent, actor, tenant, user, run, pipeline/session, tool, and purpose;
- the exact `forge-capability:<capability>` resource and `invoke` action;
- source and target trust zones plus risk ceiling;
- grant liveness and scope specificity; and
- the grant's nested `forge` fuel, memory, wall-time, and process limits.

The adapter requests no filesystem path, executable, child process, network, or
secret. It emits no credential or bearer token. Its one-shot binding contains
only the grant/use identity, artifact and source hashes, capability/resource/
action, timestamps, explicit zero-egress/zero-secret constraints, and resource
limits. The binding lifetime is capped at 15 seconds even when the parent grant
lives longer.

Admission schema `v7.moremi.forge-assist-admission.3` rejects missing,
duplicate, expired, overlong, source-swapped, undeclared, egress-enabled,
secret-bearing, or nonzero-process bindings before instantiation. Moremi applies
the narrowest bound fuel and memory limits to its `Store`, keeps process
authority at zero, and checks binding expiry and elapsed wall time in the host
callback. Forge Assist records succeeded, denied, and failed outcomes back
through AUTH-001.

The binding travels only over the bearer-authenticated internal Moremi boundary.
It is not presented as an independently signed public token; exposure of the
internal service API key remains an infrastructure credential incident, not a
supported caller path.

## Supported-language completeness and dynamic-call handling

Forge no longer presents arbitrary JavaScript-like text as executable. The
system prompt names the restricted grammar, positive fixtures use it, and
Moremi's parser consumes the entire source modulo whitespace and comments.
Assignments from invocations, functions, handlers, control flow, trailing
statements, object shorthand, unquoted JSON keys, extra arguments, and embedded
invocations are rejected before Wasmtime. There is therefore no capability-only
projection of otherwise unexecuted behavior.

Literal and constant-computed capabilities execute through the same Wasmtime
host boundary. Truly runtime-dynamic capabilities cannot be proven or linked
under the supported language and fail closed as `DYNAMIC_CAPABILITY_UNRESOLVED`;
aliased or computed property access fails as `UNSUPPORTED_OSHUN_SYNTAX`. This is
mediation by explicit admission or denial, not static-scan permission followed
by an ungoverned call.

## Automated verification

All checks were run sequentially on 2026-07-25:

| Boundary                | Command                                                                                                                                        | Result                   |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| Complete Moremi package | `cargo test --manifest-path apps/v7/moremi-realm-server/Cargo.toml`                                                                            | 82 passed, 0 failed      |
| Moremi Rust lint        | `cargo clippy --manifest-path apps/v7/moremi-realm-server/Cargo.toml --all-targets -- -D warnings`                                             | passed                   |
| Moremi Rust format      | `cargo fmt --manifest-path apps/v7/moremi-realm-server/Cargo.toml -- --check`                                                                  | passed                   |
| Forge Assist            | `pnpm exec vitest run --config libs/maya/forge-assist/vitest.config.ts --maxWorkers=1`                                                         | 25 passed across 3 files |
| Forge Assist types      | `pnpm exec tsc --noEmit -p libs/maya/forge-assist/tsconfig.json`                                                                               | passed                   |
| Forge Assist lint       | `pnpm nx lint @maya/forge-assist --parallel=1`                                                                                                 | passed                   |
| V6/V7 prompt boundary   | `pnpm exec vitest run --config testing/prompt-injection/vitest.config.ts testing/prompt-injection/src/v6-v7-boundaries.spec.ts --maxWorkers=1` | 67 passed                |
| Prompt-boundary types   | `pnpm exec tsc --noEmit -p testing/prompt-injection/tsconfig.json`                                                                             | passed                   |
| Mawu 3D pipelines       | `pnpm exec vitest run --config libs/isis/three-d-pipelines/vitest.config.ts --maxWorkers=1`                                                    | 23 passed                |
| Mawu types              | `pnpm exec tsc --noEmit -p libs/isis/three-d-pipelines/tsconfig.lib.json`                                                                      | passed                   |
| Changed source lint     | `pnpm exec eslint libs/maya/forge-assist/src libs/isis/three-d-pipelines/src/mawu-studio-ai-creation.ts --max-warnings=0`                      | passed                   |
| Patch hygiene           | `git diff --check`                                                                                                                             | passed                   |

### 2026-07-29 evidence refresh

The refresh ran against repository commit
`85f77dd06059c2b2e67d2e5fb6aa4617415ab723` on `app-dev-server`, Linux
`6.8.0-134-generic` x86_64, Node.js `v24.15.0`, pnpm `10.25.0`, TypeScript
`6.0.3`, Rust `1.94.1`, Cargo `1.94.1`, and Vitest `4.1.7`. No model/provider
credential or production realm was used.

| UTC interval                                      | Exit | Exact command and result                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------- | ---: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 2026-07-29T11:24:38.802Z–2026-07-29T11:24:58.507Z |    0 | `cargo test --manifest-path apps/v7/moremi-realm-server/Cargo.toml` — 82/82 library cases passed; main/doc targets contained no tests                                                                                                                                                                                                                                                                                                                                                |
| 2026-07-29T11:25:28Z, 12.38 s                     |    1 | The first `pnpm exec vitest run --config testing/prompt-injection/vitest.config.ts testing/prompt-injection/src/v6-v7-boundaries.spec.ts --maxWorkers=1` reached 41 passing V7 cases but 26 V6 cases crashed during setup because ignored April compiler output under `libs/shared/tracing/src/*.js` shadowed the newer tracked TypeScript and called the removed OpenTelemetry `Resource` constructor. This host-artifact failure is retained and is not counted as a product pass. |
| 2026-07-29T11:26:51.831Z–2026-07-29T11:27:03.619Z |    0 | After moving exactly 24 ignored tracing `.js`, `.js.map`, and `.d.ts.map` artifacts to `/tmp/oshun-tracing-stale.Cxdqit`, the same prompt-boundary command passed 67/67 against tracked source.                                                                                                                                                                                                                                                                                      |
| 2026-07-29T11:27:13.146Z–2026-07-29T11:28:19.183Z |    0 | `pnpm --dir libs/shared/tracing exec vitest run --maxWorkers=1` (73/73); `pnpm exec vitest run --config libs/maya/forge-assist/vitest.config.ts --maxWorkers=1` (25/25); `pnpm exec vitest run --config libs/isis/three-d-pipelines/vitest.config.ts --maxWorkers=1` (45/45); production typechecks for tracing, Forge Assist, and Mawu all passed                                                                                                                                   |

The stale files were ignored, untracked compiler output and do not exist in a
clean checkout. No tracked tracing compatibility patch was necessary:
`tracer.ts` already uses OpenTelemetry 2.x `resourceFromAttributes`.

The protected working lockfile retains its exact pre-task SHA-256. A frozen
lockfile probe still reports the pre-existing root-manifest drift
(`@changesets/cli` removal and `@fastify/cors` specifier mismatch); this slice
does not change a package manifest or claim to repair that unrelated protected
state.

## Artifact identity

| Artifact                                                     | SHA-256                                                            |
| ------------------------------------------------------------ | ------------------------------------------------------------------ |
| `apps/v7/moremi-realm-server/src/forge_assist_sandbox.rs`    | `fb56e8f3d9935c0cbd5ce6358f63f75f71d5a9bcc8584ce48a7d80826b8a0354` |
| `apps/v7/moremi-realm-server/src/lib.rs`                     | `f2a633a0ce45935440e48dd29d67edff1b1777c6bf1ac40bac0724d8b8397c5a` |
| `libs/maya/forge-assist/src/invocation-authority.ts`         | `dfcc21c131973a5fadcb9a8af65f6af2b5bf370ede737395829899e17276e11c` |
| `libs/maya/forge-assist/src/invocation-authority.spec.ts`    | `120663ef93d50953cbdea0d345a4ae38859b5d21721d7ddcb72728c6d7625429` |
| `libs/maya/forge-assist/src/forge-assist.ts`                 | `ea5c5a893be8a686d525c37a2038196f484c877aaf5550cc3b1ba3b1483b70a4` |
| `libs/maya/forge-assist/src/sandbox-admission.ts`            | `97dfdc5bd86b4779f4d4f539fbb05488c7da2b31b5af41b16fb49042a34557d0` |
| `libs/maya/forge-assist/src/capability-policy.ts`            | `132a347814b895ef28baa366d1063ba6cdc1d8a1486415f4e7b7ed62fc6c3ab3` |
| `testing/prompt-injection/src/v6-v7-boundaries.spec.ts`      | `e5bf69f17c41eca5c3e0ad4de19822d626ae5f1cd583cf3818ad7fc7e7f29e23` |
| `libs/isis/three-d-pipelines/src/mawu-studio-ai-creation.ts` | `5b2e353a12f3f39d2a2d9b475b496bae1ee540019a1428526d362917dc5f57c5` |
| `libs/isis/three-d-pipelines/src/three-d-pipelines.test.ts`  | `01c2348a10668b6fbac1401fd5ebd24bd7f09ca5dd59aa1ccef6b6a3fab15dc1` |

## Resource and applicability note

The host reported 15 GiB RAM, 31 GiB swap, 12 GiB available memory, and 15 GiB
free disk. Another long-lived UI audit was present, so verification remained
targeted and sequential. This slice changes backend security/provenance code,
not rendered web, mobile, admin, or Unreal UI, so frontend-skill, product
Playwright UI, mobile, and Unreal automation are not applicable.

## Authority, blocker, and generated-status disposition

- The negative/adversarial suites reject unsupported or hidden syntax, dynamic
  and aliased capability access, secret-bearing or oversized payloads,
  undeclared imports, widened/expired/source-swapped AUTH bindings, falsified
  Wasmtime traces, missing semantic verification, and unsupported output claims.
  Each failure produces no executable or Mawu artifact.
- Test grants, bearer tokens, semantic verifiers, and actors are fixtures. No
  policy requires a human release signature to implement this restricted
  execution boundary, and no real realm/player approval is fabricated.
- No V7-001 implementation blocker remains. Credentialed headline backends,
  full-engine parity, cooked placement, human play/review, canaries, and
  best-authored comparisons remain explicit V7-002/V7-003 work.
- Generated capability/status views must not convert the labeled procedural Mawu
  backend or local Wasmtime tests into production readiness. The
  completed-work-package admission verifier derives V7-001's evidence linkage
  from the ledger and this task-specific pack; no generated production-green
  claim changed.

## Publication identity

- **AUTH-bound Forge source:** `b8f637a8d7a8719495990544897c9e59a3d9fc60`
- **Complete Forge-program source:** `16d3588f7824d44cd31dbe6b9a54cf1722bd4f4d`
