Skip to content

Feat/uapf mcp execution scope#141

Merged
rg4444 merged 6 commits into
mainfrom
feat/uapf-mcp-execution-scope
Jun 3, 2026
Merged

Feat/uapf mcp execution scope#141
rg4444 merged 6 commits into
mainfrom
feat/uapf-mcp-execution-scope

Conversation

@rg4444

@rg4444 rg4444 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Describe the change and link related issues.

Validation

  • Does this change affect BPMN render/diff?
  • Does this change require regenerating images?
  • Any schema/validator updates?

Testing

List the commands/checks you ran locally.

rg4444 and others added 6 commits May 18, 2026 08:40
- accept uapf.yaml / uapf.yml / process.uapf.* (legacy manifest.json still
  accepted); decode YAML manifests, validate as the v2.2.0 schema
- replace embedded schema with the canonical UAPF v2.2.0 manifest schema
- spec.Manifest now models kind/id/level/version/cornerstones/paths
- cornerstone-aware structural validation (Level-4 requires bpmn cornerstone
  + resources/mappings.yaml + metadata/ownership.yaml + metadata/lifecycle.yaml)
- empty-repo screen: add an Import .uapf button (modal already in repo header);
  repo-uapf-import.ts binds the trigger independently of the dropdown
- refresh import-modal copy and home-page tree illustration to uapf.yaml
Catches up the ProcessGit working tree with all UAPF integration work:

Phase 3 (UAPF v2.4.0 — BPMN algorithm task overlay; deployed earlier):
- web_src/js/features/diagrams/bpmn.ts: wire attachUapfAlgorithmOverlays
  into BpmnViewer and BpmnModeler import flows.
- web_src/js/features/diagrams/uapf-algorithm-overlay.ts (new): bpmn-js
  Overlays-API based renderer; for every serviceTask carrying
  uapf:algorithmCardRef (any prefix bound to https://uapf.dev/bpmn/v2.4)
  draws the stacked-cards + ƒ icon (top-left), risk-class dot (top-right,
  green/amber/red per chapter 13.10), card id label, and metadata strip
  (version · kind · determinism).
- web_src/js/features/diagrams/uapf-card-loader.ts (new): fetches
  algorithms/{cardId}.card.yaml via the Gitea raw endpoint; minimal
  regex-based YAML scalar parser; per-page cache.

Phase B (UAPF v2.5.0 — Algorithm Card viewer for *.card.yaml):
- modules/diagrams/detect.go: new DiagramCard type, extension detection
  for *.card.yaml/.yml/.json, Editable() true so Edit File button works
  (the adapter routes Edit to Gitea's native editor).
- web_src/js/features/diagrams/index.ts: case 'card' added to
  createAdapter switch.
- web_src/js/features/diagrams/card.ts (new, 518 lines): polymorphic
  Preview-tab adapter for algorithm cards. Common header (metadata
  strip + IO contract + risk dot per chapter 13.10) + polymorphic body
  (external sample browser with string-equality match against embedded
  tests per Q3a, inline regex highlighter, inline FEEL placeholder for
  future client-side eval, inline DMN link-out to cornerstone,
  composite step list, fallback for rego/sql/wasm) + footer (test count
  + chapter 13.16 reference). enterEdit redirects to Gitea's built-in
  editor at /_edit/{branch}/{path}.
- package.json + pnpm-lock.yaml: js-yaml ^4.1.0 added.

Deployment note: as of this commit the running processgit binary at
/app/gitea/gitea does NOT include the detect.go change (Go rebuild not
performed in the working session). The card viewer is live via a
tactical frontend-only hook (custom footer.tmpl + esbuild-bundled
standalone uapf-card-viewer-standalone.js dropped into
/data/gitea/public/) that detects *.card.yaml URLs client-side. To
land the proper Preview-tab integration, rebuild the processgit Docker
image from this branch's HEAD; the Dockerfile.binonly chmod step
expects the binary name 'gitea' (legacy) but Makefile produces
'processgit' (fork name) — patch chmod or rename binary before image
deploys cleanly.
The Dockerfile expected /src/gitea for both chmod and COPY in the
build-env stage, but the Makefile produces /src/processgit (the
EXECUTABLE variable is set to 'processgit' on Linux, matching the
fork name). The runtime stage's COPY still places the binary at
/app/gitea/gitea for s6 service compatibility.

Also updates the base image from node:22.6.0-alpine3.22 (removed
from Docker Hub) to node:22-alpine.

This unblocks the proper Preview-tab integration for *.card.yaml
files — the new binary (with DiagramCard detection from
modules/diagrams/detect.go) now builds cleanly via docker build.
UAPF v2.5.0 chapter 13.16: when the user clicks an algorithm task
overlay in the BPMN diagram, the Algorithm Card viewer opens in a
side-panel drawer that slides in from the right, preserving the BPMN
process context behind it.

Two changes:

- web_src/js/features/diagrams/uapf-algorithm-overlay.ts: the overlay
  root div is now interactive (cursor: pointer, pointer-events: auto)
  and carries data-uapf-card-ref. The attachUapfAlgorithmOverlays
  walker binds a click handler via bindOverlayClick() that locates
  the bpmn-js-managed overlay wrapper by data-overlay-id and dispatches
  to openCardDrawer().

- web_src/js/features/diagrams/uapf-card-drawer.ts (new, 191 lines):
  side-panel drawer module. Slides in from the right (transform
  transition), backdrop fades in (opacity transition), Escape and
  backdrop click both close. Body lazily imports ./card.ts (the same
  polymorphic Preview-tab adapter) so the drawer code doesn't bloat
  the BPMN bundle when unused. Card YAML fetched via
  /\${owner}/\${repo}/raw/branch/\${branch}/algorithms/\${name}.card.yaml
  parsed from window.location.pathname.

Frontend bundle rebuilt: web_src_js_features_diagrams_bpmn_ts chunk
hash ffc5628b → 992a62c1 (7.8 KB → 11.7 KB; drawer code lazy-imported
via card.ts chunk f5f9df6d, unchanged). Deployed to
/data/gitea/public/assets/js/ as CUSTOM_PATH overrides; bindata in
the binary still has the older chunks until next image rebuild.
Adds a third per-repo surface alongside /mcp (knowledge) and /uapf-ip
(descriptor): /{owner}/{repo}/uapf-mcp exposes the repo as a RUNNABLE UAPF
package. An agent (e.g. Copilot Studio) connects here and gets execution tools
(start_session, execute_process, evaluate_decision, get_session, get_audit,
abort_session, list_algorithms, get_algorithm_card) that ProcessGit delegates
to the UAPF engine via the embedded github.com/UAPFormat/uapf-mcp-go module.

- routers/web/repo/uapfmcp.go: UAPFMCPEndpoint. Resolves the package live from
  the repo's uapf.yaml on each connection (mirrors uapfip.go's manifest read),
  builds a pkgsource.Package + hostManifest from requires_capabilities, and
  forwards MCP traffic to the engine. ProcessGit terminates MCP and delegates;
  it does not hold sessions or evaluate decisions (runtime stays the engine).
- routers/web/web.go: register /{username}/{reponame}/uapf-mcp (GET,POST,DELETE,
  OPTIONS) under optSignInIgnoreCsrf + RepoAssignment, mirroring /mcp.
- go.mod/go.sum: add github.com/UAPFormat/uapf-mcp-go v0.1.1.

Config via env (wired to bundled engine + LLM gateway in the release):
UAPF_ENGINE_URL, UAPF_HOST_BASE_URL, UAPF_HOST_DID, UAPF_ARCHIVE_BASE.
Additive + backward compatible: only answers for repos with a valid uapf.yaml.

Builds clean (go build ./routers/web/... in golang:1.25). Not yet wired into a
release bundle (engine+llm-gateway services) — that is deliverable B step 4.
…scope

deploy/docker-compose.uapf.example.yml wires the new scope:
- processgit env: UAPF_ENGINE_URL (http://uapf-engine:4000), UAPF_ARCHIVE_BASE
  (http://processgit:3000, internal — no public egress), UAPF_HOST_DID,
  UAPF_HOST_BASE_URL (capability host / LLM gateway).
- uapf-engine service under profile 'bundled-engine' for fresh installs;
  omitted on hosts that already provide an engine on the network (Kojusalas:
  the opendms stack already serves 'uapf-engine' on deploy_default, verified
  reachable from the processgit container at :4000/health).
- llm-gateway documented as a UAPF capability-host adapter
  (POST /uapf/host/capability/{ns}/{op}) — required only for ai.* packages.

Validated: docker compose -f docker-compose.yml -f docker-compose.uapf.example.yml
config merges cleanly (env applied; engine parses under --profile bundled-engine).
Does not modify the live deploy/docker-compose.yml or .env.
@rg4444 rg4444 merged commit 2b07cb5 into main Jun 3, 2026
8 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant