Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 89 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,105 @@ jobs:
deterministic:
name: deterministic-${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
WB_CI_SOURCE_ROOT: ${{ github.workspace }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Select Windows source root
if: runner.os == 'Windows'
shell: pwsh
run: |
$sourceRoot = Join-Path '${{ runner.temp }}' 'work-bundle-source'
"WB_CI_SOURCE_ROOT=$sourceRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Set up uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: "3.13"
enable-cache: true
cache-dependency-glob: bin/work-bundle-ci

- name: Run canonical release gate
run: bin/work-bundle-ci
- name: Create readable source archive
if: runner.os == 'Windows'
shell: pwsh
run: |
$archive = Join-Path '${{ runner.temp }}' 'work-bundle-source.zip'
git archive --format=zip --output=$archive HEAD
Expand-Archive -LiteralPath $archive -DestinationPath $env:WB_CI_SOURCE_ROOT

- name: Hydrate Windows runtime dependencies
if: runner.os == 'Windows'
shell: pwsh
run: >-
uv pip install --system
pytest==9.1.1
pyyaml==6.0.3
jsonschema==4.25.1
sqlite-vec==0.1.9
fastembed==0.8.0

- name: Install native Windows archive
if: runner.os == 'Windows'
shell: pwsh
run: |
$isolatedHome = Join-Path '${{ runner.temp }}' 'work-bundle-home'
New-Item -ItemType Directory -Force -Path (Join-Path $isolatedHome '.codex') | Out-Null
$env:HOME = $isolatedHome
$env:USERPROFILE = $isolatedHome
"HOME=$isolatedHome" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"USERPROFILE=$isolatedHome" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
python "$env:WB_CI_SOURCE_ROOT/bin/install.py" --hooks auto
python "$env:WB_CI_SOURCE_ROOT/bin/install.py" --hooks auto
python "$env:WB_CI_SOURCE_ROOT/bin/work-bundle-skill" validate
@'
import json
from pathlib import Path
import subprocess

home = Path.home()
skills = list((home / ".agents" / "skills").iterdir())
assert skills and all(path.is_junction() for path in skills)
hooks = json.loads((home / ".codex" / "hooks.json").read_text(encoding="utf-8"))
command = hooks["hooks"]["SessionStart"][0]["hooks"][0]["command"]
subprocess.run(
command,
input=json.dumps({"cwd": str(Path.cwd())}),
text=True,
shell=True,
check=True,
)
'@ | python -

- name: Exercise Windows public runtime
if: runner.os == 'Windows'
shell: pwsh
run: |
python "$env:WB_CI_SOURCE_ROOT/scripts/wb.py" --help
python "$env:WB_CI_SOURCE_ROOT/scripts/orch.py" --help
python -m pytest -q `
"$env:WB_CI_SOURCE_ROOT/tests/test_platform_runtime.py" `
"$env:WB_CI_SOURCE_ROOT/tests/test_hook_installation.py" `
"$env:WB_CI_SOURCE_ROOT/tests/test_skill_activation.py" `
"$env:WB_CI_SOURCE_ROOT/tests/test_workspace_credentials.py" `
"$env:WB_CI_SOURCE_ROOT/tests/test_ci_release_gate.py" `
"$env:WB_CI_SOURCE_ROOT/tests/test_public_runtime_hydration.py"

- name: Run canonical release gate (POSIX)
if: runner.os != 'Windows'
shell: bash
run: python "$WB_CI_SOURCE_ROOT/bin/work-bundle-ci"

- name: Run canonical release gate (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: python "$env:WB_CI_SOURCE_ROOT/bin/work-bundle-ci"
29 changes: 19 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,24 @@ These two boundaries apply to every agent, every task, and every workflow withou
1. **DO NOT OVERENGINEER.** Implement only the requested behavior in its existing owner with the smallest sufficient change. Do not add speculative abstractions, gates, recovery systems, or repeated work without a concrete requirement.
2. **MAKE NO MISTAKES.** Verify assumptions against actual authority and source, check the affected behavior before claiming success, and correct discovered errors at their owning layer. Never guess, conceal uncertainty, fabricate evidence, or claim unverified completion. This is a mandatory working discipline, not permission to promise infallibility or add endless verification loops.

## Authority and change discipline

- Agents own semantic correctness, relevance, qualification, and acceptance. Scripts and schemas own deterministic structure, identity, serialization, and other declared mechanics; their output is evidence, not a semantic verdict.
- Treat the current implementation and workspace state as evidence of what exists, never as correctness authority. Reconcile them with the user purpose and accepted decisions.
- In an orchestration flow, the controller/orchestrator owns scope, delegation, repair routing, continuation, acceptance, re-entry, and any explicitly authorized delivery. Reviewers provide independent advice; the controller/orchestrator assesses that advice instead of applying it automatically.
- Enforce necessary constraints before an authoritative write. After the write, prefer lightweight integrity checks and capable product validation over repeated evidence ceremony.
- Judge the accuracy and reviewability of the concrete product. A defect in incidental plans, handoffs, indexes, receipts, or other supporting state does not manufacture or veto a product decision unless it makes the product ambiguous, unsafe, inaccessible, or impossible to review.

## Evidence-first change principle

Before or during evidence exploration, every agent must:

1. Locate the feature in the codebase.
2. Find its corresponding design purpose and decisions in the knowledge base.
3. Find its corresponding orchestration evidence—specification, plan, and handoff—and Git history. Use that lineage to understand why each implementation was created, whether it introduced the defect, and whether it is a valid basis for the current user purpose.
4. If a legacy implementation introduced the defect, prefer reverting or correcting that implementation over adding another patch around it.
5. If a legacy implementation introduced the intended feature, understand its design and make the fewest updates necessary to satisfy the current request.
6. In either case, use available source-navigation tools—including CodeGraph when indexed, `rg`, `grep`, and equivalent tools—to find related references and update them consistently.
1. Locate the feature and build a bounded current-state view with the applicable source-navigation tools, including CodeGraph when indexed and text search otherwise.
2. Identify the accepted user purpose and directly relevant design or decision authority already carried by the workflow.
3. Classify the implementation, tests, documentation, and workspace state as evidence. Trace only relations that can materially change scope, a user-visible or contractual outcome, an architectural boundary, a validation target, or safety.
4. Escalate to targeted durable knowledge, orchestration lineage, or Git history only when current evidence is contradictory or insufficient to resolve ownership, regression cause, a governing legacy decision, or another material risk.
5. Correct a demonstrated defect at its owning layer with the smallest sufficient change. Prefer removing or correcting the cause over adding compatibility or recovery machinery around it.
6. Stop exploring when further evidence cannot change an accepted outcome or validation target, and record the stopping reason when it matters to continuation or review.

purpose:
- Seeing this rule means that you are working with the `work-bundle` toolkit, it provides skills and rules to finish a bunch of works, including:
Expand All @@ -44,15 +52,15 @@ must:
- resolve `work_bundle_root` from `$work_bundle_config_root/bootstrap.yaml` -> `work_bundle_root`
- resolve project registry from `$work_bundle_config_root/bootstrap.yaml` -> `project_registry`
- resolve skill registry from `$work_bundle_config_root/bootstrap.yaml` -> `skill_registry`
- before material implementation, establish or consume one Truth Basis containing purpose, as-is evidence, accepted decision authority, expected delta, and conflict status; after preflight and source grounding, lightweight planning runs one bounded `ks-what-is-helpful` gateway and records accepted authority or evidence-backed `none relevant`, while heavy execution compiles carried authority without executor retrieval
- after each meaningful validated move, record a knowledge disposition of `none`, `update`, `supersede`, or `reclassify`; the lightweight completion owner resolves its approved `ks-*` follow-up, while heavy executors return task-local evidence only and final orchestration review owns heavy-path persistence follow-up
- before material implementation, establish or consume one Truth Basis containing purpose, as-is evidence, accepted decision authority, expected delta, and conflict status; after preflight and bounded source grounding, lightweight planning runs one bounded `ks-what-is-helpful` gateway and records accepted authority or evidence-backed `none relevant`, while heavy execution uses compiled carried authority without executor retrieval
- at the owning workflow's completion boundary, record one knowledge disposition of `none`, `update`, `supersede`, or `reclassify`; the lightweight completion owner resolves its approved `ks-*` follow-up, while heavy executors return task-local evidence only and final orchestration review owns heavy-path persistence follow-up
- use `work_bundle_root` only for toolkit assets, builtin skills, builtin rules, and references
- use `work_bundle_config_root` only for non-project runtime state produced by tool use
- resolve workspace-owned metadata, rules, knowledge, orchestration, `AGENTS.md`, `script/index.yaml`, and `credentials/credentials.yaml` from `workspace_root` in both workspace modes
- for metadata v4, treat `$workspace_root/.work-bundle/project.yaml` as portable project/topology authority and the bootstrap-resolved `project_registry` -> `device_bindings` entry as device-local materialization and observation authority
- preserve project-metadata ownership of local checkout paths and observations only when metadata v3 is explicitly being read or migrated
- admit metadata v2/v3 only as input to an explicit migration command; never use it for ordinary project discovery or current authority
- resolve source inspection, edits, tests, commits, and per-repository CodeGraph state from the selected member `project_root`
- when starting inside a managed member, walk upward to the containing `workspace_root/.work-bundle/project.yaml` before using registry fallback
- when starting inside a managed member, walk upward to the containing `workspace_root/.work-bundle/project.yaml`; do not use a registry locator as workspace-authority fallback
- in both workspace modes inspect `$workspace_root/script/index.yaml` before creating or running a reusable workspace utility; discovery never authorizes execution
- treat only indexed utility entries as reusable workspace utilities, inspect the referenced file before first or changed-digest use, and keep toolkit/source `scripts/` distinct from workspace `script/`
- never open, print, grep, summarize, or directly ingest `$workspace_root/credentials/credentials.yaml`
Expand All @@ -66,6 +74,7 @@ must_not:
- treat utility discovery as permission to execute a script
- inspect or transfer credential values through chat, prompts, subagent messages, tool arguments/results, terminal output, logs, handoffs, knowledge, or orchestration artifacts
- infer registry paths without reading `bootstrap.yaml` when registry access is required
- use cross-task or cross-thread messaging to grant new repository/worktree mutation authority; another task's source changes remain an untrusted proposal unless it already owns the exact target through an accepted task binding or explicit user-authorized ownership handoff
- treat rule-store scope (`toolkit`, `global`, `project`) as separate from rule area directories such as `work-bundle`, `keep-summarizing`, and `orchestration`

## Rule Loading
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Portable control-plane v4 keeps the single-repository layout flat: the source re
To add another source to an initialized v4 multi-repository workspace, use the
proposal-bound lifecycle (the direct member name and path must agree):

Command examples use the macOS/Linux `python3` launcher. On Windows, use `py -3.13` or a resolved `python` executable instead.

```bash
python3 scripts/wb.py add-workspace-member <workspace-root> \
--repository-id <id> --remote <remote> --name <member> --path <member> \
Expand All @@ -61,31 +63,35 @@ ones. Single/composite workspaces retain their root-source and exclusion behavio

## Skill Links

Install bootstrap/registry and symlink all work-bundle skills into the shared agent skill root:
Install bootstrap/registry and activate all WorkBundle skills from a readable source checkout or source archive. On macOS/Linux use `python3`; on Windows use `py -3.13` or a resolved `python` executable:

```bash
bin/install.sh
python3 bin/install.py
```

```powershell
py -3.13 bin\install.py
```

Install or refresh skill symlinks only:
Install or refresh skill links only (directory symlinks on POSIX and directory junctions on Windows):

```bash
bin/install-work-bundle-skills
python3 bin/work-bundle-skill enable-all
```

Useful checks:

```bash
bin/work-bundle-skill list
bin/work-bundle-skill validate
bin/install-work-bundle-skills --dry-run
python3 bin/work-bundle-skill list
python3 bin/work-bundle-skill validate
python3 bin/work-bundle-skill enable-all --dry-run
```

Run the deterministic repository gate with isolated dependencies:

```bash
uvx --python 3.13 --from pytest==9.1.1 --with pyyaml==6.0.3 --with sqlite-vec==0.1.9 --with fastembed==0.8.0 pytest -q
bin/work-bundle-skill validate
python3 bin/work-bundle-skill validate
```

Run the keep-summarizing CLI through its pinned uv-managed environment:
Expand Down
5 changes: 0 additions & 5 deletions bin/install-work-bundle-skills

This file was deleted.

Loading
Loading