diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 8b30509..30b7211 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -7,8 +7,10 @@ labels: "" **What was run** -**Host and version** - +**Host** (name and version) + +**Abacus version** + **Expected** diff --git a/.github/ISSUE_TEMPLATE/idea.md b/.github/ISSUE_TEMPLATE/idea.md index 94c7c35..ac6b3f3 100644 --- a/.github/ISSUE_TEMPLATE/idea.md +++ b/.github/ISSUE_TEMPLATE/idea.md @@ -5,8 +5,10 @@ labels: "" --- **Problem** + **Proposed change** + --- diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0bf3013..d88741e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,6 +9,4 @@ ## Checklist - [ ] Follows the rules in AGENTS.md -- [ ] `CHANGELOG.md` entry under `[Unreleased]`, or not user-facing -- [ ] `flow-map.md` updated if the flow changed -- [ ] `python3 scripts/validate.py` and `python3 -m unittest discover -s tests` pass +- [ ] The [pre-PR checklist](https://github.com/Gamebreack/Abacus/blob/main/CONTRIBUTING.md#before-you-open-a-pull-request) is done diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 2218e68..4db07e0 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 + with: + persist-credentials: false - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: "3.12" diff --git a/AGENTS.md b/AGENTS.md index 0f836fc..5080e3b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,11 +1,11 @@ # Abacus — repo rules -This repo holds the `progress-display` Agent Skill (ending status messages with a progress block: a header bar plus a ✓ ● ○ checklist) and a standard-library validator for it. The skill is written but not released yet. +This repo holds the `progress-display` Agent Skill (ending status messages with a progress block: a header bar plus a ✓ ● ○ checklist) and a standard-library validator for it. First release: v0.1.0. ## Hard rules - No commits, pushes, tags, releases or remote changes without explicit operator authorization. Workers never commit or push. Before committing, run the pre-commit hooks; never use `--no-verify`. -- Feature branches merge into a single development branch (`dev`); only `dev` is pushed and PRed to `main`. +- Maintainers: feature branches merge into a single development branch (`dev`); only `dev` is pushed and PRed to `main`. Outside contributors open the PR from a fork. - The skill under `skills/progress-display/` stays host-agnostic: no host, harness, agent-type, model or provider names, and no runner or adapter. - The skill name stays lowercase `progress-display` (Agent Skills naming). The project and repository are called Abacus. - One home per fact: link instead of copying. @@ -15,12 +15,7 @@ This repo holds the `progress-display` Agent Skill (ending status messages with ## Required checks -These must pass before merge and before release: - -```bash -python3 scripts/validate.py -python3 -m unittest discover -s tests -``` +The commands are in [CONTRIBUTING.md](CONTRIBUTING.md#required-checks); they must pass before merge and release. ## Planning diff --git a/CHANGELOG.md b/CHANGELOG.md index a7ad680..4787415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,18 @@ # Changelog -All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html); see CONTRIBUTING.md (Releasing). +All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html); see [CONTRIBUTING.md](CONTRIBUTING.md) (Releasing). ## [Unreleased] +## [0.1.0] - 2026-11-29 + +First release. + ### Added -- Repository scaffold. -- The `progress-display` skill: when to end a status message with a progress block, the header and checklist format, bar math, and the short-reply case. -- Validator content check `bars`: every example header bar in SKILL.md is 20 cells and matches its done/total and percent, with tests that prove it fails. - -### Changed -- README links to the skill instead of copying its format. -- The `bars` check covers SKILL.md only and rejects a nonzero done count with a zero total, or done above total. -- `flow-map.md` stamp points at the commit that contains the skill. +- **The `progress-display` skill:** ends each status message during multi-step work with a progress block: a header with a 20-cell bar, percent and current state, then a checklist of every item. +- **Validator content check `bars`:** checks the example header bar in the skill and in the README: 20 cells, halves rounded up, matching done/total and percent, and a state after ` · `. `0/0` is the only zero-total form. +- **Repository tooling:** standard-library validator (frontmatter, links, content check) with tests; pre-commit and push hooks (secret scan, `.env` and home-path guards, doc line limits); a SHA-pinned CI workflow. +- **Docs:** README with a diagram and a sample, `flow-map.md`, CONTRIBUTING and SECURITY, the MIT LICENSE, and issue and pull request templates. + +[Unreleased]: https://github.com/Gamebreack/Abacus/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/Gamebreack/Abacus/releases/tag/v0.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ca38dc8..132ad67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,43 +1,104 @@ # Contributing -## How to propose a change +Thanks for helping. This guide takes you from a clone to a pull request. The [rules in AGENTS.md](AGENTS.md) apply to every change and are not repeated here. -1. For anything beyond a small fix, open an issue first and describe the problem. -2. Then open a pull request against `main`. Every change lands through a pull request. +## Where to go -## Branches +| You want to… | Go to | +|---|---| +| Report a bug | [Bug issue](https://github.com/Gamebreack/Abacus/issues/new?template=bug.md) | +| Suggest an improvement | [Idea issue](https://github.com/Gamebreack/Abacus/issues/new?template=idea.md) | +| Report a security problem | [SECURITY.md](SECURITY.md), privately, never as a public issue | +| See what changed | [CHANGELOG.md](CHANGELOG.md) | -Work happens on feature branches, which stay local. They merge into a single development branch (`dev`); only `dev` is pushed and opened as a pull request against `main`. Branch protection is not available for this repository, so the model relies on discipline. +## Quick start -## Rules a change must keep +| Step | Command or action | +|---|---| +| 1. Get the code | Maintainers: `git clone https://github.com/Gamebreack/Abacus.git`. Outside contributors: fork first, then `git clone https://github.com//Abacus.git` | +| 2. Install the hooks (once per clone) | `cd Abacus`, then `pre-commit install` (needs [pre-commit](https://pre-commit.com)) | +| 3. Make the change | on a feature branch | +| 4. Run the checks | the [required checks](#required-checks) | +| 5. Propose it | for anything beyond a small fix, open an issue first; then open a pull request against `main` (maintainers from `dev`, contributors from their fork) | -Every change keeps the rules in [AGENTS.md](AGENTS.md). They are not repeated here. +## Required checks -## Testing a change - -Both checks must pass before merge; CI runs them on every push and pull request: +CI runs these two commands. They must pass before merge and before release. Python 3.9 or later. ```bash python3 scripts/validate.py python3 -m unittest discover -s tests ``` -`validate.py` needs Python 3.9 or later. +## How a change flows + +The diagram shows the maintainer path. Solid lines are every change; the dashed box is a release. Branch protection is not available for this repository, so the flow relies on discipline. + +```mermaid +%%{init: {"theme":"base","themeVariables":{"fontFamily":"system-ui, -apple-system, Segoe UI, sans-serif","fontSize":"15px","primaryTextColor":"#1b221e","lineColor":"#8a968f","clusterBkg":"transparent","clusterBorder":"#b7c0ba","titleColor":"#5d6962","edgeLabelBackground":"#ffffff"},"flowchart":{"curve":"basis","nodeSpacing":22,"rankSpacing":30,"padding":14,"htmlLabels":true}}}%% +flowchart LR + F["Feature branch
local only"] + H["Commit hooks
secrets, limits, validator"] + D["dev
the one pushed branch"] + P["Pull request
CI + review"] + M["main"] + R["Release
tag + GitHub release"] + + F --> H + H -->|"merge"| D + D -->|"push hook, PR"| P + P -->|"merge"| M + %% 4: optional + M -.->|"when releasing"| R + + classDef p1 fill:#dbe8f6,stroke:#4a7fb5,color:#1b221e + classDef p2 fill:#fbefd2,stroke:#c3962c,color:#1b221e + classDef p3 fill:#d8eee2,stroke:#3f8f68,color:#1b221e + classDef side fill:#f5f6f5,stroke:#a9b4ad,color:#5d6962,stroke-dasharray:4 3 + class F,H p1 + class D,P p2 + class M p3 + class R side + linkStyle 4 stroke:#8a968f,stroke-width:1.5px,stroke-dasharray:2 3 +``` + +**Branches:** the branch rule is in [AGENTS.md](AGENTS.md#hard-rules). + +## Before you open a pull request -## Git hooks +- [ ] All [required checks](#required-checks) pass +- [ ] `pre-commit run --all-files` passes, without bypassing hooks ([hard rules](AGENTS.md#hard-rules)) +- [ ] `CHANGELOG.md` has an entry under `[Unreleased]`, or the change is not user-facing +- [ ] The [hard rules in AGENTS.md](AGENTS.md#hard-rules) hold (including the flow-map rule) -This repo uses [pre-commit](https://pre-commit.com), which must be installed; then run `pre-commit install` once per clone; it installs both the commit and the push hooks. The commit hooks scan for secrets, reject `.env` files and a root `CONTEXT.md` (local planning stays local), fix whitespace and YAML hygiene, enforce the line limits, reject absolute home paths, and run the validator. The push hook (`scripts/hooks/pre_push.sh`) rejects tracked `.env` files, a root `CONTEXT.md` and absolute home paths across all tracked files and in the commits of the pushed branch (pre-commit passes one range per push), then re-runs the line limits, the validator and the tests. Run the commit hooks on everything with `pre-commit run --all-files`, and never bypass them with `--no-verify`. +## What the hooks check + +Hooks run on commit and on push. Fix what they report. + +| Hook | When | What it does | +|---|---|---| +| Secret scan (gitleaks) | commit | blocks credentials and tokens | +| `.env` and `CONTEXT.md` guards | commit | keeps environment files and local planning out of git | +| Hygiene | commit | trailing whitespace, end of file, YAML, merge markers, large files | +| Line limits | commit | doc line limits (see AGENTS.md) | +| Portability guard | commit | no absolute home paths | +| Validator | commit | frontmatter, links and the skill's content check | +| `scripts/hooks/pre_push.sh` | push | checks the checkout and the pushed commits for `.env` files, a root `CONTEXT.md` and home paths, then runs the line limits, the validator and the tests | ## Versioning -Versions are SemVer tags only, applied to the skill's behavior: +Versions are SemVer tags only (for example `v0.1.0`), applied to the skill's behavior: -- **Patch:** wording and fixes that do not change what the skill asks of an agent. -- **Minor:** new or changed behavior or rules. -- **Major:** a breaking change to what the skill asks of an agent. +| Bump | When | +|---|---| +| Patch | wording and fixes that do not change what the skill asks of an agent | +| Minor | new or changed behavior or rules | +| Major | a breaking change to what the skill asks of an agent | ## Releasing +For maintainers. Work through the steps in order; each one gates the next. + 1. In a pull request, move the `[Unreleased]` entries in `CHANGELOG.md` under `## [X.Y.Z] - YYYY-MM-DD` and update the compare links. 2. Run pre-release verification on that pull request while it is up to date with `main`: a fresh verifier run plus an independent review panel (for example the `verify` skill). Merge only with no open BLOCKER or SHOULD-FIX finding. If anything else lands on the pull request or on `main` afterwards, run it again. 3. Only with the operator's approval, which covers this step and the next: after the pull request merges, create the annotated tag `vX.Y.Z` on the merge commit and push it. diff --git a/README.md b/README.md index bc30c65..31c513f 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,82 @@ # Abacus — progress blocks for status messages -Abacus holds `progress-display`, an optional Agent Skill: it makes an agent end its status messages with a progress block, so you always see where the whole job stands. +[![Latest release](https://img.shields.io/github/v/release/Gamebreack/Abacus)](https://github.com/Gamebreack/Abacus/releases) +[![License: MIT](https://img.shields.io/github/license/Gamebreack/Abacus)](LICENSE) +[![Validate](https://github.com/Gamebreack/Abacus/actions/workflows/validate.yml/badge.svg)](https://github.com/Gamebreack/Abacus/actions/workflows/validate.yml) -> **Status: skill written, not released.** `skills/progress-display/SKILL.md` holds the rules. It is not yet wired into `mao-setup`, and nothing here is tagged or released. +Abacus holds `progress-display`, an optional Agent Skill for long, multi-step agent work, where it is easy to lose track of where the whole job stands. During multi-step work the agent ends every status message with a small progress block, so one glance at the bottom of the message tells you how far along things are and what is still open. -## What it does +> **Status:** v0.1.0 is the first release. See [CHANGELOG.md](CHANGELOG.md). -It ends each status message with a block: a header line with a 20-cell bar, then one checklist line per item. The exact format, bar math and short-reply case live in one place, [`skills/progress-display/SKILL.md`](skills/progress-display/SKILL.md); the path through them is drawn in [flow-map.md](flow-map.md). +## What you get + +- **The whole job at a glance**: the full work list, not just the step the agent is on right now. +- **Always in the same place**: during multi-step work the block closes every status message, including ones that ask a question or need your approval. +- **Honest progress**: the block mirrors the real state of the work, so it does not drift or overstate. +- **A stable list**: items keep their order from turn to turn, and changes to the list are called out. +- **Not a tracker**: it never replaces your backlog, issue tracker or plan. +- **Portable**: plain Markdown instructions. No runner, no adapters, no required host, model or service. + +## What it looks like + +A status message opens with the bottom line, then ends with the block. Sample output; the exact format and bar math live in the skill, and the validator checks this sample against them: [SKILL.md](skills/progress-display/SKILL.md#2-format). + +``` +4/7 steps [███████████░░░░░░░░░] 57% · Verifying + ✓ Back up the existing files + ✓ Update the configuration + ✓ Rename the old modules + ✓ Update the docs + ● Run the checks + ○ Record the changes + ○ Open the pull request +``` + +## How it works + +The full flow, checked against the skill: [flow-map.md](flow-map.md). + +```mermaid +%%{init: {"theme":"base","themeVariables":{"fontFamily":"system-ui, -apple-system, Segoe UI, sans-serif","fontSize":"15px","primaryTextColor":"#1b221e","lineColor":"#8a968f","clusterBkg":"transparent","clusterBorder":"#b7c0ba","titleColor":"#5d6962","edgeLabelBackground":"#ffffff"},"flowchart":{"curve":"basis","nodeSpacing":22,"rankSpacing":30,"padding":14,"htmlLabels":true}}}%% +flowchart LR + M["Status message
during multi-step work"] + B["Bottom line
short, comes first"] + H["Header bar
done out of total"] + C["Checklist
every item in the list"] + U["Updated every turn
mirrors the real state"] + + M --> B + B --> H + H --> C + C --> U + %% 5: optional + U -.->|"next message"| M + + classDef p1 fill:#dbe8f6,stroke:#4a7fb5,color:#1b221e + classDef p2 fill:#fbefd2,stroke:#c3962c,color:#1b221e + classDef p3 fill:#d8eee2,stroke:#3f8f68,color:#1b221e + class M,B p1 + class H,C p2 + class U p3 + linkStyle 4 stroke:#8a968f,stroke-width:1.5px,stroke-dasharray:2 3 +``` ## Install -The skill follows the [Agent Skills](https://agentskills.io) format: a folder with a `SKILL.md`. Manual install: copy `skills/progress-display/` into the skills folder your agent harness reads. +The skill follows the [Agent Skills](https://agentskills.io) format: a folder with a `SKILL.md`. Put `skills/progress-display/` wherever your host discovers skills, or give `SKILL.md` to an agent directly. + +```bash +git clone --branch v0.1.0 --depth 1 https://github.com/Gamebreack/Abacus.git +# then copy or symlink Abacus/skills/progress-display into your host's skills directory +``` ### With MAO -Planned: [multi-agent-orchestration](https://github.com/Gamebreack/multi-agent-orchestration) (MAO) `mao-setup` will offer the skill as an optional y/N install, like its other optional skills. This is not wired into `mao-setup` yet. +[multi-agent-orchestration](https://github.com/Gamebreack/multi-agent-orchestration) (MAO) `mao-setup` offers the skill as an optional y/N install, like its other optional skills, once [PR #17](https://github.com/Gamebreack/multi-agent-orchestration/pull/17) there is merged. Until then, copy it by hand as above. + +## Works well with + +It pairs well with `session-modes` ([Janus](https://github.com/Gamebreack/Janus)) and `item-report` ([Herald](https://github.com/Gamebreack/Herald)), but needs neither. ## Repository layout diff --git a/SECURITY.md b/SECURITY.md index e51f68d..01ba892 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,18 +1,44 @@ # Security policy +## Contents + +| Question | Answer | +|---|---| +| Which versions get fixes? | [Supported versions](#supported-versions) | +| Where do I report? | [How to report](#how-to-report) | +| When will I hear back, and how is it fixed? | [What to expect](#what-to-expect) | + ## Supported versions -Nothing is released yet. Once a release exists, only the latest minor release receives fixes. +Only the latest minor release gets fixes. + +| Version | Supported | +|---|---| +| 0.1.x | yes | -## Reporting a vulnerability +## How to report -Report privately through GitHub: **Security → Report a vulnerability** on [Gamebreack/Abacus](https://github.com/Gamebreack/Abacus/security/advisories/new). Do not open a public issue for a security problem. +1. Open a private report on [Gamebreack/Abacus](https://github.com/Gamebreack/Abacus/security/advisories/new): **Security → Report a vulnerability**. +2. Include the skill version, the host you ran it in, the inputs that trigger the problem (with secrets and private paths redacted), and what happened. -Include the skill version, the host you ran it in, the inputs that trigger the problem (with secrets and private paths redacted), and what happened. You will get an acknowledgement within 7 days. Fixes ship as a patch release, credited in the changelog unless you ask otherwise. +> Do not describe a security problem in a public issue or pull request. + +## What to expect + +1. An acknowledgement within 7 days. +2. A patch release with the fix. +3. Credit in the changelog, unless you ask otherwise. ## What counts -Abacus is instructions, not code: it runs only through the agent and harness that load it. A security issue here is wording that leads a compliant agent to an unsafe action, for example guidance that makes it print secrets or private paths, act beyond its approved scope, skip an approval step, or claim a result without evidence. +Abacus (the `progress-display` skill) is instructions, not code. It runs only through the agent and harness that load it, so a security issue is wording that leads a compliant agent to an unsafe action. + +| Counts: report privately | Does not count: use the normal channel | +|---|---| +| Guidance that makes the agent print secrets or private paths | An ordinary bug with no security effect: use the [bug issue](https://github.com/Gamebreack/Abacus/issues/new?template=bug.md) | +| Guidance that makes the agent act beyond its approved scope | A suggestion: use the [idea issue](https://github.com/Gamebreack/Abacus/issues/new?template=idea.md) | +| Guidance that makes the agent skip an approval step | A host, harness or model behaving badly: see [Out of scope](#out-of-scope) | +| Guidance that makes the agent claim a result without evidence | | `scripts/validate.py` runs `git ls-files` read-only in the repository and reads Markdown; it executes no content from the skill. diff --git a/flow-map.md b/flow-map.md index 6c9ef2d..22cadf5 100644 --- a/flow-map.md +++ b/flow-map.md @@ -4,7 +4,7 @@ The path through the `progress-display` skill, from A (agent has a status to sen Renders on GitHub and claude.ai; VS Code needs a Mermaid extension. -> **Status:** reviewed by a fresh agent; not rendered. Every stage below exists in `skills/progress-display/SKILL.md`. There is no code to run: the skill is instructions the agent follows. Nothing is released, and the skill is not wired into `mao-setup`. +> **Status:** reviewed by a fresh agent; not rendered. Every stage below exists in `skills/progress-display/SKILL.md`. First release: v0.1.0. `mao-setup` offers it as an optional skill once that change lands in MAO; until then, installing it is a manual copy. > Lines: solid = exists · red dashed or red band = missing · dotted = optional or read-only · "no code yet" (or "not described") box = missing stage · grey = outside the target · light grey dashed box = side path ## 1. What happens @@ -104,4 +104,4 @@ sequenceDiagram When the flow changes, the map changes in the same PR. -Updated 2026-11-29 · Abacus feature/b01-write-skill 0c04c89 +Updated 2026-11-29 · Abacus main d97cdba diff --git a/scripts/validate.py b/scripts/validate.py index 74dd454..2383859 100644 --- a/scripts/validate.py +++ b/scripts/validate.py @@ -5,7 +5,7 @@ frontmatter SKILL.md has a name equal to its folder and a description; values are strict YAML (a plain scalar may not contain ": " or start with an indicator character). links every relative Markdown link in tracked files resolves. - bars every example header bar in SKILL.md is 20 cells and matches its done/total and percent. + bars every example header bar (SKILL.md, README.md) is 20 cells and matches its done/total and percent. Usage: python3 scripts/validate.py [--root PATH] Exit status is 0 when every check passes, 1 otherwise. @@ -134,7 +134,9 @@ def check_links(root: Path) -> list[str]: errors.append(f"{rel}: broken link {target}") return errors -BAR_RE = re.compile(r"(\d+)/(\d+) \S+ \[([^\]]*)\] (\d+)%") +BAR_RE = re.compile(r"(\d+)/(\d+) \S+ \[([^\]]*)\] (\d+)% \u00b7 \S") +CANDIDATE_RE = re.compile(r"^\s*\d+/\d+ \S+ \[", re.M) +BAR_FILES = (SKILL, Path("README.md")) def half_up(done: int, total: int, scale: int) -> int: @@ -142,12 +144,19 @@ def half_up(done: int, total: int, scale: int) -> int: def check_bars(root: Path) -> list[str]: - """Every example header bar is 20 cells and matches its done/total and percent.""" + """Every example header bar (SKILL.md and README.md samples) is 20 cells and matches its + done/total and percent; each file must have one; a header-like line that does not parse fails.""" errors = [] - for rel in (SKILL,): - bars = BAR_RE.findall(read(root, rel)) - if rel == SKILL and not bars: + for rel in BAR_FILES: + if not (root / rel).is_file(): + errors.append(f"{rel}: missing; it must hold an example header bar") + continue + text = read(root, rel) + bars = BAR_RE.findall(text) + if not bars: errors.append(f"{rel}: no example header bar found") + if len(CANDIDATE_RE.findall(text)) != len(bars): + errors.append(f"{rel}: a header-like line does not match the bar format") for done_s, total_s, bar, pct_s in bars: done, total, pct = int(done_s), int(total_s), int(pct_s) where = f"{rel}: {done}/{total}" diff --git a/tests/test_content.py b/tests/test_content.py index 9870ffc..6c09a91 100644 --- a/tests/test_content.py +++ b/tests/test_content.py @@ -76,3 +76,29 @@ def test_zero_total_passes(self): def test_done_over_total_fails(self): self.edit(SKILL, self.BAR, "7/6 steps [" + "\u2588" * 20 + "] 100%") self.assertReports(validate.check_bars, "exceeds total") + + README = validate.Path("README.md") + + def readme_bar(self): + text = (self.root / self.README).read_text(encoding="utf-8") + return validate.BAR_RE.search(text).group(0) + + def test_readme_sample_drift_fails(self): + bar = self.readme_bar() + self.edit(self.README, bar, bar.replace("57%", "58%")) + self.assertReports(validate.check_bars, "README.md: 4/7: expected 57%") + + def test_readme_malformed_header_fails(self): + bar = self.readme_bar() + self.edit(self.README, bar, bar.replace(" 57%", " 57")) + self.assertReports(validate.check_bars, "header-like line") + + def test_readme_sample_removed_fails(self): + self.edit(self.README, self.readme_bar(), "Sample removed.") + self.assertReports(validate.check_bars, "README.md: no example header bar found") + + def test_missing_state_suffix_fails(self): + text = (self.root / self.README).read_text(encoding="utf-8") + line = next(l for l in text.splitlines() if validate.BAR_RE.search(l)) + self.edit(self.README, line, line[: line.index("%") + 1]) + self.assertReports(validate.check_bars, "header-like line")