Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 3 additions & 6 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
},
"permissions": {
"allow": [
"Bash(uv run devops *)"
],
"deny": [
"Read(//**/.claude/settings.local.json)",
"Read(~/.claude/settings.json)",
"Read(~/.kube/**)"
"Bash(uv run devops *)",
"Bash(openspec *)",
"Bash(tuicr *)"
]
}
}

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/agent/tasks/task-1154-agent-session-prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Agent sessions require secure configuration, isolated credentials, and read-only
- [x] With `DEVOPS_CLI_AGENT_GRANT` set, a gateway 401 names the grant ID and says a person issues a new grant; without it, the hint is unchanged. Long grant IDs are capped at 256 characters.
- [x] `.claude/settings.json` denies `Read(//**/.claude/settings.local.json)`, `Read(~/.claude/settings.json)`, and `Read(~/.kube/**)`.
- [x] Unit and integration tests verify environment overrides, grant 401 hints, and settings file deny rules.
- Removed on 2026-10-22 by the person: the three `Read` deny rules and the test module that pinned them. The person wants agents to read the project folder and the kubeconfig. See the pull request that deletes `tests/test_claude_code_settings.py`.
- [x] `uv run devops docs check` passes with all generated documentation up to date.
- [x] `k8s/agents/` holds ServiceAccount `devops-agent` (automount off) and ClusterRoleBinding `devops-agent-view` to the built-in `view`.
- [x] Namespace `agents` is `restricted` and carries `Prune=false,Delete=false`.
Expand Down
63 changes: 3 additions & 60 deletions docs/agent/tasks/task-1844-openspec-scaffold-and-gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ The repository has somewhere to plan into and a gate that keeps a plan valid. Op
- [x] The inventory classifies every new Markdown file and `devops docs check` passes.
- [x] The pre-commit hook and the `static` job run the row, `copilot-setup-steps.yml` exists, and AGENTS.md is within its 40,000-character cap (39,953). `devops ci --dry-run` lists the row, and `tests/test_openspec_scaffold.py` checks the hook and `tests/test_workflow_contracts.py` both workflows and that every remote action is pinned.
- [x] The tests that replay the tool hold the record to the pin and to the gate's commands: `tests/test_openspec_contract.py` fails when the record is not of the locked version, when a scenario is not recorded, and when the record holds a run the gate no longer starts.
- Not done: the `permissions` entries in `.claude/settings.json` and the test that reads them. They are the last part of #1844. An agent's session may not edit that file, so a person applies the JSON kept below, and the last part adds the test.
- [x] The `permissions` entries are in `.claude/settings.json`. A person applied them, because an agent may not edit that file. On 2026-10-22 the person set the allow list to `Bash(uv run devops *)`, `Bash(openspec *)` and `Bash(tuicr *)`, and removed the deny list. The same change deletes `tests/test_claude_code_settings.py`. The last part of #1844 adds no settings test.
- Not done: the wrapper `devops openspec archive` and its tests. ADR 0012 plans the wrapper, and it is the last part of #1844. The settings allow the direct tool `openspec archive`, so the wrapper is a convention and no entry of the settings enforces it.
- Pending a person: edit the text of #1844 and #1846. They say that the last part adds a settings test and that the deny list holds `archive`. Both statements conflict with the settings of 2026-10-22.
- Pending a person: after the release that carries `.github/workflows/copilot-setup-steps.yml` merges to `main`, run the workflow once from the Actions tab and confirm that a Copilot cloud agent session finds `openspec` on its PATH. GitHub runs the file only from the default branch, so until then that agent finds the committed skills and no binary.
- Pending a person: with a devcontainer rebuilt after #1842, run `uv run devops ci` and expect every row, the `openspec` row included, to pass with `openspec` on PATH.

Expand All @@ -39,62 +41,3 @@ The repository has somewhere to plan into and a gate that keeps a plan valid. Op
- The changelog fragment `changelog.d/1844.md`: the last part of #1844 adds it, because a part adds none.
- `GEMINI.md` and its generator: #1845.
- The archive in the pull request that closes a change, and the readiness rule that checks it: #1846.

## Permission Entries Kept for the Last Part

A person applies this change to `.claude/settings.json` and leaves its `env` block as it is. The last part of #1844 then adds the test below to `tests/test_openspec_scaffold.py` and removes this section. Every generated skill carries `allowed-tools: Bash(openspec:*)`, and Claude Code evaluates deny rules before allow rules. A deny entry therefore holds where a narrow allowlist would not. No bare `Bash(openspec *)` is allowed. The deny list holds no `archive` entry, because the pull request that closes a change runs `openspec archive <change> --yes` as its last commit (#1846).

```json
"permissions": {
"allow": [
"Bash(uv run devops *)",
"Bash(openspec status *)",
"Bash(openspec list *)",
"Bash(openspec instructions *)",
"Bash(openspec context *)",
"Bash(openspec show *)",
"Bash(openspec schemas *)",
"Bash(openspec validate *)",
"Bash(openspec new change *)"
],
"deny": [
"Read(//**/.claude/settings.local.json)",
"Read(~/.claude/settings.json)",
"Read(~/.kube/**)",
"Bash(openspec init *)",
"Bash(openspec update *)",
"Bash(openspec config *)",
"Bash(openspec completion *)"
]
}
```

```python
ALLOWED_OPENSPEC_VERBS = (
"status",
"list",
"instructions",
"context",
"show",
"schemas",
"validate",
"new change",
)
DENIED_OPENSPEC_VERBS = ("init", "update", "config", "completion")


def test_the_settings_allow_the_verbs_the_skills_call_and_deny_the_ones_that_write() -> None:
"""Every generated skill carries `allowed-tools: Bash(openspec:*)`, which grants the whole verb
set during the turn, and Claude Code evaluates deny rules before allow rules, so a deny entry
holds where a narrow allowlist would not. No bare `Bash(openspec *)` is allowed."""
settings = json.loads((REPO_ROOT / ".claude/settings.json").read_text(encoding="utf-8"))
permissions = settings["permissions"]

def openspec_rules(kind: str) -> list[str]:
return [rule for rule in permissions[kind] if rule.startswith("Bash(openspec")]

assert (openspec_rules("allow"), openspec_rules("deny")) == (
[f"Bash(openspec {verb} *)" for verb in ALLOWED_OPENSPEC_VERBS],
[f"Bash(openspec {verb} *)" for verb in DENIED_OPENSPEC_VERBS],
)
```
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The first plan archived changes at the release cut. The owner replaced that plan
- **Tests.** `tests/test_openspec_archive.py` is deleted. `tests/test_openspec_gate.py`, `test_openspec_tool.py` and `test_openspec_command.py` lose the rehearsal, order, symlink and archive-failure cases. The scenarios `merged-out-of-issue-order`, `missing-purpose`, `modified-spec-absent` and `duplicate-added` are gone. The `merged` field and the commits that `build_scenario` made are gone too. A scenario tree holds a `git init` and no commit, so a gate that reads git history fails every gate test.
- **New tests.** `test_the_gate_passes_changes_and_archives_none_of_them` runs the scenarios `pair` and `skip-specs-change`. It asserts no finding and no `archive` run. `test_the_static_job_installs_the_pinned_node_and_openspec_before_the_gate` now asserts that the checkout step has no `fetch-depth`.
- **Recorded runs.** I deleted four scenarios from `tests/fixtures/openspec_runs/recorded_runs.json`. I also deleted every `archive` run and every `validate --specs --strict` run. I edited no recorded text. `tests/test_openspec_contract.py` proves that the record holds only runs that the gate starts.
- **Other task text.** `docs/agent/tasks/task-1844-openspec-scaffold-and-gate.md` loses the archive-function bullet and the rehearsal. Its criterion for a change that would not archive now names the overlap check. Its kept settings text denies no `archive`. `docs/agent/tasks/task-1753-openspec-adoption.md` and `changelog.d/1753.md` no longer say that the cut archives.
- **Other task text.** `docs/agent/tasks/task-1844-openspec-scaffold-and-gate.md` loses the archive-function bullet and the rehearsal. Its criterion for a change that would not archive now names the overlap check. `docs/agent/tasks/task-1753-openspec-adoption.md` and `changelog.d/1753.md` no longer say that the cut archives.

## Acceptance Criteria

Expand All @@ -35,13 +35,13 @@ The first plan archived changes at the release cut. The owner replaced that plan
- [x] ADR 0010 holds no passage that archives at the cut. It names the release cut only to say that the cut does not archive.
- [x] `openspec/config.yaml` tells an agent to archive its own change in the commit that closes it. It also tells the agent not to run `sync`. The copy in ADR 0010 equals the file.
- [x] The help text, the docstrings and the documents name no archive at the cut.
- [x] The kept settings text in the task file of #1844 holds no `archive` deny entry.
- [x] The settings hold no `archive` deny entry. `Bash(openspec *)` allows the direct tool `openspec archive`, so nothing in the settings blocks it. ADR 0012 still plans the wrapper `devops openspec archive`, which the last part of #1844 builds. The wrapper is not built yet.
- [x] ADR 0012 no longer calls the overlap check cut-time code that #1846 removes. The two passages that named it now say that it stays, and one dated line records the correction.
- [x] The gate tests pass with the recorded runs that remain. A gate that archives a change, or reads git history, fails them.
- [x] `uv run devops openspec check` passes on the tree with the real tool.
- Not done: readiness refuses a `Closes` pull request whose folder is not under `openspec/changes/archive/`. It also allows a write to `openspec/specs/**` only in a `Closes` pull request for its own change (the last Part of #1846, after #1847).
- Pending a person: apply the `permissions` entries kept in `docs/agent/tasks/task-1844-openspec-scaffold-and-gate.md` to `.claude/settings.json` after this pull request merges. That text no longer denies `openspec archive`, so an agent can run `openspec archive <change> --yes` in the closing commit. To let an agent run it without a prompt, also add `"Bash(openspec archive *)"` to the allow list. Add `archive` to `ALLOWED_OPENSPEC_VERBS` in the kept test as well.
- Pending a person: decide the form of the archive command. ADR 0010 and `openspec/config.yaml` say `openspec archive <name> --yes`. Line 185 of ADR 0012 plans a wrapper, `devops openspec archive <name>`. Settle the form before Part B.
- [x] The `permissions` entries are in `.claude/settings.json`. A person applied them on 2026-10-22: `Bash(uv run devops *)`, `Bash(openspec *)` and `Bash(tuicr *)` allow, and no deny list. An agent runs `openspec archive <change> --yes` in the closing commit without a prompt.
- Pending a person: decide the form of the archive command. ADR 0010 and `openspec/config.yaml` say `openspec archive <name> --yes`, and the settings allow it. Line 186 of ADR 0012 plans a wrapper, `devops openspec archive <name>`, which the last part of #1844 builds. The wrapper is not built yet. The settings enforce neither form. Settle the form before Part B.
- Pending a person: edit the text of #1847. It says that the cut owns the writes to `openspec/specs/**` and `openspec/changes/archive/**`. It says that the cut lists a change which is not `complete`. Both statements conflict with the decision of 2026-10-22.

## Deliverables
Expand Down
2 changes: 1 addition & 1 deletion docs/agent/tasks/task-1882-pin-gh-dash-and-ship-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The source, the study and one measurement give these numbers:
- [x] `tests/test_gh_dash_config.py` and `tests/test_tools_lock.py` pass. They run offline and never start gh-dash. `devops ci` passes in the pre-push hook before the push.
- [x] `changelog.d/1882.md` records the change. `CHANGELOG.md` and `docs/ROADMAP.md` are not edited.
- [x] The docs say how to start gh-dash: `docs/DEVCONTAINER_USAGE.md`.
- Not done: the permission entries that stop an agent from starting gh-dash. The sentence "Agents never start `gh-dash`." is in `docs/DEVCONTAINER_USAGE.md`. The entries that enforce it are a person-run change to `.claude/settings.json`. They come with [#1884](https://github.com/dan-petty/devops-cli/issues/1884), which pins tuicr. Its second part is the human review round.
- Not done: the permission entry that stops an agent from starting gh-dash. A person decided on 2026-10-22 to add no deny entry to `.claude/settings.json`, here and in [#1884](https://github.com/dan-petty/devops-cli/issues/1884). No entry covers `gh-dash`, so an agent run of it prompts like any other command that no entry covers. The sentence "Agents never start `gh-dash`." stays in `docs/DEVCONTAINER_USAGE.md` as a rule of the docs. The settings do not enforce it.
- Pending a person: run `devops install-tools --tool gh-dash`, then `devops install-tools --check`. The check prints that every tool is linked at its locked version and exits 0.
- Pending a person: at the root of the clone, run `gh-dash --config .gh-dash.yml` with your own token. Check that four pull request tabs, three issue tabs and one notification tab show. Check that Queue lists the oldest pull request first. Check that `w`, `T`, `D` and `d` run the devops commands and return to gh-dash. Check how the terminal shows the icons in the preview pane, the notification rows and the column headers.
- Pending a person: measure the GraphQL cost of gh-dash again. The steps are in [#1918](https://github.com/dan-petty/devops-cli/issues/1918): count the lines of `debug.log`, and do not read the quota counters. The computed cost is 7 points at start, with 2 more points for each row you select with the preview open.
Expand Down
31 changes: 4 additions & 27 deletions docs/agent/tasks/task-1884-pin-tuicr-and-ship-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,13 @@ The upkeep of a bump is one version, four URLs and four hashes. tuicr is below 1
- [x] `tests/test_tuicr_config.py` and `tests/test_tools_lock.py` pass. They run offline and never start tuicr. `devops ci` passes in the pre-push hook before the push.
- [x] `docs/SDLC.md` Phase 6 describes the human review round, `docs/VISION.md` item 15 describes the open-tool canvas, and `docs/DEVCONTAINER_USAGE.md` says how to start tuicr.
- [x] `changelog.d/1884.md` records the change. `CHANGELOG.md` and `docs/ROADMAP.md` are not edited.
- Pending a person: merge these permission entries into `.claude/settings.json`. An agent must not edit its own permission file. The same entries close the gh-dash part of [#1882](https://github.com/dan-petty/devops-cli/issues/1882). The `gh-dash` deny entry and the `tuicr` deny entries are one settings change. First compare the file with the settings entries of the GitHub request budget design. The file must hold one set and no duplicate.

```json
{
"permissions": {
"allow": [
"Bash(tuicr review list *)",
"Bash(tuicr review comments *)"
],
"deny": [
"Bash(tuicr review clear *)",
"Bash(tuicr review clearc *)",
"Bash(tuicr review delete *)",
"Bash(tuicr review add *)",
"Bash(tuicr update*)",
"Bash(tuicr pr *)",
"Bash(tuicr)",
"Bash(tuicr -*)",
"Bash(tuicr tui*)",
"Bash(gh-dash*)"
]
}
}
```

- Pending a person: check the three start patterns of the deny list. `Bash(tuicr)`, `Bash(tuicr -*)` and `Bash(tuicr tui*)` must block a start of the interface. They must not match `tuicr review list` or `tuicr review comments`. They also block `tuicr --help`, which is acceptable. The Gemini and Copilot equivalents are not verified.
- [x] The entry `Bash(tuicr *)` is in `.claude/settings.json`. A person applied it, because an agent must not edit its own permission file. It allows every `tuicr` command without a prompt.
- Not done: the deny entries for the start and write forms of `tuicr` and for `gh-dash`. A person decided on 2026-10-22 to add no deny entry. The settings allow the interface, `tuicr review clear`, `clearc`, `delete` and `add`, `tuicr update` and `tuicr pr`. No entry covers `gh-dash`, so an agent run of it prompts like any other command that no entry covers. The rule that an agent never starts `tuicr` or `gh-dash` stays in `docs/DEVCONTAINER_USAGE.md` and in `docs/SDLC.md` Phase 6. The settings do not enforce it.
- Pending a person: when the GitHub request budget design merges, compare its settings entries with `.claude/settings.json`. The file must hold one set and no duplicate.
- Pending a person: run `devops install-tools --tool tuicr`, then `devops install-tools --check`. The check exits 0 when every tool has its locked version.
- Pending a person: copy the template with `mkdir -p ~/.config/tuicr && cp .devops/tuicr.config.toml ~/.config/tuicr/config.toml`. If that file exists, copy it first to `~/.config/tuicr/config.toml.bak-<YYYYMMDD-HHMMSS>`.
- Pending a person: run one real review. In a worktree of an agent, run `tuicr -r <release-branch>..HEAD`, add a comment, press `y` and check the export. In another terminal, run `tuicr review list --repo <worktree>` and `tuicr review comments --repo <worktree> --session <slug>`. Check the JSON fields `id`, `location`, `path`, `start_line`, `end_line`, `side`, `comment_type`, `author`, `lifecycle_state`, `created_at` and `content`. Judge the VS Code terminal. The clipboard (OSC 52) and Shift-Enter are not verified (issue 782 of the tuicr repository).
- Pending a person: run one agent round. Ask an agent to address the comments of that review, with the "Human Review Round" bullet of `docs/SDLC.md`. Keep tuicr open during the round, or give the agent the session slug, because `"active"` is true only while tuicr is open. Check that the allow entries stop the permission prompt for the two read commands. Check that a deny entry blocks `tuicr review clear` and a start of `tuicr`. Report what failed.
- Pending a person: run one agent round. Ask an agent to address the comments of that review, with the "Human Review Round" bullet of `docs/SDLC.md`. Keep tuicr open during the round, or give the agent the session slug, because `"active"` is true only while tuicr is open. Check that the entry `Bash(tuicr *)` stops the permission prompt for the `tuicr review` commands. Report what failed.

## Deliverables

Expand Down
28 changes: 0 additions & 28 deletions tests/test_claude_code_settings.py

This file was deleted.

Loading