fix(config): resolve Python reliably, add command-safety hook, harden CI

- Resolve Python 3.11+ through shared Resolve-Python.ps1/resolve-python.sh,
  which probe python, python3 and py -3 and skip the Windows Store alias.
  Build and capability checks fail early with an actionable message; doctor
  reports missing Python and the skipped hooks.
- Fix check-capabilities.sh comparing only the major version.
- Register Validate-CommandSafety as a PreToolUse hook for Claude and Codex;
  shared logic in command-safety.py catches rm -rf variants, git reset --hard,
  git clean -f, Remove-Item -Recurse, del/rd /s /q and nested shells.
- Replace duplicated placeholder chains in both builds with
  adapters/placeholders.tsv.
- Restore shell parity: add test-capabilities.sh, rename credentials.ps1 to
  with-credential.ps1 and qmd-warm.sh to start-qmd-warm.sh.
- CI: build once and pass generated/ as an artifact, lint Python with ruff
  and JavaScript modules with node --check, require SHA pins for all actions.
- Add evals for all own skills and update documentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian LechnerandClaude Opus 5.5 committed 2026-11-05 09:34:54 +01:00
1 parent e19aa2e27c
commit 79694fbaa2
95 files changed
+1838 -218

No files matched your search

@@ -0,0 +1,47 @@
{
"skill_name": "facts-verification",
"evals": [
{
"id": 1,
"prompt": "Before I send this to the architecture board, verify it: \"PostgreSQL 16 supports logical replication from standby servers, our production cluster runs PostgreSQL 16.2, and our replica lag has never exceeded 2 seconds.\" Our infra repo has `terraform/rds.tf` with `engine_version = \"15.6\"` and we have Grafana dashboards for the last 30 days only.",
"expected_output": "Should break the statement into atomic claims: (1) PG 16 supports logical replication from standbys, (2) production runs 16.2, (3) replica lag never exceeded 2 seconds. Should verify claim 1 via the technical-research verification checkpoint (Context7 then official PostgreSQL docs/release notes). Claim 2 is contradicted by terraform showing 15.6 (with a note that the deployed state might differ from the repo). Claim 3 can be at most partially supported: 30 days of data cannot establish 'never', so it is inferred or unknown, not confirmed or contradicted. Each claim returned with evidence and a label of confirmed, contradicted, inferred, or unknown.",
"assertions": [
"Splits the statement into three separate atomic claims",
"Applies technical-research or Context7 and official PostgreSQL documentation for the logical replication claim",
"Labels the production version claim as contradicted citing engine_version 15.6 in terraform/rds.tf",
"Notes that the repository value may differ from the deployed state, or verifies the deployed state",
"Labels the never-exceeded-2-seconds claim as unknown or inferred because only 30 days of data exist",
"Uses only the labels confirmed, contradicted, inferred, or unknown",
"Provides evidence for each claim's conclusion"
],
"files": []
},
{
"id": 2,
"prompt": "Check this claim from our README: \"The CLI supports a `--dry-run` flag on every subcommand.\" I grepped `src/cli/` for `dry-run` and found it in `deploy.ts` and `migrate.ts` but not in `rollback.ts`. So the README is false, right?",
"expected_output": "Should prefer the source closest to the fact, such as running each subcommand with --help or inspecting the shared argument parser, since the flag might be defined globally or in a shared options module. A grep miss in rollback.ts is absence of evidence, not proof the flag is unsupported. Should label the claim based on direct evidence: contradicted only if the actual CLI rejects or lacks the flag for a subcommand; otherwise unknown or inferred. Should list subcommands checked.",
"assertions": [
"Does not conclude the claim is false solely because grep found no match in rollback.ts",
"Checks for a shared or global option definition, or runs the CLI help or command directly",
"Enumerates the subcommands that were checked",
"Labels the claim confirmed, contradicted, inferred, or unknown based on direct evidence",
"Explains the evidence behind the label"
],
"files": []
},
{
"id": 3,
"prompt": "Two sources disagree. The vendor blog post (2022) says \"Feature X rate limit is 100 requests/minute\"; the current official API reference says 600 requests/minute for the Pro plan and 100 for Free. Our team is on Pro. What's our rate limit? Please verify.",
"expected_output": "Should compare the conflicting evidence and explain the difference in scope and date (blog is older and/or refers to Free tier) rather than silently picking one. Should prefer the current official reference as the source closest to the fact, check its applicability to the Pro plan, and label the 600/min claim as confirmed for Pro (with the source) while noting the plan assignment itself should be confirmed. Should return each claim with evidence and conclusion.",
"assertions": [
"Explicitly addresses the conflict between the blog post and the API reference",
"Explains the discrepancy by date or plan scope rather than silently choosing one",
"Prefers the current official API reference over the 2022 blog post",
"Applies the Pro plan limit of 600 requests per minute with its source",
"Notes that the team's Pro plan assignment is a separate claim to confirm, or labels it accordingly",
"Uses a confidence label for each claim"
],
"files": []
}
]
}
@@ -0,0 +1,47 @@
{
"skill_name": "work-item-verification",
"evals": [
{
"id": 1,
"prompt": "Verify whether this work item is done.\n\nWork item WI-77: \"Password reset links expire.\"\nAcceptance criteria:\n1. Reset tokens expire after 30 minutes.\n2. Using an expired token shows \"This link has expired\" and a button to request a new link.\n3. A token can be used only once.\n4. The README's \"Account recovery\" section documents the expiry.\n\nEvidence: The diff adds `expiresAt = now + 30min` in `ResetTokenService.cs` and a test `Token_expires_after_30_minutes` (passing). The build is green. The README was not changed. No UI changes are in the diff.",
"expected_output": "Should map each criterion to direct evidence and mark it met, unmet, or unverified. Criterion 1: met (code plus passing test). Criterion 2: unmet or unverified (no UI change in the diff). Criterion 3: unverified (no evidence of single-use enforcement). Criterion 4: unmet (README not changed). Should not treat the green build as proof of criteria 2-4. Should give a concise completion status of not complete, listing what could not be checked.",
"assertions": [
"Lists each of the four criteria separately with a status",
"Marks criterion 1 as met citing the code change and passing test",
"Marks criterion 2 as unmet or unverified because no UI change is present",
"Marks criterion 3 as unverified or unmet due to no evidence of single-use enforcement",
"Marks criterion 4 as unmet because the README was not changed",
"States that the green build does not prove the behavioral criteria",
"Concludes the work item is not complete"
],
"files": []
},
{
"id": 2,
"prompt": "Check WI-102 is complete. Scope: \"Add a `--json` output option to the `report` command only; do not change other commands.\" Criteria: (a) `report --json` prints valid JSON; (b) existing text output unchanged. Evidence: tests for (a) and (b) pass. The diff also changes `export.ts` to default its output format to JSON and modifies `generated/cli-reference.md` by hand, while the generator script `scripts/gen-cli-docs.ts` was not run.",
"expected_output": "Criteria (a) and (b) are met by the passing tests. However, should confirm the implementation stayed within scope: the export.ts change violates the explicit scope boundary and changes behavior of another command. Should flag that generated output was hand-edited instead of regenerated, risking inconsistency. Should not claim completion while these issues remain; should record limitations and unresolved decisions.",
"assertions": [
"Marks criteria (a) and (b) as met citing the passing tests",
"Flags the export.ts change as outside the stated scope",
"Flags the hand-edited generated documentation and that the generator was not run",
"Does not declare the work item complete without qualification",
"Records the scope violation as a limitation or unresolved decision"
],
"files": []
},
{
"id": 3,
"prompt": "WI-140: \"Upgrade to Polly 8 and keep the existing retry policy behavior: 3 retries with exponential backoff starting at 200ms, retrying only on HTTP 5xx and 408.\" The diff replaces `Policy.Handle<HttpRequestException>().WaitAndRetryAsync(...)` with a `ResiliencePipelineBuilder` using `AddRetry(new RetryStrategyOptions { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Exponential, Delay = TimeSpan.FromMilliseconds(200) })`. No ShouldHandle predicate is set. The developer looked up Polly docs and says it's equivalent. All unit tests pass. Is it done?",
"expected_output": "The criterion depends on external technology behavior (Polly 8 defaults), so must apply the technical-research verification checkpoint: check the actual Polly 8 sources for what the default ShouldHandle covers and the exponential delay semantics, for the installed version, not merely accept that a lookup occurred. Without an explicit ShouldHandle limited to 5xx and 408, the 'retry only on 5xx and 408' criterion is unmet or at least unverified. Passing unit tests do not prove the retry conditions unless tests cover them. Should give criterion-by-criterion results and not claim completion.",
"assertions": [
"Applies or references the technical-research verification checkpoint for Polly 8 behavior",
"Checks the Polly 8 source or documentation for the installed version rather than accepting the developer's claim",
"Flags the missing ShouldHandle predicate as failing or leaving unverified the retry-only-on-5xx-and-408 criterion",
"Evaluates the 3 retries and 200ms exponential backoff criterion separately",
"States that passing unit tests do not prove the retry conditions unless they cover them",
"Does not claim the work item is complete"
],
"files": []
}
]
}