Skip to content
Draft
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
21 changes: 20 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
version: 2
updates:
# Cooldowns do not delay Dependabot security updates.
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
groups:
uv-minor-and-patch:
update-types:
- "minor"
- "patch"
cooldown:
default-days: 3
commit-message:
prefix: "chore(deps)"

- package-ecosystem: "pip"
directory: "/website"
schedule:
interval: "weekly"
cooldown:
default-days: 3
commit-message:
prefix: "chore(deps)"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
github-actions-minor-and-patch:
update-types:
- "minor"
- "patch"
cooldown:
default-days: 3
commit-message:
prefix: "chore(deps)"

# npm updates require running `npm --prefix ui run build` and committing built assets (checked by CI drift job)
# npm updates require rebuilding the committed UI with `npm --prefix ui run build` as described in docs/development/ci.md (Dependency updates); CI checks for drift
- package-ecosystem: "npm"
directory: "/ui"
schedule:
interval: "weekly"
cooldown:
default-days: 3
open-pull-requests-limit: 2
groups:
ui-dependencies:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ jobs:
- run: uv run --no-sync ruff format --check
- run: uv run --no-sync pyright
- run: uvx --from actionlint-py==1.7.12.25 actionlint
- run: uvx zizmor@1.32.0 --offline --min-severity medium .github/workflows
- run: uvx zizmor@1.32.0 --offline --min-severity low .github/workflows
# Dogfood: the example's fixed route must pass `pytest --sharpit`, its planted N+1 must fail it.
- run: uv run --no-sync python -c "import os, sys; os.makedirs(sys.argv[1], exist_ok=True)" "${{ runner.temp }}/speed" # the speed plugins write here
- run: uv run --no-sync python -m pytest examples/fastapi_sqla/tests_gate -k fixed --sharpit --sharpit-junit=sharpit-junit.xml -p scripts.pytest_speed.fixture_timer --fixture-times="${{ runner.temp }}/speed/ft-fixed.jsonl" -p scripts.pytest_speed.rebuild_log --rebuild-log="${{ runner.temp }}/speed/rb-fixed.json" --junitxml="${{ runner.temp }}/junit-fixed.xml"
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/security-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: security-audit
on:
schedule:
- cron: "17 5 * * 2"
workflow_dispatch:

permissions: {}

jobs:
zizmor:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
- name: Audit workflows with zizmor
run: uvx zizmor@1.32.0 --format sarif .github/workflows > zizmor.sarif || true # Findings produce SARIF and a non-zero status.
env:
GH_TOKEN: ${{ github.token }}
- uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
sarif_file: zizmor.sarif
category: zizmor
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ to loosen. Change a rule only in that test and here, in the same PR, with the re
- **Port BootUI, do not reinvent** (owner, 2026-11-12: "whatever we can directly port from BootUI we should; we don't
need to recreate anything, just rewrite and adapt"). Before writing any code for a feature, read BootUI's own source
for it at the pinned tag, in a BootUI clone, not this repo (`git -C <bootui clone> show v2.3.0:<path>` for 0.6.0;
`v2.4.0` for 0.7.0; `v2.5.0` for 0.8.0), and translate it: same structure, order of checks, thresholds, user-facing texts (env names
`v2.4.0` for 0.7.0; `v2.5.0` for 0.8.0 to 0.10.0; `v2.6.0` for 0.11.0), and translate it: same structure, order of checks, thresholds, user-facing texts (env names
adapted) and tests (`# ported:`). Adapt only where Python/FastAPI/SQLAlchemy forces it or an owner ruling differs;
each adaptation is one deviation row, with its reason, in the lane's matrix fragment
(`docs/reference/matrix-updates/<lane>.tsv`). Never design from a summary of BootUI: read the lines. The safety model
Expand Down
17 changes: 17 additions & 0 deletions docs/development/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,23 @@ full matrix runs on every merge before anything ships.
of that branch, which refreshes the base analysis the PR scans compare against (a stale one made each PR's Python sensor
re-parse ~848 files). Every push is its own concurrency group (`run_id`), so none cancels another.

## Dependency updates

At the start of each release wave, list open Dependabot pull requests with `gh pr list --author "app/dependabot"`.
Land them one at a time. Main protection requires an up-to-date branch and auto-merge is off: merge `origin/main` into
the Dependabot branch, push it, wait for CI, then merge the pull request.

Complete per-bump fixes before merging:

- A SonarSource scan-action bump also updates the scanner cache key
`sonar-${{ runner.os }}-vX.Y.Z` in `.github/workflows/ci.yml`. The key is pinned by
`test_the_sonar_scanner_cache_is_keyed_and_pinned`.
- An npm bump rebuilds `src/sharpit/ui/static` with `cd ui && npm ci --ignore-scripts && npm run build`, then commits the
built assets.

A maintainer commit on a Dependabot branch is signed off. A failed DCO check is fixed with a signed remediation commit,
never a force-push. When every Dependabot pull request fails the same shards, check `main` first.

## CodeQL on release pull requests

The classic branch protection rule for `release/*` enables CodeQL default setup on pull requests into version
Expand Down
38 changes: 38 additions & 0 deletions docs/reference/BOOTUI-2.6.0-DELTA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# BootUI 2.6.0 static fixture delta

The static capture uses BootUI tag `v2.6.0` at commit `6efc78d31c08baae0fca7d33b00d464e9970bed6`, released on 2026-11-27. The fixtures are generated with `scripts/capture_bootui.py --version 2.6.0` from the BootUI source tree.

## Captured fixture changes

| Fixture | BootUI 2.5.0 | BootUI 2.6.0 | Source or reason |
|---|---:|---:|---|
| Panels | 65 | 65 | `BootUiPanels.java`; the panel catalogue is unchanged. |
| Tools | 116 | 116 | `bootui-cli/src/main/resources/bootui-tools.json`; names, input schemas and action flags are unchanged. Several descriptions changed; the remaining sharpit gaps are recorded in `tests/parity/tools_status.json`. |
| Route contracts | 85 reads, 78 actions, 269 starter mappings | 85 reads, 78 actions, 269 starter mappings | `BootUiApiContractCatalog.java`; route counts are unchanged. The GitHub report contract adds `repositoryContext` as an object. This response-key addition is read from `BootUiApiContractCatalog.java` at v2.6.0 because the route capture does not record response keys; the gap is recorded in `tests/parity/routes_status.json`. |
| Properties | 212 | 219 | `BootUiProperties.java` and generated configuration metadata; adds seven activity persistence and memory scan properties listed below. Four existing descriptions also change: `bootui.activity.persistence.instance-id` is now described as a legacy Live Activity partition key, alongside changes to `bootui.activity.persistence.table-name`, `bootui.github.max-api-calls`, and `bootui.github.max-security-alerts`. |
| Rule identifiers | 688 | 692 | The captured union adds `HIB-FETCH-010`, `HIB-QUERY-010`, `SEC-AUTHZ-006`, and `SPRING-WIRING-012`; no identifiers are removed. `rule-ids-diff.json` records 0 documentation-only and 32 Java-only identifiers. |
| Test inventory | 1,144 classes, 11,204 methods | 1,206 classes, 12,210 methods | Captured from the tagged Java test sources. |

The new properties are `bootui.activity.persistence.application-id`, `bootui.activity.persistence.hot-max-entries`, `bootui.activity.persistence.max-pending-bytes`, `bootui.activity.persistence.max-pending-entries`, `bootui.activity.persistence.namespace-id`, `bootui.activity.persistence.reader-archive-cross-namespace`, and `bootui.memory.include-histogram`. The persistence settings relate to durable activity history; the histogram setting controls JVM memory scanning.

The `GET /github` report gains the `repositoryContext` object, which carries the selected remote and sanitized origin/upstream repository identities. This addition is read from `BootUiApiContractCatalog.java` at v2.6.0 because the route capture does not record response keys; the gap is recorded in `tests/parity/routes_status.json`. Sharpit adds it in Task 1.8 of the 0.11.0 plan (`docs/superpowers/plans/2026-12-05-sharpit-0.11.0/PLAN.md`). `POST /github/refresh` remains the action route. The captured route inventory and starter mapping count do not change.

## JSON specifications

| BootUI source file | v2.5.0 to v2.6.0 change | Sharpit disposition |
|---|---|---|
| `bootui-cli/src/main/resources/bootui-tools.json` | 116 tools; names, input schemas and action flags are unchanged. Descriptions change for `get_live_activity` (including `queryHelp`), `memory_scan`, and `get_spring_data_repositories`. The latter tool's summary changes as well. | `get_live_activity` retains sharpit's wording until Task 3.13 of the 0.11.0 plan (`docs/superpowers/plans/2026-12-05-sharpit-0.11.0/PLAN.md`) adds durable history. The `memory_scan` and `get_spring_data_repositories` rows have status `missing`; each reason classifies the tool as not applicable in `tests/parity/tools_status.json`. |
| `.github/actions/bootui/default-policy.json`; `examples/ci/bootui-policy.json` | Both retain `schemaVersion: 1`; no diff. | No change required. |
| `plugins/bootui/plugin.json` | The version changes from `2.5.0` to `2.6.0`; other fields are unchanged. | Version metadata only. |
| `plugins/bootui/mcp.json`; `plugins/bootui/.claude-plugin/plugin.json` | No diff. | No change required. |
| `bootui-conformance/src/main/resources/io/github/jdubois/bootui/conformance/expected-panels-*.json`; `bootui-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json` | No diff. | No change required. |
| `bootui-conformance/src/main/java/io/github/jdubois/bootui/conformance/BootUiApiContractCatalog.java` | The GitHub report response contract adds `repositoryContext: OBJECT`. | Read from `BootUiApiContractCatalog.java` at v2.6.0 because the route capture does not record response keys; the gap is recorded in `tests/parity/routes_status.json`. Sharpit adds the field in Task 1.8. |

The JSON comparison confirms the planned changes with one additional detail: `get_spring_data_repositories` changes both its summary and description. No names, schemas, action flags, policy schemas, MCP configuration, plugin integration metadata, panel lists, or additional Spring configuration metadata change.

## Status changes

The tools, properties and routes parity tests now use the 2.6.0 fixtures. Seven new property rows are classified as missing in `tests/parity/properties_status.json`; their `reason` fields identify the task that will address or classify each gap. Six activity persistence rows are tracked by Task 3.13; the JVM-only memory histogram property is classified as n-a by Task 2.13 of the 0.11.0 plan (`docs/superpowers/plans/2026-12-05-sharpit-0.11.0/PLAN.md`). Three tool-description rows are recorded in `tests/parity/tools_status.json`: `get_live_activity` remains partial until Task 3.13, while `memory_scan` and `get_spring_data_repositories` have status `missing`; each reason classifies the tool as not applicable under Task 0.1 of the 0.11.0 plan (`docs/superpowers/plans/2026-12-05-sharpit-0.11.0/PLAN.md`).

The existing fixture inventory test remains pinned to its explicit version set because its version-specific count assertions do not cover the 2.6.0 inventory.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ src = ["src", "tests"]
extend-exclude = ["scripts/pytest_speed"] # vendored verbatim; its VERSION hash catches local edits

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "S", "SIM", "PERF", "C4", "FURB", "PT018"] # PERF/C4/FURB: performance; PT018: one condition per assert
select = ["E", "F", "I", "UP", "B", "S", "SIM", "PERF", "C4", "FURB", "PT018", "PGH", "RUF100"] # PERF/C4/FURB: performance; PT018: one condition per assert; PGH/RUF100: no blanket or stale suppressions

external = ["BLE", "SLF", "PLC", "PLW", "PLR", "RUF012", "A002", "TRY", "PTH", "N8", "C901"]

[tool.ruff.lint.per-file-ignores]
# S (security) guards what ships. Tests assert and use fake secrets by design; scripts and examples are not shipped.
Expand Down
1 change: 1 addition & 0 deletions scripts/capture_bootui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ def capture(
"2.3.0": ("v2.3.0", "7c89042c6a0a47e1cb22d2df7412d2177d7416d1", "2026-11-10"),
"2.4.0": ("v2.4.0", "0df7ed764688d04f83c246c9965e90158c1db488", "2026-11-18"),
"2.5.0": ("v2.5.0", "c4458db8dd18c08074119f22a79dda3e714abbda", "2026-11-20"),
"2.6.0": ("v2.6.0", "6efc78d31c08baae0fca7d33b00d464e9970bed6", "2026-11-27"),
}


Expand Down
30 changes: 22 additions & 8 deletions scripts/ci/check_live_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,16 @@
import argparse
import re
import sys
import xml.etree.ElementTree as ET # noqa: S405 - the report is pytest's own output, written in this job
import xml.etree.ElementTree as ET # the report is pytest's own output, written in this job
from collections.abc import Sequence
from pathlib import Path

STATES = ("failure", "error", "skipped")
ORACLE_LEG = re.compile(r"test_oracle_row\[(\w+)-(\w+)-\d+\]$")


def check(report: Path, required: Sequence[str], legs: Sequence[str] = ()) -> list[str]: # noqa: C901 - one linear sequence of report checks
try:
root = ET.parse(report).getroot() # noqa: S314 - as above
except (ET.ParseError, OSError) as error:
return [f"Cannot read test report {report.name}: {type(error).__name__}"]
def _suite_failures(suites: Sequence[ET.Element]) -> list[str]: # one linear sequence of report checks
failures: list[str] = []
suites = [root] if root.tag == "testsuite" else list(root.iter("testsuite"))
for suite in suites:
try:
counts = {key: int(suite.get(key, "0")) for key in ("tests", "failures", "errors", "skipped")}
Expand All @@ -37,7 +32,11 @@ def check(report: Path, required: Sequence[str], legs: Sequence[str] = ()) -> li
failures.append("inconsistent test counters")
elif any(counts[key] for key in ("failures", "errors", "skipped")):
failures.append("the suite counters report a failure, error or skip")
cases = [case for suite in suites for case in suite.iter("testcase")]
return failures


def _required_test_failures(cases: Sequence[ET.Element], required: Sequence[str]) -> list[str]:
failures: list[str] = []
for spec in required:
name, _, wanted = spec.partition("=")
mine = [case for case in cases if case.get("name", "").split("[", 1)[0] == name]
Expand All @@ -47,7 +46,12 @@ def check(report: Path, required: Sequence[str], legs: Sequence[str] = ()) -> li
failures.append(f"{name}: expected {wanted} cases, found {len(mine)}")
elif any(case.find(state) is not None for case in mine for state in STATES):
failures.append(f"{name}: every required live test must pass without skips")
return failures


def _oracle_leg_failures(cases: Sequence[ET.Element], legs: Sequence[str]) -> list[str]:
rows = [case for case in cases if ORACLE_LEG.fullmatch(case.get("name", ""))]
failures: list[str] = []
for spec in legs:
name, _, wanted = spec.partition("=")
mine = [
Expand All @@ -66,6 +70,16 @@ def check(report: Path, required: Sequence[str], legs: Sequence[str] = ()) -> li
return failures


def check(report: Path, required: Sequence[str], legs: Sequence[str] = ()) -> list[str]:
try:
root = ET.parse(report).getroot() # as above
except (ET.ParseError, OSError) as error:
return [f"Cannot read test report {report.name}: {type(error).__name__}"]
suites = [root] if root.tag == "testsuite" else list(root.iter("testsuite"))
cases = [case for suite in suites for case in suite.iter("testcase")]
return _suite_failures(suites) + _required_test_failures(cases, required) + _oracle_leg_failures(cases, legs)


def main(argv: Sequence[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("report", type=Path)
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/dco_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _remediated(commits: list[dict[str, Any]]) -> list[tuple[str, str, str]]:
for line in commit["commit"]["message"].splitlines():
m = REMEDIATION.fullmatch(line.rstrip())
if m and _same_person(commit, m["name"], m["email"]):
found.append((m["name"], m["email"], m["sha"])) # noqa: PERF401
found.append((m["name"], m["email"], m["sha"]))
return found


Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/timing_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "tests"))
from _shard import timing_files # noqa: E402 - tests/ is no package; the planner is the single source
from _shard import timing_files # tests/ is no package; the planner is the single source


def main(out: Path) -> None:
Expand Down
8 changes: 4 additions & 4 deletions scripts/dev/live_fuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def run(text: str) -> str:
try:
if text.startswith((ROUTINE, "CREATE FUNCTION")): # a JavaScript body is a string: its definition
where = "FROM information_schema.routines WHERE routine_schema = DATABASE() AND routine_name = %s"
cursor.execute(f"SELECT routine_definition {where}", (name,)) # noqa: S608 - a constant
cursor.execute(f"SELECT routine_definition {where}", (name,)) # a constant
else: # a SQL body's definition is its source, names included: what it returns is the value
cursor.execute(f"CALL {name}()")
return repr(cursor.fetchall())
Expand All @@ -130,7 +130,7 @@ def server_runner(key: str, session: str) -> Iterator[tuple[str, Run]]:
db.close()
return
import sqlalchemy as sa # noqa: PLC0415 - the live profile's stack, not needed for sqlite
from tests.live.conftest import _boot # noqa: PLC0415 # pyright: ignore[reportPrivateUsage]
from tests.live.conftest import _boot # pyright: ignore[reportPrivateUsage]

with _boot(key) as server:
engine = sa.create_engine(server.url)
Expand Down Expand Up @@ -194,7 +194,7 @@ def _twin_holds(
swapped = text[: found.start()] + twin + text[found.end() :]
try:
rows = run(swapped)
except Exception: # noqa: BLE001, S112 - a refused twin proves nothing either way
except Exception: # a refused twin proves nothing either way
continue
out = read(swapped)
in_name = names_quoted and re.search(rf'"[^"]*{twin}[^"]*"', out)
Expand All @@ -215,7 +215,7 @@ def fuzz(key: str, session: str, seed: int, count: int, out: Path) -> dict[str,
for index, text in enumerate(strings(family, seed, count)):
try:
rows = run(text)
except Exception: # noqa: BLE001, S112 - the server refused it: no value came back
except Exception: # the server refused it: no value came back
continue
parsed += 1
for name, read in builds.items():
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/masking_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def start(label: str, src: Path, path: Path, out: Path, fields: tuple[str, ...])
str(out),
",".join(fields),
]
return subprocess.Popen(command, cwd=out.parent) # noqa: S603 # cwd: the temporary directory, never the repo
return subprocess.Popen(command, cwd=out.parent) # cwd: the temporary directory, never the repo


def resolve(role: str, available: Iterable[str]) -> dict[str, str]:
Expand Down
4 changes: 1 addition & 3 deletions scripts/dev/profile_sql_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,7 @@ def run_component_timings(statements: int) -> list[tuple[str, float]]:
" dispatch._journal_event(...)",
_time_call(
statements,
lambda: dispatch._journal_event( # noqa: SLF001
ctx, recorder, sql_event, text, None, thread_name, site
),
lambda: dispatch._journal_event(ctx, recorder, sql_event, text, None, thread_name, site),
),
),
(" otel.current_trace_id()", _time_call(statements, otel.current_trace_id)),
Expand Down
Loading
Loading