Skip to content

docs(explorations): add decentralized OSS forge architecture#19

Merged
crs48 merged 1 commit intomainfrom
opencode/decentralized-oss-forge-exploration
Apr 7, 2026
Merged

docs(explorations): add decentralized OSS forge architecture#19
crs48 merged 1 commit intomainfrom
opencode/decentralized-oss-forge-exploration

Conversation

@crs48
Copy link
Copy Markdown
Owner

@crs48 crs48 commented Apr 7, 2026

Summary

  • add exploration 0118 on architecting a decentralized GitHub or GitLab replacement on xNet
  • keep Git as the canonical code DAG while making xNet the canonical forge layer for issues, change requests, reviews, trust, and preservation
  • use the plugin and package marketplace as the first proof of concept for decentralized forge publishing, discovery, provenance, and revocation

Summary by CodeRabbit

  • Documentation
    • Added comprehensive exploration documentation on decentralized open-source forge architecture, covering architectural design models, canonical schemas for collaboration and trust, security frameworks with threat analysis, reference authority protection mechanisms, staged implementation roadmap, and validation criteria across security, reliability, and collaboration dimensions.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

Adds a new exploration documentation file describing an architectural approach for decentralizing a GitHub/GitLab-like open-source software forge on xNet, including multi-layer models, canonical schemas, security mechanisms, staged product phases, implementation details, and validation criteria.

Changes

Cohort / File(s) Summary
Decentralized Forge Architecture Documentation
docs/explorations/0118_[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md
Introduces comprehensive architectural exploration for xNet-native OSS forge with multi-layer design (Source, Collaboration, Trust, Preservation), canonical schemas (Repository, Issue, ChangeRequest, Review, etc.), security stack with signatures and attestations, staged product rollout phases, implementation checklists, and validation criteria.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A forge takes shape in decentralized dreams,
With xNet nodes flowing like digital streams,
Schemas and trust woven through every layer,
No single hub holds the developer's prayer!
Hop forward to federated futures so free. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(explorations): add decentralized OSS forge architecture' directly and concisely summarizes the main change: adding a new documentation page about decentralized OSS forge architecture.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch opencode/decentralized-oss-forge-exploration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Preview removed for PR #19.

github-actions bot added a commit that referenced this pull request Apr 7, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
docs/explorations/0118_[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md (3)

637-643: Consider specifying the provenance attestation format.

The document references "provenance attestations" in multiple places (security stack, marketplace architecture, schema list, implementation checklist) but doesn't specify the format. For a production implementation, consider specifying:

  • Format: SLSA Provenance, in-toto attestations, DSSE envelopes, or custom xNet-native schema?
  • Required fields: build environment, source materials, build command, timestamps
  • Verification model: who validates provenance claims, what trust roots

This would help ensure compatibility with existing supply-chain security tooling (e.g., SLSA verifiers, Sigstore policy controllers) and avoid creating an isolated ecosystem.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/explorations/0118_`[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md
around lines 637 - 643, The document mentions "provenance attestations" in the
security stack, marketplace architecture, schema list, and implementation
checklist but doesn't define a concrete format; update those sections to specify
a chosen provenance attestation format (e.g., SLSA Provenance, in-toto, or DSSE)
and define required fields (build environment, source materials/commit hashes,
builder identity, build command, timestamps, artifact hashes) plus a
verification model (trusted validators, trust roots, and verification steps
compatible with SLSA/Sigstore verifiers); ensure the selected format and
required fields are referenced consistently in the security stack, marketplace
architecture, schema list, and implementation checklist so tooling and
verification expectations are unambiguous.

974-982: Consider promoting reputation/anti-gaming from "Open Questions" to the main security model.

Open question 6 asks: "How should stars, follows, downloads, and reputation be modeled without making them easy to game?"

This is closely related to the "fake popularity and trust signals" threat (line 604) and spam/abuse concerns. Given its importance for discovery, trust decisions, and forge UX, consider:

  • Moving this from open questions into the security model section (lines 588-665)
  • Proposing specific anti-gaming mechanisms (e.g., requiring verified identities for votes, time-weighted reputation, hub-specific vs. global metrics)
  • Linking it to the broader anti-abuse architecture

This would strengthen the security model and provide clearer guidance for implementation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/explorations/0118_`[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md
around lines 974 - 982, The reviewer asks to promote Open Question 6 ("How
should stars, follows, downloads, and reputation be modeled without making them
easy to game?") from the "Open Questions" list into the main "Security model"
section and add concrete anti-gaming proposals; update the document by moving
that bullet from the "Open Questions" section into the "Security model" block
(refer to the "Open Questions" header and the "fake popularity and trust
signals" threat in the security model), and within the security model add
specific mitigations such as verified-identity gating for votes, time-weighted
reputation decay, hub-scoped vs global metrics, rate-limits/behavioral anomaly
detection, and explicit links tying these mechanisms to the broader anti-abuse
architecture described earlier so implementers have clear, actionable guidance.

290-387: Consider adding a fork/derivative repository model to the schema set.

The proposed schemas comprehensively cover core forge functionality. However, one notable omission is a model for repository forks and their relationship to parent repositories. In a decentralized forge, forks are particularly important because:

  • They represent legitimate derivative work with different maintainers
  • They need to be discoverable relative to the parent
  • They may have different mirror/preservation policies
  • Cross-fork change requests (the common open-source contribution pattern) need to reference both repos

Consider adding schemas like RepositoryFork or extending Repository with optional parent/fork relationships.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/explorations/0118_`[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md
around lines 290 - 387, Add explicit fork/derivative modeling to the canonical
schemas: introduce a RepositoryFork schema (or extend Repository) to capture
parent/fork relationships and discovery/preservation metadata, e.g., fields like
parentRepoId or forkedFrom, forkOwner, forkPolicy, and mirror/preservation
overrides; update ChangeRequest/Patchset to allow cross-repo references
(sourceRepoId and targetRepoId) so cross-fork contributions are first-class;
ensure the Relationship model and classDiagram include Repository <->
RepositoryFork (or Repository self-reference) and that
RepositoryMirror/Release/PackageVersion can reference fork-specific policies.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@docs/explorations/0118_`[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md:
- Around line 388-433: The RefWitness spec lacks conflict-resolution rules for
when multiple RefWitness nodes for the same Repository + ref name disagree on
target OID; update the main security model to (1) extend Repository to include
signature_threshold and delegate quorum semantics (M-of-N) so RefWitness
validation requires threshold signatures, (2) augment RefWitness with signed
timestamp and policy_version and document timestamp-based ordering plus a
configurable grace/reconciliation window, (3) define client verification
policies (reject-on-conflict, wait-for-quorum, delegate-preference rules) and
(4) add explicit conflict detection, alerting, and reconciliation behavior for
hub indexers to surface and resolve conflicting RefWitnesses. Ensure these
additions replace the current note in open questions and are referenced from the
RefWitness and Repository definitions.
- Around line 588-665: Add "abuse and spam" threats to the "The main threat
classes" table under the "Security Model" (include rows for issue/comment spam,
repository spam/typosquatting, review bombing, and resource exhaustion) and
update the "Recommended security architecture" mermaid diagram and nearby prose
to include explicit anti-abuse components: "Node-level moderation
(revocation/blocklist schemas)", "Hub-level filtering and federation policies",
"Client-side filtering based on trust signals", "Resource limits
(blob/repo/issue quotas)", and "Proof-of-work or reputation gates for new
publishers"; place these additions near the existing stack items in the
"Recommended security stack" so they map to source authenticity, merge/ref
authority, release provenance, and client update safety.

---

Nitpick comments:
In
`@docs/explorations/0118_`[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md:
- Around line 637-643: The document mentions "provenance attestations" in the
security stack, marketplace architecture, schema list, and implementation
checklist but doesn't define a concrete format; update those sections to specify
a chosen provenance attestation format (e.g., SLSA Provenance, in-toto, or DSSE)
and define required fields (build environment, source materials/commit hashes,
builder identity, build command, timestamps, artifact hashes) plus a
verification model (trusted validators, trust roots, and verification steps
compatible with SLSA/Sigstore verifiers); ensure the selected format and
required fields are referenced consistently in the security stack, marketplace
architecture, schema list, and implementation checklist so tooling and
verification expectations are unambiguous.
- Around line 974-982: The reviewer asks to promote Open Question 6 ("How should
stars, follows, downloads, and reputation be modeled without making them easy to
game?") from the "Open Questions" list into the main "Security model" section
and add concrete anti-gaming proposals; update the document by moving that
bullet from the "Open Questions" section into the "Security model" block (refer
to the "Open Questions" header and the "fake popularity and trust signals"
threat in the security model), and within the security model add specific
mitigations such as verified-identity gating for votes, time-weighted reputation
decay, hub-scoped vs global metrics, rate-limits/behavioral anomaly detection,
and explicit links tying these mechanisms to the broader anti-abuse architecture
described earlier so implementers have clear, actionable guidance.
- Around line 290-387: Add explicit fork/derivative modeling to the canonical
schemas: introduce a RepositoryFork schema (or extend Repository) to capture
parent/fork relationships and discovery/preservation metadata, e.g., fields like
parentRepoId or forkedFrom, forkOwner, forkPolicy, and mirror/preservation
overrides; update ChangeRequest/Patchset to allow cross-repo references
(sourceRepoId and targetRepoId) so cross-fork contributions are first-class;
ensure the Relationship model and classDiagram include Repository <->
RepositoryFork (or Repository self-reference) and that
RepositoryMirror/Release/PackageVersion can reference fork-specific policies.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 258dc3e9-0b34-4ef8-bd95-60851fa65224

📥 Commits

Reviewing files that changed from the base of the PR and between 1134447 and 251d0fe.

📒 Files selected for processing (1)
  • docs/explorations/0118_[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md

Comment on lines +388 to +433
## Repository Identity And Ref Authority

Source objects are immutable. Refs are not.

That makes refs the actual attack surface.

### Core rule

**Git objects carry integrity. Forge policy must protect refs.**

### Recommended repository model

`Repository` should define:

- canonical Git URL set
- default branch
- delegates or maintainers
- signature threshold for canonical ref decisions
- mirror and archive policy
- package and release policy

### Recommended ref protection model

`RefWitness` nodes should record:

- repository identity
- branch or tag name
- target object ID
- who attested it
- what policy version was in force
- when it became canonical

This lets xNet separate:

- what Git content exists
- what ref state the community or maintainer set considers canonical

### Why this is valuable

If a mirror is compromised or a host lies about branch state, clients can compare:

- Git content
- signed canonical ref witness nodes

That is much stronger than trusting a forge database row.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

The RefWitness model needs conflict resolution mechanisms.

The RefWitness approach to protecting refs is architecturally sound, but a critical piece is underspecified: what happens when multiple RefWitness nodes for the same repository and ref name disagree about the target OID?

In a decentralized system, this can happen due to:

  • Compromised maintainer keys
  • Network partitions during concurrent updates
  • Malicious mirrors publishing conflicting witnesses
  • Legitimate maintainer disputes

The document mentions this tangentially in the open questions (line 976) but doesn't propose resolution mechanisms. Consider adding:

  1. Threshold signature requirements for repos with multiple maintainers (M-of-N delegates must sign)
  2. Timestamp-based ordering with a grace period for reconciliation
  3. Client verification policies (e.g., reject if witnesses conflict, wait for quorum, prefer specific trusted delegates)
  4. Explicit conflict detection and alerting in hub indexing

This is architecturally significant enough to deserve treatment in the main security model section rather than being left as an open question.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/explorations/0118_`[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md
around lines 388 - 433, The RefWitness spec lacks conflict-resolution rules for
when multiple RefWitness nodes for the same Repository + ref name disagree on
target OID; update the main security model to (1) extend Repository to include
signature_threshold and delegate quorum semantics (M-of-N) so RefWitness
validation requires threshold signatures, (2) augment RefWitness with signed
timestamp and policy_version and document timestamp-based ordering plus a
configurable grace/reconciliation window, (3) define client verification
policies (reject-on-conflict, wait-for-quorum, delegate-preference rules) and
(4) add explicit conflict detection, alerting, and reconciliation behavior for
hub indexers to surface and resolve conflicting RefWitnesses. Ensure these
additions replace the current note in open questions and are referenced from the
RefWitness and Repository definitions.

Comment on lines +588 to +665
## Security Model

Security is the real heart of the forge problem.

### The main threat classes

| Threat | Why it matters |
| --------------------------------- | ----------------------------------------------------------------- |
| ref spoofing | code integrity is useless if canonical branches can be lied about |
| maintainer key compromise | merge authority and releases become suspect |
| malicious mirror | can censor, delay, or serve stale refs and packages |
| package or plugin compromise | end users install attacker-controlled updates |
| artifact tampering | binaries differ from reviewed source |
| rollback and freeze attacks | users get old but valid-looking releases |
| namespace squatting | users install the wrong package or plugin |
| fake popularity and trust signals | stars/downloads can be gamed |

### Recommended security architecture

```mermaid
flowchart TD
A[Source commit and tag signatures] --> B[Build and release attestations]
B --> C[Transparency log]
C --> D[TUF-like update metadata]
D --> E[Client install and update policy]
F[Repository delegates and UCAN grants] --> G[RefWitness and merge authority]
G --> E
```

### Recommended security stack

#### 1. Source authenticity

Use one or more of:

- Git commit signatures
- signed tags
- Sigstore or Gitsign style identity-bound signatures

#### 2. Merge and ref authority

Use xNet nodes for:

- delegate roles
- branch protection
- merge policy
- signed ref witnesses

#### 3. Release and package provenance

Use:

- provenance attestations
- public transparency logs
- short-lived identity-based release signing where practical

#### 4. Client update safety

Use TUF-like signed metadata for:

- current targets
- freshness
- delegated package namespaces
- rollback resistance

### Important nuance

Git object hashes do **not** solve the whole supply chain problem.

They help with integrity of source objects, but they do not answer:

- who is allowed to publish releases
- whether a maintainer key was compromised
- whether a package index was rolled back
- whether an extension store should trust a plugin update

That is why the trust layer must be separate.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add anti-abuse and spam prevention to the security model.

The threat table covers supply-chain and integrity threats well, but a critical category is missing: abuse and spam. A decentralized forge will face:

  • Issue/comment spam (advertising, trolling, coordinated harassment)
  • Repository spam (typosquatting, SEO spam, malware distribution)
  • Review bombing (fake reviews, coordinated approval/rejection)
  • Resource exhaustion (massive repos, DoS via expensive operations)

Unlike centralized forges that can globally ban accounts and delete content, a decentralized system needs explicit mechanisms:

  1. Node-level moderation with revocation/blocklist schemas (partially covered for packages)
  2. Hub-level filtering and federation policies
  3. Client-side filtering based on trust signals
  4. Resource limits for blob storage, repo size, issue volume
  5. Proof-of-work or reputation gates for new publishers

Consider adding these to both the threat table and the recommended security architecture.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/explorations/0118_`[_]_ARCHITECTING_A_DECENTRALIZED_OSS_FORGE_ON_XNET.md
around lines 588 - 665, Add "abuse and spam" threats to the "The main threat
classes" table under the "Security Model" (include rows for issue/comment spam,
repository spam/typosquatting, review bombing, and resource exhaustion) and
update the "Recommended security architecture" mermaid diagram and nearby prose
to include explicit anti-abuse components: "Node-level moderation
(revocation/blocklist schemas)", "Hub-level filtering and federation policies",
"Client-side filtering based on trust signals", "Resource limits
(blob/repo/issue quotas)", and "Proof-of-work or reputation gates for new
publishers"; place these additions near the existing stack items in the
"Recommended security stack" so they map to source authenticity, merge/ref
authority, release provenance, and client update safety.

@crs48 crs48 merged commit 14261ff into main Apr 7, 2026
2 checks passed
@crs48 crs48 deleted the opencode/decentralized-oss-forge-exploration branch April 7, 2026 20:14
github-actions bot added a commit that referenced this pull request Apr 7, 2026
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