Parent: #333
Execution mode: implementation
Depends on: #337
Absorbs remaining useful scope from: #124 and the prompt/package portions of #121
Spec references: SPEC-0010 (Workforce Package — source resolution, immutable versions, derived revisions), SPEC-0011 (Provenance & Supply Chain), SPEC-0003 (authorization), SPEC-0005 (classification), SPEC-0008 (conformance)
Problem Statement
After Phase 3, Software Engineering will still be embedded in Forge's current database seeds, prompt files and coding-oriented assumptions. Forge cannot call Workforces plug-and-play if installing a Workforce means adding trusted executable code or editing Forge Core, nor if package prompts/policies can weaken system security ceilings.
The existing agent/workforce ontology work in #124 is now partially stale: ADR 0014 owns product-wide concepts, while ADR 0007 should survive as the Software Engineering package's role taxonomy.
Desired Outcome
Forge can inspect, install, enable, disable, update and remove versioned declarative Workforce packages without modifying Core source. Software Engineering is extracted into the first official package and passes the Phase-3 release gate unchanged.
A Workforce package may describe organisation and request capabilities; it cannot execute arbitrary installation/runtime code, carry credentials, redefine protected Operations, or weaken mandatory Forge/operator policy.
User Story
As the Forge operator,
I want Workforces to be installable and updatable like versioned capability-aware packages,
So that I can add specialized teams without turning third-party package content into trusted Forge code.
Requirements
A. Package format
Define one canonical versioned package/manifest contract containing at least:
- stable package id, display name, package version, schema version;
- compatible Forge version/range;
- role/agent definitions and display metadata;
- Workflow definitions and Work Package schemas;
- prompts/reference assets with content digests;
- required/optional Capability requests;
- supported Resource types;
- provider-neutral cognitive requirements;
- default budget profiles;
- additive package gate/evaluation definitions;
- dependencies with exact pinned version/source/digest;
- package provenance/source/digest;
- migration/update metadata where needed.
Unknown security-relevant fields fail closed. Package content is data, not code.
B. Trust boundary
A declarative package must never obtain authority merely by being parsed/installed.
- No arbitrary lifecycle/install hooks.
- No package-bundled credentials/secrets.
- No package-defined executable adapter code runs inside Core.
- Package Capability requests are maxima presented to policy/operator; Grants remain run-scoped and resource-scoped.
- Package gate/policy definitions may be stricter, never weaker than mandatory system/operator ceilings.
- Protected Operation definitions/risk classifications, secret allowlists, confinement rules and mandatory Gate semantics are not normal package-editable DB data.
- Dependency authority is the union of requested dependency capabilities and must be visible before activation.
C. Package source and lock model
Support local path and pinned Git source first. Resolve a source into an immutable installed revision plus lock/provenance data. Do not execute repository code during inspection/install.
Source resolution (per SPEC-0010 R5): Branch/tag references MUST be resolved to exact immutable commit SHAs before validation/activation. If the same packageId+version is observed with a different digest, treat it as a supply-chain version conflict — reject, do not silently replace. Derived/local revisions MUST carry explicit parent provenance and MUST NOT impersonate upstream versions.
Equivalent operator operations must exist for:
- inspect;
- install;
- list/status;
- permissions/capability review;
- enable/disable;
- update;
- remove;
- view provenance/diff.
CLI/UI spelling may follow existing Forge conventions.
D. Install/update transaction
Implement this semantic flow:
read/fetch source as data
-> validate schema and path/content bounds
-> calculate package + asset digests
-> resolve/pin dependencies
-> calculate effective requested capabilities/resources
-> show permission/provenance diff
-> operator/policy decision
-> persist immutable installed revision + lock
-> activate selected revision
Update permission expansion, including transitive dependency expansion, requires a fresh authority decision. Rollback activates a prior preserved revision; it does not rewrite history.
E. Runtime pinning
A Mission/Execution pins Workforce package, Workflow, prompts, policy, schema and dependency revisions. Updating/removing a package may not mutate the meaning of an in-flight/historical run. If removal conflicts with pinned live Missions, fail or stage removal according to explicit policy.
F. Local operator customization
Editing a packaged Workforce creates an explicit derived/local revision with parent provenance and diff. It never mutates or impersonates the upstream package identity. Reset/rebase/update flows must preserve operator intent explicitly.
G. Software Engineering extraction
Create the official Software Engineering package from the Phase-3 proven configuration. Move coding-specific role/workflow/prompt/package policy out of generic Core where possible.
Core may understand generic Mission/Workflow/Agent Run/Operation/Resource/Grant/Gate contracts; it should not require special branches for Architect, Frontend, QA, Git or PR lifecycle to support another Workforce.
H. Reviewer contract
Port the useful reviewed behavior from stale branch codex/reviewer-scope-controls into the official package rather than merging that stale branch:
- merge-gate review is scoped to the approved change/criteria;
- a blocking finding is causally introduced/exposed/materially worsened by the current change;
- adjacent pre-existing findings become separate operator-triaged issues;
- rework handoffs contain only blocking findings;
- Reviewer is read-only and produces evidence, never authority;
- review inspection/model budget is bounded by policy, not an endlessly expanding repo audit.
The repository-wide orthogonal audit skill may remain broad when explicitly invoked for a repo audit; package merge-gate review should be change-scoped.
I. Prompt/default migration
Absorb only the still-valid #124/#121 work:
- runtime-neutral package defaults rather than
.codex/agents as product truth;
- editable prompts as versioned package/local-derived data;
- preserve user customizations during upgrades;
- show default-vs-derived provenance;
- do not make security-critical authority semantics normal editable prompt/config records.
Implementation Sequence
- Manifest/schema + hostile fixtures — no installer side effects.
- Content/provenance/lock resolver — bounded local/Git source reads and dependency graph.
- Permission/effective-capability calculator — dependency expansion, mandatory ceiling tests.
- Immutable package revision persistence — install/enable/disable/remove/rollback state.
- Update transaction + permission diff — no silent authority expansion.
- Runtime package pinning — Mission/Execution evidence references immutable revisions.
- Local-derived revision flow — prompt/workflow customization with provenance.
- Software Engineering package extraction — roles/prompts/workflow/gates; preserve Phase-3 behavior.
- Reviewer-scope contract — change-scoped package reviewer + tests preventing rework scope creep.
- Core special-case deletion pass — remove only coding-specific branches made redundant by the package; prove generic Core still supports release gate.
- Install/update/remove/rollback E2E — including running Mission pinned to old package.
Primary Code Seams To Inspect First
- current
agent_configs, workforces, workforce membership/seed code
.codex/agents / prompt seed/export paths
- Phase-3 Mission/Workflow/Work Package contracts
- Operation/Grant/Gate policy modules
- installer/CLI architecture
- package/workforce UI/API
- review prompt/handoff/skill integration
Orthogonal Checkpoints
- Schema/provenance: malformed manifests, path traversal, hidden files, unsupported versions, content tampering.
- Authority: direct/transitive capability expansion, package attempt to weaken Gate/security policy, credential injection.
- Update/history: rollback, local edits, dependency changes, running Mission pinning, package removal races.
- Extraction: repository search for coding-only Core branches; Phase-3 release gate before/after extraction.
- Reviewer loop: malicious/overbroad findings, unrelated pre-existing defect, repeated rework and evidence authority.
- Final package gate: clean install -> run -> update -> pinned old run -> disable/remove -> reinstall/rollback with complete provenance.
Acceptance Criteria
Out of Scope
Implementation Scope
Very Large - package format/install/update/history plus flagship Workforce extraction, expected as 7-11 small PRs.
Technical Notes
Signatures/provenance answer “where did this content come from?”, not “is this safe?”. Executable capability adapters remain a separate reviewed trust boundary in Core/adapter runtime.
Parent: #333
Execution mode: implementation
Depends on: #337
Absorbs remaining useful scope from: #124 and the prompt/package portions of #121
Spec references: SPEC-0010 (Workforce Package — source resolution, immutable versions, derived revisions), SPEC-0011 (Provenance & Supply Chain), SPEC-0003 (authorization), SPEC-0005 (classification), SPEC-0008 (conformance)
Problem Statement
After Phase 3, Software Engineering will still be embedded in Forge's current database seeds, prompt files and coding-oriented assumptions. Forge cannot call Workforces plug-and-play if installing a Workforce means adding trusted executable code or editing Forge Core, nor if package prompts/policies can weaken system security ceilings.
The existing agent/workforce ontology work in #124 is now partially stale: ADR 0014 owns product-wide concepts, while ADR 0007 should survive as the Software Engineering package's role taxonomy.
Desired Outcome
Forge can inspect, install, enable, disable, update and remove versioned declarative Workforce packages without modifying Core source. Software Engineering is extracted into the first official package and passes the Phase-3 release gate unchanged.
A Workforce package may describe organisation and request capabilities; it cannot execute arbitrary installation/runtime code, carry credentials, redefine protected Operations, or weaken mandatory Forge/operator policy.
User Story
As the Forge operator,
I want Workforces to be installable and updatable like versioned capability-aware packages,
So that I can add specialized teams without turning third-party package content into trusted Forge code.
Requirements
A. Package format
Define one canonical versioned package/manifest contract containing at least:
Unknown security-relevant fields fail closed. Package content is data, not code.
B. Trust boundary
A declarative package must never obtain authority merely by being parsed/installed.
C. Package source and lock model
Support local path and pinned Git source first. Resolve a source into an immutable installed revision plus lock/provenance data. Do not execute repository code during inspection/install.
Source resolution (per SPEC-0010 R5): Branch/tag references MUST be resolved to exact immutable commit SHAs before validation/activation. If the same packageId+version is observed with a different digest, treat it as a supply-chain version conflict — reject, do not silently replace. Derived/local revisions MUST carry explicit parent provenance and MUST NOT impersonate upstream versions.
Equivalent operator operations must exist for:
CLI/UI spelling may follow existing Forge conventions.
D. Install/update transaction
Implement this semantic flow:
Update permission expansion, including transitive dependency expansion, requires a fresh authority decision. Rollback activates a prior preserved revision; it does not rewrite history.
E. Runtime pinning
A Mission/Execution pins Workforce package, Workflow, prompts, policy, schema and dependency revisions. Updating/removing a package may not mutate the meaning of an in-flight/historical run. If removal conflicts with pinned live Missions, fail or stage removal according to explicit policy.
F. Local operator customization
Editing a packaged Workforce creates an explicit derived/local revision with parent provenance and diff. It never mutates or impersonates the upstream package identity. Reset/rebase/update flows must preserve operator intent explicitly.
G. Software Engineering extraction
Create the official Software Engineering package from the Phase-3 proven configuration. Move coding-specific role/workflow/prompt/package policy out of generic Core where possible.
Core may understand generic Mission/Workflow/Agent Run/Operation/Resource/Grant/Gate contracts; it should not require special branches for
Architect,Frontend,QA, Git or PR lifecycle to support another Workforce.H. Reviewer contract
Port the useful reviewed behavior from stale branch
codex/reviewer-scope-controlsinto the official package rather than merging that stale branch:The repository-wide orthogonal audit skill may remain broad when explicitly invoked for a repo audit; package merge-gate review should be change-scoped.
I. Prompt/default migration
Absorb only the still-valid #124/#121 work:
.codex/agentsas product truth;Implementation Sequence
Primary Code Seams To Inspect First
agent_configs,workforces, workforce membership/seed code.codex/agents/ prompt seed/export pathsOrthogonal Checkpoints
Acceptance Criteria
Out of Scope
Implementation Scope
Very Large - package format/install/update/history plus flagship Workforce extraction, expected as 7-11 small PRs.
Technical Notes
Signatures/provenance answer “where did this content come from?”, not “is this safe?”. Executable capability adapters remain a separate reviewed trust boundary in Core/adapter runtime.