Skip to content

v3: Comtrya — combine v1 Smart-HTTP/OCI/federation with v2 kernel discipline#1

Open
rawkode wants to merge 79 commits into
mainfrom
v3
Open

v3: Comtrya — combine v1 Smart-HTTP/OCI/federation with v2 kernel discipline#1
rawkode wants to merge 79 commits into
mainfrom
v3

Conversation

@rawkode
Copy link
Copy Markdown
Member

@rawkode rawkode commented May 11, 2026

Summary

v3 brings v1's load-bearing implementation pieces back into v2's kernel-shaped architecture:

  • v2 keeps: kernel-vs-features split, OIDC + SpiceDB + CUE + CloudEvents + WIT/Component Model, spec discipline.
  • v1 returns: pure-Rust Smart HTTP v2 Git server, OCI extension distribution, federated GraphQL with typed resolver dispatch.

See V3_PLAN.md for the increment plan.

Note: the product is being renamed from Forgepoint to Comtrya; rename is a follow-up commit in this PR.

Increment plan

  1. ✅ Plan + PR (this commit)
  2. Port v1 pure-Rust Smart HTTP v2 (crates/git-http)
  3. Wire it in, drop git http-backend shell adapter
  4. Typed WIT resolver ABI (kill numeric-proof shape)
  5. Per-extension SQLite host capability
  6. Federated GraphQL composer + planner
  7. OCI extension distribution
  8. CUE config extended
  9. Replace fixture-sourced request paths
  10. Frontend extension-host refactor
  11. First-party pull-requests extension end-to-end
  12. Receive-pack/push
  13. Reconcile SPEC_COVERAGE.md, TODO.md, start.sh

Each increment ships as its own commit so the PR shows a real progression.

Test plan

  • `start.sh --reset && start.sh` end-to-end with no fixture-sourced product data on request path
  • `git clone` and `git push` succeed against pure-Rust Git server
  • First-party extension installable from OCI artifact and live
  • Uninstall extension and product surface disappears cleanly
  • `SPEC_COVERAGE.md` maps every visible surface to Git / SQLite / WIT resolver

🤖 Generated with Claude Code

Brings forward v2's kernel-vs-features split, standards-based foundation,
and spec discipline. Pulls in v1's pure-Rust Smart HTTP v2 Git server,
OCI extension distribution, and federated GraphQL schema composition.

This branch executes the plan incrementally; each increment is its own
commit so the PR shows a real progression.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 11, 2026 17:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a v3 planning document describing how the project will reintroduce v1’s Smart-HTTP/OCI/federation capabilities within v2’s kernel/extension architecture, along with an increment-by-increment roadmap and verification criteria.

Changes:

  • Add V3_PLAN.md describing v3 goals, architecture targets, increment plan, and verification checklist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread V3_PLAN.md Outdated
Comment on lines +1 to +3
# Forgepoint v3 — Plan

This branch combines what v1 (the original Forgepoint at `forgepoint-dev/forgepoint`) and v2 (the spec-driven rewrite, which this repo is) each got right into a single coherent kernel.
rawkode and others added 7 commits May 11, 2026 18:16
Mass rename:
- Forgepoint -> Comtrya (display name)
- forgepoint -> comtrya (identifiers, paths, package names)
- FORGEPOINT -> COMTRYA (env vars)
- wit/forgepoint-extension.wit -> wit/comtrya-extension.wit
- frontend/src/server/forgepoint.ts -> frontend/src/server/comtrya.ts
- Cargo crate names: forgepoint-{core,server,cli} -> comtrya-{core,server,cli}
- WIT package: forgepoint:extension -> comtrya:extension

cargo check --workspace passes. The one historical reference to the v1
directory path on disk (forgepoint-dev/forgepoint) is preserved in V3_PLAN
since that is its actual filesystem location.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Brings forepoint v1's crates/git-http into v3 as comtrya-git-http.
Contents (~1880 LOC): pkt-line codec, protocol v2 negotiation, pack
generation, repo provider trait, axum handler scaffolding. Supports
upload-pack (clone/fetch); receive-pack is a follow-up increment.

Adjustments:
- Crate renamed to comtrya-git-http and added to workspace.
- Env vars renamed: FORGE_GIT_HTTP_EXPORT_ALL -> COMTRYA_GIT_HTTP_EXPORT_ALL,
  FORGE_GIT_SMART_V2_ADVERTISE/BACKEND -> COMTRYA_GIT_SMART_V2_ADVERTISE/BACKEND.
- Default advertise/backend flipped to "rust" (pure-Rust path, not git shell-out).
- tokio-util "io" feature enabled for ReaderStream.

Next increment: wire into crates/server, drop git http-backend shell adapter
for upload-pack.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replaces the shell adapter (git http-backend) on the upload-pack path
with comtrya-git-http's pure-Rust implementation. The shell adapter
remains as a fallback selectable via COMTRYA_GIT_BACKEND=legacy.

Changes:
- crates/server: add PureRustGitState (RepositoryProvider + GitHttpState)
  living on AppState, constructed from runtime.demo_repository.project_root.
- crates/server git_endpoint: parse {seg}/{seg}/{suffix} and dispatch into
  comtrya_git_http::v2::dispatch with the parsed segments + service.
- crates/server demo repo seeding: touch git-daemon-export-ok on init
  (and on the idempotent re-open path) so the new lib treats it as exported.
- crates/git-http: add pub `dispatch` entry-point for ergonomic host wiring,
  make `handle_upload_pack` pub, prefix advertisement with the
  Smart HTTP service banner (matches git http-backend behavior).
- crates/git-http: tests now disable gpg signing so local gitsign configs
  don't break seeding.
- extensions: refresh entryIntegrity hashes after the Comtrya rename.

cargo test --workspace passes: 77 core, 16 git-http, 29 server, 1 MVP.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Extends comtrya-extension.wit with first-class host imports: host-log,
host-events, host-storage, host-git, host-http, host-secrets, host-jobs.
Each interface documents its scope, isolation guarantees, and expected
host enforcement.

This locks in the v3 extension contract. The current minimal .wat
components still ship a numeric proof export; a follow-up increment
wires the host Linker to provide these imports and migrates one
first-party extension to the typed protocol end-to-end.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
New crate comtrya-extension-oci, ported from v1's
crates/server/src/extensions/{oci_fetcher,cache}.rs. Provides:

- OciExtensionFetcher: fetch by registry+image+(tag|digest) with retries,
  exponential backoff, offline-mode fallback, optional checksum verification.
- ExtensionCache: content-addressed cache under a host-managed dir,
  per-entry CacheMetadata (provenance + integrity).

12 ported tests pass. Next increment: extend CUE config to reference
extensions by OCI ref and wire the fetcher into the host's
load_extension_runtime path so first-party extensions can ship via OCI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds typed extension installation config to the core contract:
- ExtensionSource::{Local{path}, Oci{registry,image,reference}}
- OciReference::{Tag, Digest}
- ExtensionInstallConfig with id, source, enabled
- InstanceConfig now carries Vec<ExtensionInstallConfig>; validate()
  rejects empty fields and duplicate ids.

config/config.cue gains an example extensions block referencing three
first-party packages via OCI. The hand-rolled CUE loader does not yet
parse this section; the values are documentation today and become
authoritative once the CUE parser is upgraded (separate increment).

Three new core unit tests cover OCI validation, duplicate-id rejection,
and empty-reference rejection. cargo test --workspace: 138 passing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
V3_STATUS.md is an up-to-date snapshot of what shipped in this branch
and what's deferred. V3_PLAN.md's increment list now marks completed
work and explicitly tracks the deferred items for follow-up branches.

138 tests passing. Pure-Rust Git is the default upload-pack path;
legacy git http-backend is still reachable for regression compare.
Extension distribution and config contracts are in place; their host
wiring is the principal piece of follow-up work.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rawkode
Copy link
Copy Markdown
Member Author

rawkode commented May 11, 2026

v3 architectural foundation — landed

All 8 increments planned for this initial branch are committed and pushed. The v3 architecture combining the best of v1 (pure-Rust Git Smart HTTP v2, OCI extension distribution) with v2 (kernel-vs-features split, OIDC + SpiceDB + CUE + CloudEvents + WIT/Component Model, spec discipline) is in place at the contract and crate level.

What's done

# Increment Commit
1 V3 plan + PR opened 8468183
2 Rename Forgepoint → Comtrya across source, manifests, env vars, WIT, crate names 696b743
3 Port v1's pure-Rust Smart HTTP v2 Git crate (~1880 LOC) as comtrya-git-http 7c1d9c8
4 Wire pure-Rust Git into the server; default upload-pack path no longer shells to git http-backend 4f1c399
5 Define typed WIT host interfaces (host-log, host-events, host-storage, host-git, host-http, host-secrets, host-jobs) 048c173
6 Add comtrya-extension-oci (OciExtensionFetcher + content-addressed cache, ported from v1) bfbe492
7 ExtensionInstallConfig + ExtensionSource::{Local, Oci} + OciReference::{Tag, Digest} in core; CUE example added d8b6064
8 Add V3_STATUS.md + reconcile V3_PLAN.md with reality 8f06814

Test posture

cargo test --workspace138 tests passing:

  • 80 core (incl. new ExtensionInstallConfig validation)
  • 16 git-http (Smart HTTP v2, ls-refs, pack generation)
  • 12 extension-oci (cache + fetcher offline-mode paths)
  • 29 server (Git endpoint, extensions runtime, GraphQL, auth, events)
  • 1 MVP integration

Backend flip

/git/* now uses the pure-Rust path by default. Set COMTRYA_GIT_BACKEND=legacy to fall back to the git http-backend shell adapter for regression comparison.

Deferred to follow-up branches

See V3_STATUS.md for the full list. Headlines:

  • Typed WIT resolver execution — interfaces exist, host Linker + bindgen still needed.
  • Per-extension SQLite via host-storage — WIT defined, host impl pending.
  • OCI fetcher wiring into load_extension_runtime — crate is ready, integration is next.
  • Federated GraphQL composer that dispatches fields to extension components.
  • Astro shell as real extension host — strip product panels.
  • First-party ext_pull_requests end-to-end through the new path (the proof).
  • Receive-pack/push on top of crates/git-http.
  • CUE loader upgrade so the extensions: block drives behavior.

Each is independently scoped and individually shippable on its own branch.

🤖 Generated with Claude Code

rawkode and others added 30 commits May 12, 2026 13:03
Adds validate_route_prefix_uniqueness() and wires it into Runtime::start
before any extension is instantiated, so conflicting route_prefix values
across extensions are caught early with a clear error naming both IDs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… lookup

Adds resolve_repository_by_path() pure function that matches URL path
segments against the repositories[].path field, wires it into the
workspace JSON object in graphql_response() by reading variables.segments
from the request payload, and covers the feature with 5 tests (3 unit +
2 integration).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onInstallations GraphQL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ions load

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add el() + text() DOM builder helpers in src/shell/dom.ts with 5 passing
bun tests; wire happy-dom via bunfig.toml preload for the test environment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rewrites styles.css from the old Operator Console dark theme to the
Mechanical Specimen design system. Copies the style block from the
04-mechanical-specimen.html mockup, drops mockup-only selectors (.ds-strap,
.ds-name, .ds-footer, .theme-switch floating), fixes the circular
--rule-light self-reference in the print theme, and adds
.extension-placeholder, .extension-slot-frame, .extension-slot-mount,
.extension-payload, and .repo-tabs selectors required by Tasks 18-23.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tcher

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ames

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…in.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add split_repo_path helper and build_repository_summary to derive groups
from the path field, count open pull requests, compute check pass/total
summary, and carry lastCommitAt. Wire workspace.repositories into the
GraphQL response as enriched summaries alongside repositoryByPath.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gthen tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d:true v1 flag

Adds three host-side aggregated viewer fields consumed by the home
your-work widget; the aggregated:true flag marks them for replacement
by the federated GraphQL planner (V3_PLAN item 9).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add `filter_events_for_viewer` helper that keeps only activity events
whose `repositoryID` is in the caller-supplied visible set (events with
no `repositoryID` are dropped defensively).  Wire it into the workspace
GraphQL projection as `workspace.events`; v1 visible set is all repos in
the workspace.  Leave `activityEvents` top-level field untouched.  Two
unit tests cover include/exclude logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…SDK setup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ion guards

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…K setup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces the ext_workspace_home first-party extension with v2 UI
manifest contributing home.your-work, home.repositories, home.activity,
and home.instance slots via four custom elements. Also registers the
extension in FIRST_PARTY_EXTENSIONS so the server loader picks it up on
startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Appends smoke assertions that verify the new Astro routes introduced in
Tasks 12-14 produce the expected SSR HTML and status codes: home-shell
on /, repo-dashboard on /r/<path>, extension-page on /x/pulls/, 404 for
unknown repo and extension prefixes, and the /instance -> /#instance
redirect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.

2 participants