Files
ruflo/.github/workflows/context-delegation.yml
T
rUv a3d45e64b9 feat(core): governed context delegation with reproducible benchmark proof (#4648)
* feat(core): add bounded context delegation with source-bound benchmark proof

* feat(core): add governed Messages adapter and durable resumable live pilot

* fix(benchmarks): isolate pilot fixtures and record bounded live timeout proof

* fix(context-delegation): review fixes — pilot env allowlist, hash-before-import, real policy root; ADR-521

- subscription-pilot: the spawned claude gets an allowlisted environment
  (PATH, HOME, locale, XDG, CLAUDE_CONFIG_DIR, plus names in
  RUFLO_PILOT_CHILD_ENV_PASS) instead of the whole shell; a GH_TOKEN
  canary test proves it. Policy is evaluated for process.cwd(), not a
  hardcoded /home/ruv.
- provider-pilot: the --runtime entry and policy runtime are contained
  and hashed before they are imported.
- ADR renumbered 520 -> 521 (520 is agentdb episode CRUD on main).
- Evidence regenerated for the new snapshot (9301fbfd…, Node 24): 300/300
  quotes, coordinator bytes -97.56%, total boundary +3.83%; verify.mjs ok.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(context-delegation): honour --worker-available through the CLI parser; scope evidence hashes to owned files

- context-plan read only f['worker-available'], but the parser camelCases
  flags, so the documented command always planned 'worker-unavailable'.
  Accept both spellings; new test drives the real CommandParser (fails
  without the fix).
- results.json no longer hashes hooks.ts, index.ts and global-ai-budget.ts.
  Those files change in unrelated PRs, which would have failed
  verify.mjs on the next one. Evidence regenerated (20491e6e…, 14 hashes),
  163/163 tests, verify ok.

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(release): 3.70.0

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-01 14:13:37 -05:00

49 lines
2.3 KiB
YAML

name: Bounded context delegation contracts
on:
pull_request:
paths:
- 'v3/@claude-flow/cli/src/services/context-delegation.ts'
- 'v3/@claude-flow/cli/src/services/anthropic-context-adapter.ts'
- 'v3/@claude-flow/cli/src/services/global-ai-budget.ts'
- 'v3/@claude-flow/cli/__tests__/anthropic-context-adapter.test.ts'
- 'v3/@claude-flow/cli/__tests__/context-provider-pilot.test.ts'
- 'v3/@claude-flow/cli/__tests__/context-subscription-pilot.test.ts'
- 'v3/@claude-flow/cli/src/commands/context-plan.ts'
- 'v3/@claude-flow/cli/src/commands/hooks.ts'
- 'v3/@claude-flow/cli/src/index.ts'
- 'v3/@claude-flow/cli/__tests__/context-delegation.test.ts'
- 'v3/@claude-flow/cli/tsconfig.context-delegation.json'
- 'v3/@claude-flow/cli/benchmarks/context-delegation/**'
- '.github/workflows/context-delegation.yml'
permissions:
contents: read
jobs:
contracts:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: npm
- run: npm ci --ignore-scripts --legacy-peer-deps
- run: node_modules/.bin/tsc -p v3/@claude-flow/cli/tsconfig.context-delegation.json
- run: ../../../node_modules/.bin/vitest run __tests__/context-delegation.test.ts __tests__/anthropic-context-adapter.test.ts __tests__/context-provider-pilot.test.ts __tests__/context-subscription-pilot.test.ts
working-directory: v3/@claude-flow/cli
- name: Provider pilot preflight (zero network)
run: node v3/@claude-flow/cli/benchmarks/context-delegation/provider-pilot.mjs
- name: Verify committed source-bound evidence
run: node v3/@claude-flow/cli/benchmarks/context-delegation/verify.mjs
- name: Reproduce deterministic before and after benchmark
run: |
node v3/@claude-flow/cli/benchmarks/context-delegation/run.mjs /tmp/context-delegation-results.json
node v3/@claude-flow/cli/benchmarks/context-delegation/verify.mjs /tmp/context-delegation-results.json
- uses: actions/upload-artifact@v4
with:
name: context-delegation-results
path: /tmp/context-delegation-results.json