From a34593fddcc806f367f9b4537c3a320c13e9c4f2 Mon Sep 17 00:00:00 2001 From: Daniel Petty Date: Thu, 22 Oct 2026 14:28:14 +0000 Subject: [PATCH] docs(agents): a convention yields to an open tool and rules with no check are pruned Fixes #1874 --- AGENTS.md | 27 +++++------ changelog.d/1874.md | 7 +++ docs/ROUTINE_TASKS.md | 5 +-- docs/SDLC.md | 1 - docs/SELF_IMPROVEMENT.md | 14 +++--- docs/VISION.md | 2 +- ...ask-1874-convention-yields-to-open-tool.md | 45 +++++++++++++++++++ src/devops_cli/ai/instruction_generator.py | 19 +++----- .../tasks/github_project_management.md | 3 +- tests/test_instruction_generator.py | 9 ++-- 10 files changed, 86 insertions(+), 46 deletions(-) create mode 100644 changelog.d/1874.md create mode 100644 docs/agent/tasks/task-1874-convention-yields-to-open-tool.md diff --git a/AGENTS.md b/AGENTS.md index 72119fbb8e..4428d4f785 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,18 +12,18 @@ This document provides context, architectural principles, and best practices for - **Poetic Conciseness, Expressive Integration & Zero Boilerplate**: - The codebase must read as an expressive, poetically concise integration of tools, libraries, docs, AI, and automation rather than a sprawl of procedural loops or boilerplate. - **Strict Complexity & Nesting Caps**: Cyclomatic complexity $\le 10$ is Ruff `C901` (standard McCabe), run by `uv run devops ci` and the pre-commit `ruff-check` hook. Functions over the cap carry `# noqa: C901`. `test_c901_suppressions_stay_under_the_ceiling` ([`tests/test_architectural_invariants.py`](tests/test_architectural_invariants.py)) keeps suppressions bounded, and `test_the_complexity_cap_has_no_escape` rejects alternative suppression paths. Functions over the cap are decomposed, never suppressed. Nesting depth $\le 5$ (< 6 indentation levels) is enforced by the `structural-invariants` pre-commit hook and `test_the_source_tree_keeps_its_structural_invariants`, which read `devops_cli.core.code_metrics`. - - Decompose multi-step tasks, deep branching, and nested iterations into helper functions, pure predicates, and functional pipelines. Replace procedural `if/elif` dispatchers with dictionary mappings, registry lookups, or table-driven dispatch. Maximize standard library leverage (`functools`, `itertools`, `pathlib`, `collections`, `ipaddress`, `urllib.parse`), Pydantic v2 models, and functional pipelines. + - Split a multi-step task into helper functions, pure predicates and pipelines. For a closed set, use `match` with `assert_never` or a table, not an `if/elif` chain. Prefer the standard library (`functools`, `itertools`, `pathlib`, `collections`, `ipaddress`, `urllib.parse`) and Pydantic v2 models to hand-written code. - **Strict Prohibition of Brittle Pattern Subsets & Mandatory Constants/Defaults Placement**: - Matching against a list of strings or regular expressions is **ONLY acceptable if it covers 100% of possible scenarios** (mathematically bounded, closed domains defined by official RFCs or language grammars). - Matching against a limited or arbitrary subset of a larger or unknown list of possible values is strictly prohibited. Use mature solutions such as programming language symbol parsers (Python AST visitors, tokenizer pipelines) or official registries (Mozilla Public Suffix List via `tldextract`). - Any string list, tuple, or frozen set for matching, classification, or filtering **MUST be declared in `src/devops_cli/config/constants.py` or `src/devops_cli/config/defaults.py`**, never scattered across functional modules. -- **Modern Python Ecosystem**: Track Python 3.14+ runtime features, typing standards, and established libraries (`pydantic v2`, `httpx2`, `pytest`, `ruff`, `mypy`, `uv.lock`). Never hallucinate CVEs or false malicious alerts against verified dependencies like `httpx2`. -- **Open Tools Before Internal Code**: Before building a capability, name the open tool or library that covers it. Building instead needs a written cost in the issue or PR: tokens to implement, maintain and fix until it matches the tool, plus elapsed time. A plan that prescribes a build is a proposal. +- **Modern Python Ecosystem**: Track Python 3.14+ and prefer established libraries. The tools in `pyproject.toml` are choices, not requirements. +- **Open Tools Before Internal Code**: Before building a capability, name the open tool or library that covers it. Building instead needs a written cost in the issue or PR: tokens to implement, maintain and fix until it matches the tool, plus elapsed time. A plan that prescribes a build is a proposal. A convention is never a reason to keep or write custom code. This rule outranks every convention here. - **Write in ASD-STE100 Simplified Technical English**: Write all prose in ASD-STE100: chat replies, PR, issue and commit text, documents, task files, `devops ai` output, and new or edited output strings. Code, commands, file names, identifiers and quoted text stay as they are. - Put one instruction in each sentence. Use at most 20 words in a procedure sentence and 25 in a description. Use at most six sentences in a paragraph. - Use the active voice and simple tenses. Do not use contractions. Keep the articles. Use one word for one meaning. - **Zero-Trust Security & Egress Safety**: - - Never store plaintext secrets or tokens in code, configuration files, or logs. Always use OS Keyring or secure secret stores (HashiCorp Vault). + - Never store a secret in code, configuration files, logs or git. Read each secret from a secret store, such as the OS keyring, HashiCorp Vault, a Kubernetes Secret or the credential store of the owning tool. - **Zero Information Leakage & Environment Sanitization**: - Never leak, extract, or expose confidential, private, hidden, or `.gitignored` files (`.env*`, `.ssh/`, `.data/`, `~/.gemini/`, credentials, private keys) into any documents, changelogs, review findings, public commits, or code artifacts. Enforced by `.gitignore`, `detect-private-key`, and `bandit`. - **Strict Prohibition of Internal Systems & Real Infrastructure Data**: Never record, publish, or leak concrete internal hostnames (`*.lan`, `*.local`, physical machine names, private server hostnames), private RFC 1918 IP addresses (`192.168.0.0/16`, `10.0.0.0/8`, `172.16.0.0/12`), private container registries, non-standard local NodePort services (`:30500`), physical block devices/mount paths (`/mnt/nvme*`, `/dev/sd*`), or private cluster topology details into task tracking (`docs/agent/tasks/`), documentation, roadmaps, code comments, tests, manifests (`k8s/`), or configuration templates (`config.yaml`). @@ -54,8 +54,7 @@ This document provides context, architectural principles, and best practices for - **Mandatory Comprehensive Kubernetes Stack Deployment (`devops k8s deploy-stack --stack all`)**: - Every Kubernetes manifest, service, workload, ConfigMap, CronJob, NetworkPolicy, or Helm chart running in the cluster MUST be integrated into and deployed by `devops k8s deploy-stack`. - Executing `devops k8s deploy-stack --stack all` MUST deploy, synchronize, and update all cluster resources across all stacks (`infra`, `llm`, `logging`, and in-cluster `devops` services under `k8s/devops/`). Registered under `_MANIFESTS_BY_STACK`, `_HELM_RELEASES_BY_STACK`, or `_POST_HELM_BY_STACK` in `stack_lifecycle.py`. -- **Never Lower Security Standards or Quality Thresholds**: Never lower, relax, disable, bypass, or weaken security standards, quality thresholds (minimum 90% code coverage, strict static type checks, lint rules), or compliance validations unless explicitly instructed by the user. -- **Continuous Standards Compliance & Solution Refinement**: Ensure every proposed solution, design, code change, or architecture meets all project standards and conventions, refining until every standard is met. +- **Never Lower Security Standards or Quality Thresholds**: Never lower, relax, disable or bypass a security standard or quality threshold (90% coverage, strict typing, lint rules, compliance checks). Only the user can allow this. Every change meets the project standards. Replacing a check with a standard tool that enforces at least the same property on this repository is not lowering it. Run both checks once. Show both results in the PR. - **Strict Pre-Push Quality Gate Mandate (Zero Pushes Without Passing `devops ci`)**: - The pre-push hook's `uv run devops ci` is the gate run. A manual run counts only when nothing changes before the push. Run it, if at all, after the last rebase, amend or edit, in the worktree you push from, with no `--check`, `--no-fix`, `--only` or `--skip`. - AI agents, workflows, and developers **MUST NEVER PUSH COMMITS (`git push`)** to any remote branch unless `uv run devops ci` has completed locally with 100% passing status (every check `devops ci` runs, coverage $\ge 90.0\%$, zero failed tests, zero unhandled deprecation warnings) in the active session. @@ -69,14 +68,12 @@ This document provides context, architectural principles, and best practices for - **Author All Code, Documentation, Status & Wording as Merged/Committed (Zero Administrative Tracking PRs)**: - Status and wording of all code, documentation, checklists, deliverable descriptions, and task tracking files (`docs/agent/tasks/`) **MUST BE AUTHORED FROM THE OUTSET EXACTLY AS THEY WILL READ ONCE COMMITTED AND MERGED**. - **Strict Prohibition of Standalone Tracking Commits & Follow-Up Status PRs**: Never create commits or pull requests solely to update tracking after a PR has merged. Such PRs are pointless administrative clutter. The deliverable is described in its final completed state within the functional deliverable PR itself (`- [x]`). An item delivered as several PRs is the one exception: each `Part of #` PR may author or update its task file, and the last closes the issue. Work not done is a plain bullet naming its follow-up issue; checks only a person can run are plain bullets starting `Pending a person:`. -- **Strict Prohibition of Inconsistent N-Gate Numbering & Unified `Gated` Terminology**: Arbitrary gate numbering (e.g. `7-Gate`, `10-gate`) across code, tests, docstrings, and documentation is strictly prohibited. Always use unified `Gated` terminology (e.g. `Gated CI Quality Gate`, `Gated CI validation suite`). - **API Rate Limit Honor, Resilient Backoff & Quota Budgeting**: - Respect API rate limits, complexity budgets, and resource quotas across external services (GitHub REST/GraphQL, AI LLM/embedding inference, package registries, cloud providers). - Inspect remaining rate limits proactively (`devops gh rate-limit`, `x-ratelimit-remaining`, `Retry-After`). - **Strict Prohibition of Bare `gh` CLI Invocations**: All GitHub operations must be routed through native rate-managed commands (`devops gh`, `devops pr`) or FastMCP tools, using `GitHubRateLimiter` (`run_gh`) for client-side token-bucket pacing, quota safety thresholds, and read caching. - Apply bounded exponential backoff with jitter on HTTP 429 / rate limits. Cache idempotent queries locally (`.data/` or Valkey L2 cache). - **Negative Tool Schema Invariants & Prescriptive Error Feedback**: FastMCP tools and agent schemas MUST enforce strict parameter boundaries (`extra="forbid"` in Pydantic v2 or `additionalProperties: false` in JSON Schema). Validation handlers synthesize structured, prescriptive error prompts detailing allowable arguments. -- **Closed-Loop Feedback Inversion & Proactive Headroom Elevation**: Do not treat $M = 10$ and depth $= 5$ as target plateaus. Once high-priority defects are cleared, optimize headroom to safe thresholds ($M \le 6$, depth $\le 3$) with complete public docstrings and type annotations. - **Pre-1.0 Alpha Lifecycle & Zero Backwards Compatibility Guarantee**: - `devops-cli` is **alpha software** before `1.0.0` with **no intention of maintaining backwards compatibility**. Breaking changes, interface evolutions, and schema redesigns may land in any release without legacy shims. - The codebase MUST remain clean of legacy references, obsolete shims, deprecated aliases, and compatibility remnants at all times. @@ -86,15 +83,13 @@ This document provides context, architectural principles, and best practices for - **Strict Prohibition of Stray / Scratch Scripts in Project Root & Source Trees**: Never create ad-hoc scratch scripts, experimental files, or reproduction tests (`test_*.py`, `debug_*.py`, `tmp*.py`, `scratch*.py`, `*.sh`) in the project root or source trees. Prototyping must reside in ephemeral agent scratch (`/brain//scratch/` or `/agent/scratch/`) or permanent tests under `tests/`. Enforced by `test_no_stray_scripts_in_project_root` in [`tests/test_architectural_invariants.py`](tests/test_architectural_invariants.py). - **Mandatory Backup for Files Outside Workspace**: When modifying files outside workspace (`~/.ssh/`, `~/.bashrc`, `/etc/`), create a timestamped backup `.bak-` before edits. - **Mandatory Defect Filing on CLI Errors & Warnings**: When encountering unhandled errors, subcommand failures, crashes, or diagnostic warnings executing `devops` CLI commands, file a bug candidate with `devops roadmap intake --title "fix(): " --body-file --confirm`. Never suppress or bypass errors silently. -- **Mandatory Root-Cause Remediation & Instruction Hardening**: Always investigate and fix the cause of issues at the source. If blocked by external dependencies or upstream platform constraints, update `AGENTS.md` with defensive guardrails to prevent recurrence. +- **Mandatory Root-Cause Remediation**: Investigate and fix the cause at the source. If an external constraint blocks the fix, add a check that fails when the problem returns, and link the incident. Add prose here only when no check is possible. - **Proactive Deprecation Remediation & Zero-Warning Mandate**: When encountering deprecation warnings (`DeprecationWarning`, Python 3.14+, Pydantic v2, Typer, Click, PyGithub), investigate and resolve them at the source immediately. Enforced by `uv run devops ci`. -- **Forward-Looking Project Management & Continuous Roadmap Evolution**: Project planning and AI automation must proactively file ideas, capabilities, and refactorings through intake (`devops roadmap intake`). - **Continuous Roadmap Synthesis, Field Observations & Self-Improvement**: - File candidates with `devops roadmap intake --title "" --body-file --confirm` (or FastMCP `roadmap_intake` with `mode="confirm"`). The body states friction, evidence, and proposed remedy. Intake checks duplicates, labels `source/agent`, assigns type, Priority, Value, Effort, and places in backlog or release. - Never set milestone or priority on a new issue, and never edit `docs/ROADMAP.md` (written from GitHub at release cut; see [ADR 0001](docs/adr/0001-github-is-the-roadmap-source.md)). - Respect agent filing quota (`source/agent`, `budget/borrowed` for splits/follow-ups/P0/P1 bugs; see [#1153](https://github.com/dan-petty/devops-cli/issues/1153)). - **Continuous Interaction & Collaborative Value Improvement**: Suggest ways to improve ergonomics, speed, resilience, docs, test coverage, and tooling efficiency. -- **Unambiguous, Purpose-Driven Naming & Zero Namespace Confusion**: Self-documenting names conveying architectural responsibility. Strictly avoid vague file names (`temp_util.py`, `_config.yaml`). Zero duplicative names across scopes. Avoid generic single-letter variables (`data`, `temp`, `res`, `cfg`) in favor of expressive domain terms (`review_page_content`, `target_config_path`). --- @@ -104,7 +99,7 @@ All work follows a test-first progressive verification strategy: ### Feasibility Check (Before Any Code or Tests) - **Confirm Premise Against Real System**: Confirm premise against upstream documentation, library source, live cluster state, or CLI runtime. Record verification method in task file's `**Feasibility**` field. -- **Stop Rather Than Add Compensating Code**: When an item cannot be built as specified or requires refactoring beyond its scope, write no compensating code (no dummy mocks, no swallowed exceptions). Comment on the issue with evidence, return item to `New` (`devops roadmap return --comment "" --confirm`), and stop. See [#1348](https://github.com/dan-petty/devops-cli/issues/1348). +- **Stop Rather Than Add Compensating Code**: When an item cannot be built as specified or requires refactoring beyond its scope, write no compensating code (no dummy mocks, no swallowed exceptions). Comment on the issue with evidence, ask a person to return the item to `New` (`devops roadmap return --comment "" --confirm`), and stop. See [#1348](https://github.com/dan-petty/devops-cli/issues/1348). - **Signals to Stop**: Swallowing an error (`except Exception: pass`, unread `check=False`); product code detecting tests; a second fix on top of a fix in the same area within one release; review loop repeatedly finding new defects in the same feature. ### Test-First Development Cycle (TDD as Living Contract) @@ -152,7 +147,7 @@ All work follows a test-first progressive verification strategy: - **`roadmap-service` Is Suspended ([#1562](https://github.com/dan-petty/devops-cli/issues/1562))**: - GitHub suspended the Service's machine account. `deployment/roadmap-service` is held at 0 replicas in git. Rules describing the running Service do not apply until #1562's revert merges. - Nobody scales up, restarts, or re-pushes secrets for `roadmap-service`. - - Only a person runs mutating `devops roadmap` commands (`close --confirm`, `intake --confirm`, `reprioritize`, `refine`, `run --confirm`), from their own account. Agents use `--plan` and `--dry-run` only. + - An agent files its own new candidate with `intake --title`, `--body-file` and `--confirm`. Only a person runs any other mutating `devops roadmap` command, from their own account: `close --confirm`, `return --confirm`, `reprioritize`, `refine`, `run --confirm`, and `intake` over existing issues. For these, an agent uses `--plan` and `--dry-run` only. - Items labelled `status/blocked` pointing to #1562 stay blocked until reinstated. - **In-Cluster Service & Concurrency Avoidance**: When `roadmap-service` is active, avoid concurrent manual mutations (`close --confirm`, `intake --confirm`). Read-only inspection (`--plan`, `--dry-run`) is permitted. For service architecture, job cycles, telemetry, and diagnostics, see `k8s/README.md` and [`docs/SDLC.md`](docs/SDLC.md) Phase 6. - **Remote Branch Lifecycle**: Every remote branch must have an open PR (`--draft` for WIP). Merged or superseded branches must be deleted immediately (`git push origin --delete ` and `git fetch --prune origin`). Orphan remote branches are strictly prohibited. @@ -170,7 +165,7 @@ All work follows a test-first progressive verification strategy: - **Merge Readiness Guarantee**: A PR is ready for merging ONLY when `devops pr monitor` exits 0 (all checks green, 0 unresolved threads). Maintainers approve and squash-merge; agents never merge autonomously. See [`docs/SDLC.md`](docs/SDLC.md) Phase 6. ### GitHub Projects, Issues, Views, Milestones & Pages -- **Milestone Population & Issue Templates**: Author tracking issues for active milestones using templates (`.github/ISSUE_TEMPLATE/`: `bug_report.yml`, `feature_request.yml`). Assign Conventional Commit titles, milestone links, and taxonomy labels (`type/*`, `scope/*`, `priority/*`). Open issues queue must never be left empty. +- **Milestone Population & Issue Templates**: Author tracking issues for active milestones using templates (`.github/ISSUE_TEMPLATE/`: `bug_report.yml`, `feature_request.yml`). Assign Conventional Commit titles, milestone links, and taxonomy labels (`type/*`, `scope/*`, `priority/*`). - **PR Closing Keywords**: PRs must link their issue via closing keywords (`Fixes #`, `Closes #`, `Resolves #`). A PR that delivers part of an item planned as several PRs says `Part of #` instead, naming one open item of the base's release and changing its task file; the item's last PR closes it. `devops pr check-readiness` blocks a body that names no issue, several, or both a closing keyword and a part reference. - **Four Canonical Project Views**: Ground work in `.github/project-template.json` views (*Sprint Kanban*, *Roadmap Timeline*, *Triage & Quality Table*, *Value vs Effort Priority Matrix*). Link board via `devops gh project link `. - **Triage Auditing**: Regularly run `devops gh issues triage` to detect untriaged issues. Close milestones on release merge (`devops gh milestones close `). @@ -183,7 +178,7 @@ All work follows a test-first progressive verification strategy: ## 4. Code Quality & Architectural Standards - **Separation of Concerns**: Separate configuration, domain logic, data models, network I/O, and user interface layers. Avoid monolithic modules. -- **Purpose-Driven Naming**: Files, modules, classes, and functions must have self-documenting names conveying concrete responsibilities (`reference_extractor.py`, `vulnerability_lookup.py`). Eliminate duplicative or shadowing names across scopes. +- **Purpose-Driven Naming**: Name files, modules, classes and functions for their responsibility (`reference_extractor.py`). Do not use a placeholder (`temp_util.py`, `data`). Do not duplicate or shadow a name across scopes. Ruff `N` checks the form. - **Config & Defaults Separation**: Distinguish immutable constants (`src/devops_cli/config/constants.py`) from user-configurable defaults (`src/devops_cli/config/defaults.py`). - **Strict Typing & Modern Idioms**: Enforce type annotations (`mypy --strict`), Python 3.14+ union syntax (`A | B`), standard collections, and Pydantic v2 models with `Field(default_factory=...)`. - **Test Conventions**: Tests follow [`docs/TESTING.md`](docs/TESTING.md): they double only process edges, each through one shared fake ([ADR 0007](docs/adr/0007-tests-double-only-process-edges.md)), and never hardcode live credentials or endpoints. @@ -209,7 +204,7 @@ All work follows a test-first progressive verification strategy: - **Context-Aware Documentation, Examples & Test Evaluation**: - Never flag documentation, architectural guides, security tutorials, knowledge base articles, prompt benchmarks, test assertions/fixtures, test mocks, sample configuration files (`*.example.*`, `*.sample.*`, `*.env.example`), or comments describing vulnerabilities in the context of avoiding or mitigating them. - Infrastructure-as-Code operator outputs (`outputs.tf`) must not be flagged as remote command injection. -- **Zero Hallucinated CVEs & Synthetic IDs**: Never synthesize fictitious CVE numbers. Cite advisories only from static scanner outputs (`scan_trivy`, `scan_uv_audit`) or public databases (OSV, NVD). +- **Zero Hallucinated CVEs & Synthetic IDs**: Never synthesize fictitious CVE numbers. Cite advisories only from static scanner outputs (`scan_trivy`, `scan_uv_audit`) or public databases (OSV, NVD). Never call a verified dependency such as `httpx2` malicious without scanner output. - **Internal Infrastructure vs External SSRF Distinction**: Internal service connectors (Valkey, Vault broker, Kubernetes API, Prometheus, Grafana Loki, Ollama, LiteLLM gateway) reach private networks by design as workstation tooling. Reviewers and analysis stages MUST NOT flag internal service connectors as SSRF vulnerabilities. SSRF applies to untrusted external fetches dialled outside the client factory (`devops_cli.http.client`). - **Ground-Truth Scope & Variable Verification (Zero False NameErrors)**: Analysis stages MUST NOT declare a variable, constant, or imported symbol as undefined (`NameError`) without verifying the entire enclosing function, class, or module scope. If a symbol was imported, assigned, or passed as a parameter in active scope or outer closure, the finding is a hallucination and MUST NOT be reported. - **Criteria Inversion & Semantic Alignment**: Strictly distinguish between `verification_criteria` (positive evidence defect exists) and `invalidation_criteria` (conditions proving false positive). Satisfied invalidation conditions never corroborate findings. diff --git a/changelog.d/1874.md b/changelog.d/1874.md new file mode 100644 index 0000000000..83d00b999a --- /dev/null +++ b/changelog.d/1874.md @@ -0,0 +1,7 @@ +### Changed +- `AGENTS.md` says that a convention is never a reason to keep or write custom code. Replacing a check with a standard tool is not lowering a threshold when the tool enforces at least the same property ([#1874](https://github.com/dan-petty/devops-cli/issues/1874)). +- The bullet "Never Lower Security Standards or Quality Thresholds" in `AGENTS.md` now holds the compliance bullet. The merge keeps one sentence of it: "Every change meets the project standards." ([#1874](https://github.com/dan-petty/devops-cli/issues/1874)). +- `AGENTS.md` drops the `Gated` terminology rule, the headroom targets, the duplicate intake and naming bullets and the empty-queue sentence. The file is 1,104 characters shorter ([#1874](https://github.com/dan-petty/devops-cli/issues/1874)). +- An agent files its own new candidate with `devops roadmap intake --confirm`. An agent asks a person to run `devops roadmap return --confirm` ([#1874](https://github.com/dan-petty/devops-cli/issues/1874)). +- The secrets rule in `AGENTS.md` gives the OS keyring, HashiCorp Vault, a Kubernetes Secret and the credential store of the owning tool as examples of a secret store. The list is open ([#1874](https://github.com/dan-petty/devops-cli/issues/1874)). +- `devops ai agents` writes the new never-lower, root-cause and `roadmap return` wording into other repositories. It no longer writes the compliance bullet or the empty-queue sentence ([#1874](https://github.com/dan-petty/devops-cli/issues/1874)). diff --git a/docs/ROUTINE_TASKS.md b/docs/ROUTINE_TASKS.md index ce1fd3aaa4..155f83664a 100644 --- a/docs/ROUTINE_TASKS.md +++ b/docs/ROUTINE_TASKS.md @@ -8,7 +8,7 @@ This document serves as the authoritative operational manual for developers, mai All routine operations in `devops-cli` adhere to six core engineering tenets: 1. **Deterministic Execution**: Workflows run through standardized CLI commands (`devops ci`, `devops release`, `devops docs`, `uv`) to guarantee reproducible outcomes across local DevContainers and GitHub Actions CI. -2. **Zero-Plaintext Credentials**: All authentication tokens (GitHub, OpenAI, Claude, Grafana, ArgoCD) are stored exclusively in the OS Keyring via `devops config set` and retrieved programmatically via Python `keyring`. +2. **Zero-Plaintext Credentials**: No token is stored in git, configuration or logs. Tokens (GitHub, OpenAI, Claude, Grafana, ArgoCD) come from a secret store. Examples are the OS Keyring (`devops config set`, Python `keyring`), the credential store of the owning tool and a Kubernetes Secret in the cluster. 3. **Strict Quality Assurance**: Changes must pass the automated CI validation suite (`python_version`, `test`, `coverage`, `lint`, `format`, `typecheck`, `audit`, `security`, `actionlint`, `docs`, `uv_check`, `lockfile`, `outdated`) before merging. 4. **Target Branch Hierarchy & Non-Merge Policy**: Feature/bugfix PRs strictly target active release branches (`release/vX.Y.Z`). Direct pushes to `main` are blocked. AI agents stage commits and open/update PRs, while PR merge actions are strictly reserved for human maintainers. 5. **Dynamic Documentation Freshness**: Command matrices, CLI reference guides, and FastMCP schemas are generated dynamically through code introspection (`devops docs generate`) and verified in CI (`devops docs check`). @@ -47,7 +47,7 @@ The following matrix categorizes all project routine tasks by operational layer, | **Release Lifecycle** | Authoritative Release Check | Step 3 | `uv run devops release check` | Validates git tree, version matching, CI validation | All checks green | | **Release Lifecycle** | Maintainer Release PR Merge | Step 4 | `gh pr merge --squash` | Human maintainer squash-merges release PR into `main` | Push event on `main` branch | | **Release Lifecycle** | Automated Tagging & Publish | Step 5 | Automated (`release.yml`) | Cuts annotated git tag `vX.Y.Z`, generates notes, publishes GH Release | GitHub Release published with assets | -| **Release Lifecycle** | Milestone Issue Population | Step 6 | `devops roadmap intake` | Files active milestone deliverables as candidates; intake puts each on the board | Open issues populated with zero empty state | +| **Release Lifecycle** | Milestone Issue Population | Step 6 | `devops roadmap intake` | Files active milestone deliverables as candidates; intake puts each on the board | Each deliverable is an open issue on the board | | **Release Lifecycle** | Historical Documentation Compaction | Step 7 | Automated / Manual | Compacts historical milestone docs in `docs/ROADMAP.md` and `RELEASE_NOTES.md` on major/minor releases | Expressive, token-efficient docs with zero bloat | | **Security & Audits** | Dependency Security Audit | Weekly / Pre-Release | `uv run devops ci audit` (`uv audit`, `npm audit`) | Scans installed packages and the lockfile of each Node tool in `tools.lock` for known vulnerabilities | 0 known vulnerabilities | | **Security & Audits** | Static Security Scan (SAST) | Weekly / Pre-Release | `uv run devops ci security` (`bandit`) | Static security scan for code vulnerabilities | 0 high/medium issues identified | @@ -272,7 +272,6 @@ sequenceDiagram 7. **Next Active Milestone Initialization & Issue/Views Population**: - Cut and push the next release branch (`release/vX.Y.Z`) from `main`. - Proactively author GitHub issues for all planned deliverables in `docs/ROADMAP.md`, assigning each to the active milestone with full taxonomy labels (`type/*`, `scope/*`, `priority/*`). - - Ensure the open issues queue (`https://github.com/dan-petty/devops-cli/issues?q=is%3Aissue+state%3Aopen`), projects tab (`https://github.com/dan-petty/devops-cli/projects`), and issue views (`https://github.com/dan-petty/devops-cli/issues/views`) are populated with zero empty state. - Reconcile custom fields on the cards of GitHub Projects v2 (`https://github.com/dan-petty/devops-cli/projects`) and repository issue views (`https://github.com/dan-petty/devops-cli/issues/views`) via `devops gh project sync`, link the board (`devops gh project link `), and prune all stale remote tracking branches (`git fetch --prune origin`). 8. **Automated Historical Documentation Compaction & Task Archival**: - When transitioning across major or minor release boundaries, run `uv run devops docs compact --series ` to automatically compact historical documentation across `docs/ROADMAP.md` (consolidating completed milestone subsections and matrix rows into summary blocks) and `docs/RELEASE_NOTES.md` (consolidating highlight sections into unified series blocks). diff --git a/docs/SDLC.md b/docs/SDLC.md index a526f63b6e..53a32228d1 100644 --- a/docs/SDLC.md +++ b/docs/SDLC.md @@ -73,7 +73,6 @@ Every significant feature, structural refactoring, or tooling upgrade begins wit 3. **Active Milestone GitHub Resource Population**: - When cutting a new release branch or activating a milestone, proactively create GitHub tracking issues for all scheduled features from [`docs/ROADMAP.md`](ROADMAP.md). - Link each issue to the active release milestone, apply declarative taxonomy labels (`type/*`, `scope/*`, `priority/*`), and synchronize to GitHub Projects v2 board (`https://github.com/dan-petty/devops-cli/projects`) and repository issue views (`https://github.com/dan-petty/devops-cli/issues/views`). - - The open issues queue (`https://github.com/dan-petty/devops-cli/issues?q=is%3Aissue+state%3Aopen`), projects tab (`https://github.com/dan-petty/devops-cli/projects`), and issue views (`https://github.com/dan-petty/devops-cli/issues/views`) must never be left empty while an active milestone exists with planned deliverables. 4. **Transparent Task Status Tracking**: - Maintain dynamic task status exclusively in isolated modular files under [`docs/agent/tasks/`](agent/tasks/README.md) (`task--.md`) divided into: - **Backlog / Ready**: Queued deliverables and scoped milestones. diff --git a/docs/SELF_IMPROVEMENT.md b/docs/SELF_IMPROVEMENT.md index a82618fc46..4e16ab4351 100644 --- a/docs/SELF_IMPROVEMENT.md +++ b/docs/SELF_IMPROVEMENT.md @@ -134,14 +134,14 @@ feedback loop that changes what it does once the defects are gone: 1. **Reactive remediation**: while invariant violations, failing tests or verified findings exist, an agent works on nothing else, with minimal, surgical fixes. -2. **Proactive quality elevation**: once `uv run devops ci` passes, the agent turns to headroom: - functions near the complexity cap ($7 \le M \le 10$) come down to $M \le 6$ and depth $\le 3$, - public interfaces get complete docstrings and type hints, and tests are brought to the - conventions in [`docs/TESTING.md`](TESTING.md). +2. **Proactive quality elevation**: once `uv run devops ci` passes, the agent gives public + interfaces complete docstrings and type hints. The agent also brings tests to the conventions in + [`docs/TESTING.md`](TESTING.md). 3. **Continuous self-hardening**: each struggle, failure, inconsistency, bad pattern or useful - idea becomes an issue (`devops gh issues create`), and a rule for agents goes into - [`AGENTS.md`](../AGENTS.md). `docs/ROADMAP.md` is rendered from GitHub at the cut and never - edited in an item's pull request ([ADR 0001](adr/0001-github-is-the-roadmap-source.md)). + idea becomes an issue (`devops gh issues create`), and a check that fails when the problem + returns guards it. A rule goes into [`AGENTS.md`](../AGENTS.md) only when no check is possible. + `docs/ROADMAP.md` is rendered from GitHub at the cut and never edited in an item's pull request + ([ADR 0001](adr/0001-github-is-the-roadmap-source.md)). --- diff --git a/docs/VISION.md b/docs/VISION.md index 7d8dafbfd9..62d9666499 100644 --- a/docs/VISION.md +++ b/docs/VISION.md @@ -19,7 +19,7 @@ The principles devops-cli is built on and the themes it is heading toward. This 13. **Cognitive Information Foraging & Syntopical Epistemic Hygiene**: Agents must read, research, and gather information with human-like cognitive discipline—prioritizing inspectional multi-scale outlines over monolithic token dumps, traversing information scent cues with backtracking, maintaining active marginalia, triangulating claims against ground-truth primary sources, and synthesizing syntopical mental models that resolve dialectical contradictions. 14. **Autonomous Agentic Project Governance & Grounded Lifecycle Orchestration**: Software delivery must be autonomously governed through closed-loop, agentic project management. Work items, review remediations, and architectural epics must be decomposed into atomic, traceable issues with grounded taxonomy, real-time board transitions across lifecycle states, explicit dependency tracking, and dynamic WIP budgeting to eliminate ungrounded development and project drift. 15. **Reactive Terminal Ergonomics & Unified Workstation Command Center**: The developer terminal is the primary operational canvas. Complex multi-cloud, container, AI, and project lifecycle telemetry must be synthesized into a reactive, high-density terminal user interface (TUI) with non-blocking async workers, master-detail split screens, live log streaming, and sub-second fuzzy command dispatch, eliminating context switching to fragmented web dashboards. -16. **Stochastic Language Bound by Deterministic Mechanical Oracles & Feedback Inversion**: Autonomous engineering velocity relies on pairing probabilistic LLM token generation with deterministic mechanical oracles (AST complexity parsers, negative JSON schema validation, POSIX process group containment, and pre-flight boundary limits). As quality gates reach 100% pass rates, feedback loops dynamically invert from reactive defect remediation to proactive architectural headroom optimization. +16. **Stochastic Language Bound by Deterministic Mechanical Oracles & Feedback Inversion**: Autonomous engineering velocity relies on pairing probabilistic LLM token generation with deterministic mechanical oracles (AST complexity parsers, negative JSON schema validation, POSIX process group containment, and pre-flight boundary limits). As quality gates reach 100% pass rates, feedback loops dynamically invert from reactive defect remediation to proactive quality elevation: complete docstrings, type hints and tests. ## Themes diff --git a/docs/agent/tasks/task-1874-convention-yields-to-open-tool.md b/docs/agent/tasks/task-1874-convention-yields-to-open-tool.md new file mode 100644 index 0000000000..ef3c13bba8 --- /dev/null +++ b/docs/agent/tasks/task-1874-convention-yields-to-open-tool.md @@ -0,0 +1,45 @@ +# Task: A Convention Yields to an Open Tool, and Rules With No Check or a Contradiction Are Pruned (#1874) + +**Issue**: [#1874](https://github.com/dan-petty/devops-cli/issues/1874) +**Scope**: type/docs, scope/docs, scope/ai +**Feasibility**: The author checked this on 2026-10-22. The author read the rules in `AGENTS.md` and searched `tests/` and `src/` for a check of each rule that the item deletes. No check exists for any of them. The author ran the replacement measures on this tree. The results are in the section "Feasibility Evidence". + +## Description + +`AGENTS.md` told an agent to name the open tool before it builds. The same file also told the agent to meet "all project standards and conventions" and not to relax "lint rules". No rule said which line wins. An agent that replaced a bespoke check with a standard tool read the swap as lowering a threshold, and kept the bespoke code. Some rules also contradicted each other, and the file had no room for a new rule. + +- **Precedence.** The bullet "Open Tools Before Internal Code" now says that a convention is never a reason to keep or write custom code. It also says that the bullet outranks every convention in the file. +- **Never lower.** The bullet "Continuous Standards Compliance" is merged into the bullet "Never Lower Security Standards or Quality Thresholds". The merged bullet keeps one sentence of the old bullet: "Every change meets the project standards." The merged bullet separates lowering a threshold from replacing a check with a tool. A tool replaces a check when it enforces at least the same property on this repository. The PR runs both checks once and shows both results. +- **Contradictions.** Agents run `intake --confirm` for their own new candidates, as the bullets on defect filing and roadmap synthesis say. The suspended-Service bullet now agrees with them. The bullet "Stop Rather Than Add Compensating Code" asks a person to run `roadmap return --confirm`, because that command stays with a person. The text that `devops ai agents` writes for this repository says the same. +- **Pruned rules.** The rule on `Gated` terminology, the headroom targets, the bullet on forward-looking project management and the section 1 naming bullet are gone. The sentence on an empty issue queue is gone from `AGENTS.md`, `docs/SDLC.md`, `docs/ROUTINE_TASKS.md`, the knowledge base guide `github_project_management.md` and the generator. The section 4 naming bullet keeps the naming rule. +- **Reworded rules.** The bullets on dispatch style, the Python ecosystem, secrets and root-cause remediation say what outcome they want. The secrets rule gives examples of a secret store, so its list is open. `docs/ROUTINE_TASKS.md` states the same outcome. +- **Shipped copy.** `devops ai agents` writes the never-lower bullet into other repositories. `src/devops_cli/ai/instruction_generator.py` now writes the new wording and no longer writes the continuous-compliance bullet. The generator also writes the new root-cause wording. +- **Linked guides.** `docs/SELF_IMPROVEMENT.md` and `docs/VISION.md` no longer state the deleted headroom targets. `docs/SELF_IMPROVEMENT.md` says that a check guards a recurring problem. It says that a rule goes into `AGENTS.md` only when no check is possible. +- Pending a person: apply the item that intake folded into this issue, "agents reach GitHub through the paced session and workflow steps use the runner's `gh`". The item changes the bullet "Strict Prohibition of Bare `gh` CLI Invocations". The GitHub request budget design changes that rule, so this PR leaves it as it is. The issue body does not list the item, so a person files it as its own issue. + +## Feasibility Evidence + +- **Size.** `AGENTS.md` had 39,954 characters. It has 38,850 after the change. The change frees 1,104 characters, and the cap is 40,000. +- **Gated terminology.** A search of `tests/` and `src/` finds no test or code that enforces the `Gated` terminology rule or the numbered-gate ban. +- **Headroom targets.** `uv run ruff check src --select C901` at a limit of 6 reports 371 functions. At the cap of 10 it reports none. The project collector `devops_cli.core.code_metrics` counts 557 functions deeper than 3 and none deeper than 5. Nothing enforced the targets, and the cap of 10 and 5 in the same file already bounded the code. +- **Empty queue.** A search of `tests/` and `src/` finds no check of the sentence on an empty issue queue. +- **Roadmap commands.** `uv run devops roadmap intake --help` shows that a candidate an agent files with `--title` and `--body-file` is labeled `source/agent` and held to the filing quota. The same help shows that intake without `--title` works on every open issue that is not on the board. The suspended-Service bullet keeps that second use with a person. +- **Replacement tools.** No check is replaced in this item. Every deleted rule had no check, so no pair of runs applies. The new text keeps the checks that exist: Ruff `C901` and `N`, the architectural invariant tests, `detect-private-key`, `bandit` and `tests/test_zero_plaintext_invariants.py`. +- **Secret stores.** ADR 0004 keeps the machine-account token in a cluster Secret. The repository also reads the GitHub token from the credential store of `gh`. The old text named only the OS keyring and Vault. + +## Acceptance Criteria + +- [x] `AGENTS.md` is 1,104 characters shorter than before the change, at 38,850 of 40,000. `tests/test_agents_md_claims.py` passes. +- [x] The compliance bullet is merged into the never-lower bullet, which keeps one sentence of it. The "Open Tools Before Internal Code" bullet carries the precedence sentences. +- [x] No line tells an agent to run a command that another line reserves for a person. This holds for `AGENTS.md` and for the generator. +- [x] The generator no longer writes the continuous-compliance bullet, and its never-lower bullet separates lowering from replacing. +- [x] No document keeps the empty-queue sentence or the headroom targets. +- [x] `uv run devops docs check` finds the generated documents current. +- [x] `devops ci` passes. + +## Deliverables + +- [x] `AGENTS.md`: the precedence sentences, the merged never-lower bullet, the pruned rules and the reworded rules. +- [x] `src/devops_cli/ai/instruction_generator.py` and `tests/test_instruction_generator.py`: the new never-lower, root-cause and `roadmap return` wording, and the deleted continuous-compliance bullet and empty-queue sentence. +- [x] `docs/ROUTINE_TASKS.md`, `docs/SDLC.md`, `docs/SELF_IMPROVEMENT.md`, `docs/VISION.md` and `src/devops_cli/ai/knowledge_base/devops_cli/tasks/github_project_management.md`: the matching statements. +- [x] `docs/agent/tasks/task-1874-convention-yields-to-open-tool.md` and `changelog.d/1874.md`. diff --git a/src/devops_cli/ai/instruction_generator.py b/src/devops_cli/ai/instruction_generator.py index 46165d42fb..b5f7caf0fd 100644 --- a/src/devops_cli/ai/instruction_generator.py +++ b/src/devops_cli/ai/instruction_generator.py @@ -224,7 +224,7 @@ def generate_agents_md(meta: ProjectMetadata) -> str: " - Inspect liveness via `kubectl -n devops get deployment roadmap-service` or HTTP probe `GET /readyz` on port 8000; fall back to manual execution only if confirmed offline.\n" " - **Feasibility Check & Stop Rather Than Add Compensating Code ([#1348](https://github.com/dan-petty/devops-cli/issues/1348))**:\n" " - Before authoring code or tests, perform a feasibility check confirming the premise against the real system (upstream docs, library source, cluster state, CLI runtime) and record how in the task file's `**Feasibility**` field.\n" - ' - When an item cannot be built as specified, or requires an architectural refactor beyond its scope, write no compensating code. Comment on the issue with the evidence and proposed re-scope/refactor, return the item to `New` (`devops roadmap return --comment "" --confirm`, which supports `--dry-run`), and stop.\n' + ' - When an item cannot be built as specified, or requires an architectural refactor beyond its scope, write no compensating code. Comment on the issue with the evidence and proposed re-scope/refactor, ask a person to return the item to `New` (`devops roadmap return --comment "" --confirm`), and stop.\n' " - Signals to stop rather than add code: swallowing an error; product code that detects tests; a second fix on top of a fix in the same area within one release; a review loop that keeps finding new defects in the same feature.\n" if meta.is_devops_cli else "" @@ -322,13 +322,8 @@ def generate_agents_md(meta: ProjectMetadata) -> str: guides (`src/devops_cli/ai/knowledge_base/` or `docs/`) before designing, implementing, or modifying system components. - **Never Lower Security Standards or Quality Thresholds**: AI agents and assistants must never - lower, relax, disable, bypass, or weaken security standards, quality thresholds (such as minimum - code coverage requirements like 90%, strict static type checks, or lint rules), or compliance - validations unless explicitly instructed to do so by the user. -- **Continuous Standards Compliance & Solution Refinement**: AI agents and assistants must always check - that any proposed solution, design, code change, or architecture meets all project standards and - conventions, updating and refining the solution whenever necessary until every project standard - is met or exceeded. + lower, relax, disable or bypass a security standard or quality threshold unless the user says so. + Replacing a check with a standard tool that enforces at least the same property is not lowering it. - **Mandatory Documentation Synchronization After Every Change**: AI agents and assistants must always update project documents, architecture references, command documentation, and README files (`devops docs generate --sync-readme`, `docs/`, `AGENTS.md`, and relevant knowledge base task manuals) @@ -355,9 +350,9 @@ def generate_agents_md(meta: ProjectMetadata) -> str: replacing features, schemas, configurations, or interfaces, implement clean, complete solutions and ruthlessly remove obsolete code, variables, aliases, fallback shims, and legacy workarounds. Never leave remnants or vestigial fallback paths. -- **Mandatory Root-Cause Remediation & Instruction Hardening (Fix Underlying Cause / Prevent Recurrence)**: - - Whenever encountering any problem, bug, defect, failure, runtime exception, or unexpected error, AI agents and automated workflows **MUST ALWAYS INVESTIGATE AND FIX THE CAUSE OF THE UNDERLYING ISSUE** directly at its source. Applying superficial workarounds, bypassing assertions, suppressing warnings, or masking symptoms without remediating the root cause is strictly prohibited. - - If the underlying issue cannot be fixed immediately (such as an external dependency bug, upstream platform constraint, environment limitation, or fundamental architectural blocker), the agent **MUST PROMPTLY UPDATE AGENT INSTRUCTIONS (`AGENTS.md`)** with defensive guardrails, pre-flight checks, avoidance patterns, or operational guidelines to prevent the issue from re-occurring in future sessions. +- **Mandatory Root-Cause Remediation**: Investigate and fix the cause at the source. If an external + constraint blocks the fix, add a check that fails when the problem returns, and link the incident. + Add prose here only when no check is possible. {devops_roadmap_governance_block}- **Continuous Interaction & Collaborative Value Improvement (Proactive Improvement Suggestions)**: - In every interaction with the user, peer agents, or development workflows, AI agents must actively look for and suggest concrete, actionable ways to improve developer ergonomics, workflow speed, system resilience, documentation clarity, test coverage, and tooling efficiency whenever relevant. @@ -414,7 +409,7 @@ def generate_agents_md(meta: ProjectMetadata) -> str: 6. Re-run `devops pr monitor ` until exit code 0 is achieved. - **Merge Readiness Guarantee**: A PR is ONLY ready for merging when `devops pr monitor` exits with code 0: all CI checks are 100% green, Copilot review session is settled (on PRs into `main`), and 0 unresolved review discussion threads remain. - **GitHub Projects, Issues & Views Governance**: - - Proactively author and populate tracking issues for all scheduled roadmap deliverables upon milestone activation; the open issues queue (`issues?q=is:issue+state:open`), projects tab (`projects`), and issue views (`issues/views`) must never be left empty. + - Proactively author and populate tracking issues for all scheduled roadmap deliverables upon milestone activation. - Link project boards conforming to `.github/project-template.json` to the repository (`devops gh project link `) and reconcile custom fields on the cards already on the board via `devops gh project sync` (sets Status only on a card that has none, from its `status/*` label or else `New`, sets `Done` when the issue closes, and forces `In Review` once any open PR, draft included, links the issue). Sync adds no card: `devops roadmap intake` places issues, and a pull request gets no card. - Enforce strict remote branch lifecycle: every remote topic branch on `origin` must have an associated open PR, and merged or superseded branches must be deleted immediately. - Respect GitHub API rate limits: monitor `devops gh rate-limit`, adaptively fall back to REST when GraphQL complexity limits are reached, avoid unthrottled polling, and honor `Retry-After` reset windows. diff --git a/src/devops_cli/ai/knowledge_base/devops_cli/tasks/github_project_management.md b/src/devops_cli/ai/knowledge_base/devops_cli/tasks/github_project_management.md index 659a14e9e4..fdc48427ae 100644 --- a/src/devops_cli/ai/knowledge_base/devops_cli/tasks/github_project_management.md +++ b/src/devops_cli/ai/knowledge_base/devops_cli/tasks/github_project_management.md @@ -164,9 +164,8 @@ devops gh milestones close v0.2.14 - Reconcile and sync add no card: `devops roadmap intake` places issues, and a pull request gets no card, its progress showing on its issue's card. - `devops gh project reconcile --plan` lists every change with its old and new value and the source that decided it; `--dry-run` makes no request and lists the requests a run makes. A planned value the board's field has no option for is refused before any write, naming the value and the options. A run that stops early (mutation budget, GraphQL quota or a failed write) says why and how many planned changes remain, and exits 1; running it again continues from there, after the reset for a quota stop and once the cause is fixed for a failed write. - Run `devops gh project sync` (or FastMCP `gh_project_sync`) after creating issues, pushing branches, or opening PRs to keep the cards' fields up to date. -6. **Active Milestone Resource Population & Zero-Empty Queue/Projects Policy**: +6. **Active Milestone Resource Population**: - When initializing a new release branch or activating a milestone, AI agents must proactively author GitHub tracking issues for every planned deliverable in `docs/ROADMAP.md`. - - The open issues queue (`https://github.com/dan-petty/devops-cli/issues?q=is%3Aissue+state%3Aopen`), projects tab (`https://github.com/dan-petty/devops-cli/projects`), and issue views (`https://github.com/dan-petty/devops-cli/issues/views`) must never be left empty during an active release cycle. - Each issue must follow Conventional Commits (`feat(): ...`), assign the milestone (`vX.Y.Z`), and include mandatory taxonomy labels (`type/*`, `scope/*`, `priority/*`). 7. **Strict Remote Branch Lifecycle & PR Governance**: - **Sequential PR Processing (Oldest to Newest / FIFO)**: When multiple open PRs exist across the repository or targeting an active release branch, AI agents MUST process and shepherd PRs in strict chronological order from oldest to newest (FIFO queue: lowest PR number / earliest creation date first). Remediating review comments, fixing CI checks, resolving merge conflicts, and verifying merge readiness on older PRs strictly takes precedence over newer PRs. diff --git a/tests/test_instruction_generator.py b/tests/test_instruction_generator.py index f9ba3cf52a..3301421409 100644 --- a/tests/test_instruction_generator.py +++ b/tests/test_instruction_generator.py @@ -394,9 +394,10 @@ def test_generate_agents_md_root_cause_roadmap_and_interaction_tenets() -> None: ) generic_content = generate_agents_md(generic_meta) generic_expected = ( - "Mandatory Root-Cause Remediation & Instruction Hardening", - "INVESTIGATE AND FIX THE CAUSE OF THE UNDERLYING ISSUE", - "UPDATE AGENT INSTRUCTIONS (`AGENTS.md`)", + "Mandatory Root-Cause Remediation", + "Investigate and fix the cause at the source.", + "add a check that fails when the problem returns", + "Add prose here only when no check is possible.", "Continuous Interaction & Collaborative Value Improvement", "suggest concrete, actionable ways to improve", ) @@ -424,7 +425,7 @@ def test_generate_agents_md_root_cause_roadmap_and_interaction_tenets() -> None: "budget/borrowed", "open_issue_limit", "Feasibility Check & Stop Rather Than Add Compensating Code", - "devops roadmap return", + "ask a person to return the item to `New` (`devops roadmap return ", ) missing_devops = [p for p in devops_expected if p not in devops_content] # Intake is the one way in (#742): the ingestion rules that filed straight into a release