Skip to content

feat(cosh-ng): [gateway] add control plane - #2603

Draft
kongche-jbw wants to merge 14 commits into
alibaba:mainfrom
kongche-jbw:feat/cosh-ng/acp-phase1-p0
Draft

feat(cosh-ng): [gateway] add control plane#2603
kongche-jbw wants to merge 14 commits into
alibaba:mainfrom
kongche-jbw:feat/cosh-ng/acp-phase1-p0

Conversation

@kongche-jbw

@kongche-jbw kongche-jbw commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Why

This Draft turns the ACP Gateway architecture in #2498 into a reviewable local
control-plane slice. It deliberately keeps architecture review separate from
implementation review and does not claim universal Broker or production
acceptance.

What changed

  • Add a durable Task scheduler with Runtime leases, fencing, approvals,
    append-input, explicit retry, Outbox delivery, and crash recovery.
  • Add a checkpoint-only gateway-brokered-v1 Core profile whose typed
    execution flows through policy, approval, permit, audit, ws-ckpt, and a
    durable result dispatch.
  • Add storage schema v9, backup/restore, read-only inspection, bounded writers,
    SQLite fault evidence, and real process SIGKILL boundary tests.
  • Pin admitted local executables and workspaces, add systemd containment
    admission, and harden ACP v1 doctor/run conformance paths.
  • Add durable ws-ckpt mutation markers and fail-closed recovery after uncertain
    backend or index persistence.

The fourteen-commit stack keeps the foundation, entrypoints, storage,
supervision, baseline fixes, ws-ckpt durability, Gateway control plane, and
status documentation independently reviewable.

Related issue

Related architecture: #2498

no-issue: prepare the current Phase 1 implementation as a Draft review stack

User / Agent impact

cosh-gateway serve admits only the contained, checkpoint-only brokered Core
profile. ACP adapters remain explicit ungoverned doctor / run tooling and
must not be interpreted as COSH-governed execution.

Risk and compatibility

  • Public CLI, API, configuration, or documented behavior changed
  • Privileged or security-sensitive behavior changed
  • Cross-component contract changed
  • Migration or rollback guidance is needed

Runtime contracts advance to v4 and Gateway storage advances to v9. This Draft
is not ready to merge as a production Phase 1 release: exact candidate build,
real Codex/Claude and manual TTY validation, signed/offline adapter supply,
power-loss evidence, and universal Broker coverage remain open.

Rust 1.88 is the tested minimum for release compatibility. Development and
workspace Clippy use the current stable toolchain.

Validation

  • cargo metadata --locked --no-deps --format-version 1
  • cargo +stable clippy --workspace --all-targets -- -D warnings
  • cargo +1.88.0 build --workspace --release --locked
  • scripts/run-test-gates.sh integration
  • cargo test --locked -p cosh-types error::tests
  • cargo fmt --all -- --check
  • bash scripts/docs-lint.sh
  • python3 scripts/docs-link-check.py
  • git diff --check

Documentation and rollback

The bilingual Phase 0/1 design and acceptance reports explicitly distinguish
the accepted checkpoint-only slice from remaining stop conditions. Roll back
by reverting this fourteen-commit stack; schema backups can be verified and
restored to a new path before changing the active database.

@github-actions github-actions Bot added component:ckpt src/ws-ckpt component:cosh-ng src/cosh-ng scope:ci ./.github/ scope:documentation ./docs/|./*.md|./NOTICE scope:scripts ./scripts/ labels Aug 17, 2026
@kongche-jbw
kongche-jbw force-pushed the feat/cosh-ng/acp-phase1-p0 branch from a56c98b to ee9641a Compare August 17, 2026 06:02
- Add durable contracts, storage, capability admission, and ACP runtime.
- Set Rust 1.88 as tested minimum and use stable Clippy for development.
- Leave installed entrypoints and live-adapter acceptance for stacked work.

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- install a fixed-profile ACP gateway behind cosh agent
- bound prompt input and keep terminal and JSONL output safe
- package the gateway and pin component builds to Rust 1.88.0

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- present only correlated once-only choices on the local terminal
- persist redacted private evidence before replying to the adapter
- cancel on non-interactive, unsupported, or evidence-failure paths

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- pin Codex and Claude ACP adapter packages with an exact lockfile
- verify private-prefix installation and canonical package provenance
- add fake and explicit real-adapter conformance modes

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- persist approvals, single-use permits, executions, and receipts
- fence execution and Runtime events with authoritative Runs and leases
- recover started effects as uncertain without automatic retry

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- define one provider-neutral Runtime command and event boundary
- map ACP and private Core sessions through fenced COSH identities
- settle supervised children before publishing terminal outcomes

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- authenticate a private Unix control API with peer credentials
- persist installation-bound Task submission, paging, and cancellation
- expose installed serve and task clients with bilingual acceptance evidence

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- Budget cold adapter startup and enforce caller-after-actor deadlines.
- Preserve bounded terminal-safe diagnostics in conformance failures.
- Cover delayed session creation and invalid deadline configurations.

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- Preserve upper- and lower-case proxy variables across the cleared env.
- Keep dynamic-loader and Node execution injection variables filtered.
- Verify proxy credentials remain absent from debug representations.

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- Canonicalize every object before hashing extension identity projections.
- Keep fingerprints stable when serde_json preserve_order is enabled.

Fixes: b4fe5a7 ("feat(cosh-ng): [core,shell] add extension platform")
Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- Serialize executable-backed extension fixtures across concurrent tests.
- Drain malformed-output mocks and accept canonical JSON field order.
- Give zsh handoff state restoration time to settle under CI load.

Fixes: 0e8ca63 ("feat(cosh-ng): [core,shell] guard extension lifecycle")
Fixes: b4fe5a7 ("feat(cosh-ng): [core,shell] add extension platform")
Fixes: 901ae48 ("feat(cosh-ng): [shell] protect skill descriptions")
Fixes: 6964fd9 ("fix(cosh-ng): [shell] disable implicit pagers")

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- Authenticate brokered checkpoint requests and bind them to live workspaces.
- Journal mutating operations before backend effects and poison unknown state.
- Recover only through explicit reconciliation after uncertain persistence.

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- Add durable Task scheduling, approvals, input, retry, and execution ledgers.
- Run a checkpoint-only brokered Core profile with pinned local identities.
- Add bounded storage recovery, containment, packaging, and fault evidence.

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
- Align bilingual design and acceptance records with Runtime v4 and storage v9.
- Document the checkpoint-only governed profile and ungoverned ACP tooling.
- Keep production, real-provider, and universal-broker gaps explicitly open.

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
@kongche-jbw
kongche-jbw force-pushed the feat/cosh-ng/acp-phase1-p0 branch from ee9641a to e4880ad Compare August 17, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:ckpt src/ws-ckpt component:cosh-ng src/cosh-ng scope:ci ./.github/ scope:documentation ./docs/|./*.md|./NOTICE scope:scripts ./scripts/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant