Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1b6deeac9 |
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "holocron",
|
"name": "holocron",
|
||||||
"description": "AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.",
|
"description": "AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.",
|
||||||
"version": "0.8.1",
|
"version": "0.9.0",
|
||||||
"owner": {
|
"owner": {
|
||||||
"name": "Mortis",
|
"name": "Mortis",
|
||||||
"url": "https://git.rkdr.net/Mortis/"
|
"url": "https://git.rkdr.net/Mortis/"
|
||||||
@@ -83,6 +83,13 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"category": "Infrastructure",
|
"category": "Infrastructure",
|
||||||
"source": "./plugins/k8s"
|
"source": "./plugins/k8s"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "plan",
|
||||||
|
"description": "Turning a ticket or idea into a validated, researched spec and agent-ready tickets, with the user in the loop; stops before implementation.",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"category": "Productivity",
|
||||||
|
"source": "./plugins/plan"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ Content ships as installable plugins, each an apm (Agent Package Manager) packag
|
|||||||
|
|
||||||
| Path | What it holds |
|
| Path | What it holds |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `plugins/` | The apm packages — `bin`, `core`, `git`, `gitea`, `kyberforge`, `lint`, `mattpocock`, `delivery`, `ansible`, `gitops`, `k8s` — each carrying skills, and where relevant agents, hooks, and bundled assets |
|
| `plugins/` | The apm packages — `bin`, `core`, `git`, `gitea`, `kyberforge`, `lint`, `mattpocock`, `delivery`, `ansible`, `gitops`, `k8s`, `plan` — each carrying skills, and where relevant agents, hooks, and bundled assets |
|
||||||
| `providers/claude-code/` | Claude Code adapter, deployed to `~/.claude/` via `scripts/install.sh` |
|
| `providers/claude-code/` | Claude Code adapter, deployed to `~/.claude/` via `scripts/install.sh` |
|
||||||
| `core/` | Provider-agnostic always-on content — `core/AGENTS.md` and `core/instructions/` |
|
| `core/` | Provider-agnostic always-on content — `core/AGENTS.md` and `core/instructions/` |
|
||||||
| `docs/` | Specs (`docs/spec/`), architectural decisions (`docs/adr/`), governance, research, and notes |
|
| `docs/` | Specs (`docs/spec/`), architectural decisions (`docs/adr/`), governance, research, and notes |
|
||||||
@@ -27,6 +27,7 @@ The plugins:
|
|||||||
- **ansible** — authoring, testing and dry-running Ansible playbooks, roles and collections
|
- **ansible** — authoring, testing and dry-running Ansible playbooks, roles and collections
|
||||||
- **gitops** — authoring, auditing and diagnosing a Flux GitOps repository, including the secrets sealed into it
|
- **gitops** — authoring, auditing and diagnosing a Flux GitOps repository, including the secrets sealed into it
|
||||||
- **k8s** — read-only diagnosis of workloads on a Kubernetes cluster
|
- **k8s** — read-only diagnosis of workloads on a Kubernetes cluster
|
||||||
|
- **plan** — turning a ticket or idea into a validated, researched spec and agent-ready tickets; ships the `/next` prompt today
|
||||||
- **bin** — cross-cutting workflow skills not yet split into a focused plugin: research, documentation, TDD, prototyping, triage, diagnosis, architecture review, requirement grilling, compressed output (`caveman`), and re-orienting mid-task (`zoom-out`)
|
- **bin** — cross-cutting workflow skills not yet split into a focused plugin: research, documentation, TDD, prototyping, triage, diagnosis, architecture review, requirement grilling, compressed output (`caveman`), and re-orienting mid-task (`zoom-out`)
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: holocron
|
name: holocron
|
||||||
version: 0.8.1
|
version: 0.9.0
|
||||||
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
|
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
|
||||||
license: MIT
|
license: MIT
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ marketplace:
|
|||||||
# top-level apm.yml description:/version: above are NOT inherited into the
|
# top-level apm.yml description:/version: above are NOT inherited into the
|
||||||
# compiled output despite being used elsewhere (e.g. by `apm audit`).
|
# compiled output despite being used elsewhere (e.g. by `apm audit`).
|
||||||
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
|
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
|
||||||
version: 0.8.1
|
version: 0.9.0
|
||||||
owner:
|
owner:
|
||||||
name: Mortis
|
name: Mortis
|
||||||
url: https://git.rkdr.net/Mortis/
|
url: https://git.rkdr.net/Mortis/
|
||||||
@@ -149,3 +149,7 @@ marketplace:
|
|||||||
- name: k8s
|
- name: k8s
|
||||||
source: ./plugins/k8s
|
source: ./plugins/k8s
|
||||||
category: Infrastructure
|
category: Infrastructure
|
||||||
|
|
||||||
|
- name: plan
|
||||||
|
source: ./plugins/plan
|
||||||
|
category: Productivity
|
||||||
@@ -47,6 +47,7 @@ These are routing boundaries, not inventories — they answer "where does a new
|
|||||||
| `ansible` | Authoring, testing and dry-running Ansible playbooks, roles and collections |
|
| `ansible` | Authoring, testing and dry-running Ansible playbooks, roles and collections |
|
||||||
| `gitops` | Authoring, auditing and diagnosing a Flux GitOps repository, including the secrets sealed into it; pod-level problems hand off to `k8s` |
|
| `gitops` | Authoring, auditing and diagnosing a Flux GitOps repository, including the secrets sealed into it; pod-level problems hand off to `k8s` |
|
||||||
| `k8s` | Read-only diagnosis of workloads on a Kubernetes cluster |
|
| `k8s` | Read-only diagnosis of workloads on a Kubernetes cluster |
|
||||||
|
| `plan` | Turning a ticket or idea into a validated, researched spec and agent-ready tickets, with the user in the loop; stops before implementation, which is `delivery`'s |
|
||||||
| `bin` | Unsorted skills that have not earned a home yet |
|
| `bin` | Unsorted skills that have not earned a home yet |
|
||||||
|
|
||||||
One compiler produces the generated content in the tree:
|
One compiler produces the generated content in the tree:
|
||||||
|
|||||||
@@ -0,0 +1,210 @@
|
|||||||
|
---
|
||||||
|
description: Rank this repo's open issues by a metric, let me pick one, then validate it and present a plan with subagents
|
||||||
|
argument-hint: "[easiest|security|important|unblocking|quick-win] [milestone:\"<name>\"] [label:\"<name>\"[,\"<name>\"...]]"
|
||||||
|
---
|
||||||
|
|
||||||
|
Arguments (raw, verbatim):
|
||||||
|
$ARGUMENTS
|
||||||
|
|
||||||
|
This command is read-only from start to finish. It makes no edits, branches, commits, assignments,
|
||||||
|
labels, comments, or issue closures. Building happens only through `/ship`.
|
||||||
|
|
||||||
|
You are the orchestrator. Delegate the heavy reading to subagents and take back only their
|
||||||
|
conclusions, in the return formats below. Every subagent brief starts with:
|
||||||
|
|
||||||
|
> READ-ONLY. Read the repo, its issues and PRs. Do not call any write tool. The only place you may
|
||||||
|
> write is the session scratchpad.
|
||||||
|
|
||||||
|
## 1. Resolve the forge, the arguments, and me (you, not a subagent)
|
||||||
|
|
||||||
|
**Forge**
|
||||||
|
- **Gitea**: the gitea MCP server answers for this owner/repo. Take owner/repo from
|
||||||
|
`git remote get-url origin`.
|
||||||
|
- **GitHub**: the host is github.com and `gh auth status` passes.
|
||||||
|
- **Otherwise**: if there is no `origin`, or the tool you need is missing, stop and say which.
|
||||||
|
|
||||||
|
**Arguments**
|
||||||
|
|
||||||
|
Parse them with shell-style quoting.
|
||||||
|
- `milestone:` and `label:` values may be quoted.
|
||||||
|
- An unquoted `label:` value also takes the words after it, until the next flag or until the
|
||||||
|
value matches one of the repo's labels. `label:Status/Needs Triage` is therefore one label, and
|
||||||
|
`/` is part of the name.
|
||||||
|
- Commas separate labels. An issue must carry all of them.
|
||||||
|
- Every other word is the metric.
|
||||||
|
- Aliases: "most important" and "importance" mean `important`; "quick win" means `quick-win`.
|
||||||
|
- If two known metrics are given, rank by the first and break ties with the second.
|
||||||
|
- Any other text is a free-text priority: state how you read it.
|
||||||
|
- No metric means `important`.
|
||||||
|
|
||||||
|
**Resolve the filters against the repo**
|
||||||
|
- **Milestone**: match the name against **open** milestones only, case-insensitive and partial.
|
||||||
|
- No match: list the open milestones and stop.
|
||||||
|
- Several matches: ask me with AskUserQuestion.
|
||||||
|
- Filter by the matched milestone's ID. A partial name passed to the issue list is silently
|
||||||
|
ignored there.
|
||||||
|
- **Labels**: match each name case-insensitively against the repo's label list. If one doesn't
|
||||||
|
exist, say so, list the close matches, and stop.
|
||||||
|
|
||||||
|
**Me**
|
||||||
|
|
||||||
|
Use gitea `get_me` or `gh api user`. If that fails, use `git config user.name` and say you did.
|
||||||
|
|
||||||
|
State the result in one line:
|
||||||
|
`forge=… repo=… metric=… milestone=… labels=… me=… ignored=…`
|
||||||
|
|
||||||
|
## 2. Find the candidates (one subagent)
|
||||||
|
|
||||||
|
Brief the subagent with the resolved filters and the rules below.
|
||||||
|
|
||||||
|
**Listing**
|
||||||
|
- Use issues only (Gitea `type=issues`, `state=open`), and page through all of them. On Gitea,
|
||||||
|
issues and PRs share one number space.
|
||||||
|
- Fetch the list of open PRs once.
|
||||||
|
|
||||||
|
**Exclude** (the reason goes in the exclusion list):
|
||||||
|
- An issue assigned to anyone other than me. Name the assignee in the reason.
|
||||||
|
- An issue carrying a label that means blocked, needing more info, abandoned, won't fix, duplicate,
|
||||||
|
invalid, or ready for a human. Map these to the repo's own label scheme, and read
|
||||||
|
`docs/agents/triage-labels.md` or the equivalent if it exists.
|
||||||
|
- **Never** exclude an issue for a label I filtered on.
|
||||||
|
- Map, epic, or index issues that only track other issues.
|
||||||
|
- An issue with an **open** blocker. That is either an open entry in the forge's dependency list
|
||||||
|
(closed blockers don't count), or an open issue named as "blocked by", "depends on", or "after
|
||||||
|
#N" in its body or comments.
|
||||||
|
- An issue an open PR already addresses: the PR's title or body says Closes, Fixes, or Refs #N, or
|
||||||
|
its head branch contains the number.
|
||||||
|
|
||||||
|
Anything uncertain is **flagged**, not excluded. Examples: an issue whose body says only a human
|
||||||
|
can do it, or one that is a pending decision.
|
||||||
|
|
||||||
|
**Cost**
|
||||||
|
|
||||||
|
Run the metadata filters on the list result first. Call get, comments, and dependencies only for
|
||||||
|
issues that survive them.
|
||||||
|
|
||||||
|
**Return**, one line per issue:
|
||||||
|
- candidates: `#N | title | labels | milestone | blocks: #… | blocked_by(open): #… | flags | summary`,
|
||||||
|
with the summary at most 50 words and folding in amendments from comments;
|
||||||
|
- excluded: `#N | excluded: reason`.
|
||||||
|
|
||||||
|
If there are no candidates, show the exclusion list and stop. If the filters removed everything
|
||||||
|
because the repo has no such labels or milestones, say that.
|
||||||
|
|
||||||
|
## 3. Score the candidates (subagents in parallel)
|
||||||
|
|
||||||
|
**`unblocking`**
|
||||||
|
|
||||||
|
You compute it yourself from the blocks/blocked_by edges, transitively. No subagents are needed.
|
||||||
|
Skip to step 4.
|
||||||
|
|
||||||
|
**Every other metric**
|
||||||
|
|
||||||
|
Batch the candidates, about 5 per subagent, with at most 6 subagents. Scoring is routine, so use a
|
||||||
|
smaller model for these subagents.
|
||||||
|
|
||||||
|
If there are more than 30 candidates, pre-rank them on metadata and score only the top 30. Say how
|
||||||
|
many you dropped. Pre-rank in this order:
|
||||||
|
1. A priority label.
|
||||||
|
2. A kind label that fits the metric (e.g. security, bug).
|
||||||
|
3. The milestone.
|
||||||
|
4. Age, oldest first.
|
||||||
|
|
||||||
|
**Brief each scorer with:**
|
||||||
|
- the metric and its rubric below;
|
||||||
|
- the paths to AGENTS.md / CLAUDE.md and `docs/adr/`. Don't send their contents. The scorer reads
|
||||||
|
an ADR only when the issue touches its subject.
|
||||||
|
|
||||||
|
The scorer judges against the repository as it is now, not the issue text alone.
|
||||||
|
|
||||||
|
**Rubric** (1–10, higher is better for the metric):
|
||||||
|
- `easiest`:
|
||||||
|
- 9–10: at most 2 files, follows an existing pattern, acceptance criteria are explicit and
|
||||||
|
testable locally.
|
||||||
|
- 5: 3–6 files, or one open question.
|
||||||
|
- 1–3: a new subsystem, an undecided design, or work outside the repo.
|
||||||
|
- `security`:
|
||||||
|
- 9–10: exploitable now, or secrets or credentials are exposed.
|
||||||
|
- 5: a hardening or defence-in-depth gap.
|
||||||
|
- 1–3: tangential to security.
|
||||||
|
- `important`:
|
||||||
|
- 9–10: high priority, or blocks several issues, or on the active milestone, or user-facing.
|
||||||
|
- 5: useful, with no dependents.
|
||||||
|
- 1–3: nice to have.
|
||||||
|
- If the repo has no priority labels or milestones, say so and score on the other factors.
|
||||||
|
- `quick-win`: the `important` score, adjusted up for effort S and down for effort L.
|
||||||
|
- Free-text priority: state your own 1/5/10 anchors in the brief and use the same ones in every
|
||||||
|
batch.
|
||||||
|
|
||||||
|
**Caps**
|
||||||
|
- Score at most 4 for an issue that is only a decision, can only be done by a human, or whose
|
||||||
|
acceptance needs an action outside the repo. Flag it as well.
|
||||||
|
- Score at most 3 for an issue that is stale (no longer matches the code).
|
||||||
|
|
||||||
|
**Return**, one block per issue:
|
||||||
|
`#N | score | evidence (≤3 bullets, file:line) | effort S/M/L | files | risks | status valid/stale/partial | flags`
|
||||||
|
|
||||||
|
Merge the results. Sort by score and break ties on effort. If one batch's scores look uniformly
|
||||||
|
off-scale compared with the others, re-check two of its issues against the rubric before
|
||||||
|
trusting it.
|
||||||
|
|
||||||
|
## 4. Present the shortlist and let me pick
|
||||||
|
|
||||||
|
**Table**: the top 5.
|
||||||
|
|
||||||
|
| Rank | Issue | Score | Effort | Why | Risks / flags |
|
||||||
|
|---|---|---|---|---|---|
|
||||||
|
|
||||||
|
**Below the table**
|
||||||
|
- Your top pick, with two sentences of rationale.
|
||||||
|
- Any stale or partly done issues you found. Only list them; do not close or comment on them.
|
||||||
|
|
||||||
|
**Ask me** with AskUserQuestion. "Other" lets me name any number.
|
||||||
|
- 4 or more candidates: offer the top 4, the recommended one first and marked "(Recommended)".
|
||||||
|
- 2–3 candidates: offer them all.
|
||||||
|
- 1 candidate: ask yes or no.
|
||||||
|
|
||||||
|
Stop until I answer.
|
||||||
|
|
||||||
|
**If I name something outside the shortlist**
|
||||||
|
- A PR, a closed issue, or a number that doesn't exist: say so and ask again.
|
||||||
|
- An issue that was excluded or not scored: say why first, then go on to step 5 with it.
|
||||||
|
|
||||||
|
## 5. Validate the pick and plan (subagents in parallel)
|
||||||
|
|
||||||
|
Brief these subagents with the issue number and the relevant paths, not your conclusions.
|
||||||
|
|
||||||
|
- **Validation**
|
||||||
|
- Does the issue still match the repo?
|
||||||
|
- Do its body and comments agree with each other and with the linked decisions or ADRs?
|
||||||
|
- Is anything it relies on missing?
|
||||||
|
- Can each acceptance criterion be tested locally?
|
||||||
|
- Return each finding tagged `contradiction`, `stale`, `missing`, or `untestable`.
|
||||||
|
- **Solution options**
|
||||||
|
- Give 2–3 concrete approaches that follow the repo's conventions and existing patterns.
|
||||||
|
- Return each as `approach | files | tradeoff | fit`.
|
||||||
|
- **External facts** (only if the issue depends on a library, tool, or API)
|
||||||
|
- Verify the behaviour from primary sources, using Context7 for library docs.
|
||||||
|
- Experiments are allowed only inside the scratchpad, and must not install anything globally.
|
||||||
|
- Mark each claim as verified or inferred.
|
||||||
|
|
||||||
|
**Stop instead of planning** if:
|
||||||
|
- the issue contradicts a recorded decision, or
|
||||||
|
- no viable approach exists without a design decision that was never made.
|
||||||
|
|
||||||
|
Say which applies. A choice *between* viable approaches is not a reason to stop: put it under open
|
||||||
|
decisions instead.
|
||||||
|
|
||||||
|
**The plan** is written so `/ship` can run it as is:
|
||||||
|
|
||||||
|
1. `Issue: #N <title>`. The PR must close it.
|
||||||
|
2. What the issue asks, and what validation found.
|
||||||
|
3. The recommended approach and its main tradeoff. Give each alternative in one line.
|
||||||
|
4. The steps: the files to change, in order.
|
||||||
|
5. Verification: the tests and checks, and what can't be verified locally.
|
||||||
|
6. Human steps: acceptance criteria that need an action outside the repo (e.g. filing an upstream
|
||||||
|
issue, pushing tags, or setting up infrastructure).
|
||||||
|
7. Open decisions that need me. Do not decide these yourself.
|
||||||
|
|
||||||
|
End with: "Run `/ship` to build this." If I reply go, tell me to run `/ship`: it cannot be
|
||||||
|
invoked for me. Do not build inline.
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
name: plan
|
||||||
|
version: 0.1.0
|
||||||
|
description: Turning a ticket or idea into a validated, researched spec and agent-ready tickets, with the user in the loop; stops before implementation.
|
||||||
|
author:
|
||||||
|
name: Mortis
|
||||||
|
url: https://git.rkdr.net/Mortis/
|
||||||
|
license: MIT
|
||||||
|
homepage: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/plan
|
||||||
|
repository: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/plan
|
||||||
|
keywords:
|
||||||
|
- planning
|
||||||
|
- spec
|
||||||
|
- tickets
|
||||||
|
- research
|
||||||
|
- grilling
|
||||||
|
|
||||||
|
# Constrains what .apm/ may contain: instructions, skill, hybrid, or prompts
|
||||||
|
type: hybrid
|
||||||
|
|
||||||
|
# Which agent platforms to deploy to.
|
||||||
|
# Resolution order: --target flag > this field > auto-detect from filesystem.
|
||||||
|
# Accepted values: agent-skills, antigravity, claude, codex, copilot, cursor, gemini, grok-build, kiro, opencode, windsurf
|
||||||
|
targets:
|
||||||
|
- claude
|
||||||
|
- copilot
|
||||||
|
- codex
|
||||||
|
|
||||||
|
includes: auto
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
apm: []
|
||||||
|
mcp: []
|
||||||
|
devDependencies:
|
||||||
|
apm: []
|
||||||
|
scripts: {}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# plan plugin — outline
|
||||||
|
|
||||||
|
Status: outline only. This is the maintainer's intent for the plugin, captured before any design or
|
||||||
|
grilling. Nothing below is built yet except the `next` prompt, which is the existing personal
|
||||||
|
`/next` command moved into the plugin unchanged.
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
Cover picking up a new ticket or idea and turning it into a spec and a ticket breakdown that
|
||||||
|
agents further down the chain (planning or implementation) can act on with the least extra
|
||||||
|
context gathering.
|
||||||
|
|
||||||
|
The goal is to optimise:
|
||||||
|
|
||||||
|
- the ticket creation process;
|
||||||
|
- context management and agent instructions for downstream agents, including the context and
|
||||||
|
instructions written into issues;
|
||||||
|
- reuse of the context that already exists (repo, tracker, docs) and of online sources.
|
||||||
|
|
||||||
|
## Sources to consult
|
||||||
|
|
||||||
|
- **The repo and its context**: current practices, rules, functionality, patterns and
|
||||||
|
conventions.
|
||||||
|
- **The internet and other sources**: tools, documentation, best practices, examples and
|
||||||
|
standards.
|
||||||
|
|
||||||
|
## Interaction flow
|
||||||
|
|
||||||
|
1. **Validate the ticket or idea.** Verify it before any grilling. If it does not hold up, stop.
|
||||||
|
2. **Initial grilling**, only if required, to explore the ticket's or idea's intention.
|
||||||
|
3. **Research** in the repo and online.
|
||||||
|
4. **Offer a plan** with options, considerations, recommendations, impact and expected results.
|
||||||
|
5. **Agreement.** The user either agrees or needs more grilling before agreeing.
|
||||||
|
6. **Write the spec** as an epic or a feature.
|
||||||
|
7. **Propose a breakdown** of the spec into tickets.
|
||||||
|
|
||||||
|
## What ships today
|
||||||
|
|
||||||
|
- `.apm/prompts/next.prompt.md` — the `/next` command: rank open issues by a metric, let the
|
||||||
|
user pick one, validate it and present a plan. Read-only; building happens through `/ship`.
|
||||||
@@ -26,17 +26,17 @@ fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
|
|||||||
command -v python3 > /dev/null 2>&1 || { echo "SKIP: python3 is required to exercise the PyYAML reader"; exit 77; }
|
command -v python3 > /dev/null 2>&1 || { echo "SKIP: python3 is required to exercise the PyYAML reader"; exit 77; }
|
||||||
python3 -c 'import yaml' > /dev/null 2>&1 || { echo "SKIP: PyYAML is required to exercise the PyYAML reader"; exit 77; }
|
python3 -c 'import yaml' > /dev/null 2>&1 || { echo "SKIP: PyYAML is required to exercise the PyYAML reader"; exit 77; }
|
||||||
|
|
||||||
# One root per run: fixture helpers run inside $(...) subshells, where an
|
FIXTURES=()
|
||||||
# array append never reaches the parent's trap, so register the root instead.
|
cleanup() { [[ ${#FIXTURES[@]} -eq 0 ]] || rm -rf "${FIXTURES[@]}"; }
|
||||||
RUN_TMP="$(mktemp -d)"
|
trap cleanup EXIT
|
||||||
trap 'rm -rf "$RUN_TMP"' EXIT
|
|
||||||
|
|
||||||
# make_fixture <plugin-version-line> <root-executables-block>
|
# make_fixture <plugin-version-line> <root-executables-block>
|
||||||
# The executables block is passed verbatim (may be empty) so a fixture can omit
|
# The executables block is passed verbatim (may be empty) so a fixture can omit
|
||||||
# it entirely, which is one of the failure modes under test.
|
# it entirely, which is one of the failure modes under test.
|
||||||
make_fixture() {
|
make_fixture() {
|
||||||
local version_line="$1" executables_block="$2" dir
|
local version_line="$1" executables_block="$2" dir
|
||||||
dir="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
dir="$(mktemp -d)"
|
||||||
|
FIXTURES+=("$dir")
|
||||||
# kyberforge ships both hooks and bin, which is what makes the gate check it.
|
# kyberforge ships both hooks and bin, which is what makes the gate check it.
|
||||||
mkdir -p "$dir/plugins/kyberforge/.apm/hooks" "$dir/plugins/kyberforge/bin"
|
mkdir -p "$dir/plugins/kyberforge/.apm/hooks" "$dir/plugins/kyberforge/bin"
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ run_gate "$REPO_ROOT/definitely-not-a-directory"
|
|||||||
|| fail "a bad path must not exit 0 — that reads as 'checked, in sync'"
|
|| fail "a bad path must not exit 0 — that reads as 'checked, in sync'"
|
||||||
|
|
||||||
# No executable-shipping plugin at all is the one legitimate no-op: nothing to pin.
|
# No executable-shipping plugin at all is the one legitimate no-op: nothing to pin.
|
||||||
NO_PLUGIN="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
NO_PLUGIN="$(mktemp -d)"; FIXTURES+=("$NO_PLUGIN")
|
||||||
echo "name: someone-else" > "$NO_PLUGIN/apm.yml"
|
echo "name: someone-else" > "$NO_PLUGIN/apm.yml"
|
||||||
run_gate "$NO_PLUGIN"
|
run_gate "$NO_PLUGIN"
|
||||||
[[ $GATE_RC -eq 0 ]] && pass "no-ops in a repo with no executable-shipping plugin" \
|
[[ $GATE_RC -eq 0 ]] && pass "no-ops in a repo with no executable-shipping plugin" \
|
||||||
@@ -290,7 +290,7 @@ echo "--- the fallback reader agrees with the PyYAML reader ---"
|
|||||||
# hook needs it), so the shape-scan fallback carries the same verdicts. Masking
|
# hook needs it), so the shape-scan fallback carries the same verdicts. Masking
|
||||||
# is done with a python3 stub whose `import yaml` fails, which is the exact
|
# is done with a python3 stub whose `import yaml` fails, which is the exact
|
||||||
# condition on a machine that has python3 without PyYAML.
|
# condition on a machine that has python3 without PyYAML.
|
||||||
NO_YAML_BIN="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
NO_YAML_BIN="$(mktemp -d)"; FIXTURES+=("$NO_YAML_BIN")
|
||||||
printf '#!/usr/bin/env bash\nexit 1\n' > "$NO_YAML_BIN/python3"
|
printf '#!/usr/bin/env bash\nexit 1\n' > "$NO_YAML_BIN/python3"
|
||||||
chmod +x "$NO_YAML_BIN/python3"
|
chmod +x "$NO_YAML_BIN/python3"
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,14 @@ FAIL=0
|
|||||||
pass() { echo " PASS: $1"; PASS=$((PASS + 1)); }
|
pass() { echo " PASS: $1"; PASS=$((PASS + 1)); }
|
||||||
fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
|
fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
|
||||||
|
|
||||||
# Per-run scratch for output and fixtures, for the reason check-scope-walkup-sync's
|
FIXTURES=()
|
||||||
# test gives: tests/run-tests.sh fans test scripts out concurrently. Fixtures live
|
cleanup() { [[ ${#FIXTURES[@]} -eq 0 ]] || rm -rf "${FIXTURES[@]}"; }
|
||||||
# under it because make_repo runs in a $(...) subshell, where an array append never
|
trap cleanup EXIT
|
||||||
# reaches the parent's trap.
|
|
||||||
|
# Per-run scratch for captured output, for the reason check-scope-walkup-sync's
|
||||||
|
# test gives: tests/run-tests.sh fans test scripts out concurrently.
|
||||||
RUN_TMP="$(mktemp -d)"
|
RUN_TMP="$(mktemp -d)"
|
||||||
trap 'rm -rf "$RUN_TMP"' EXIT
|
FIXTURES+=("$RUN_TMP")
|
||||||
|
|
||||||
# A minimal REPO_ROOT: a .git entry (the validator's find_repo_root stops at
|
# A minimal REPO_ROOT: a .git entry (the validator's find_repo_root stops at
|
||||||
# it), a copy of the real validator at its real relative path, and one plugin
|
# it), a copy of the real validator at its real relative path, and one plugin
|
||||||
@@ -23,7 +25,8 @@ trap 'rm -rf "$RUN_TMP"' EXIT
|
|||||||
# exercise the actual FAIL/INFO/exit contract rather than a stub of it.
|
# exercise the actual FAIL/INFO/exit contract rather than a stub of it.
|
||||||
make_repo() {
|
make_repo() {
|
||||||
local dir
|
local dir
|
||||||
dir="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
dir="$(mktemp -d)"
|
||||||
|
FIXTURES+=("$dir")
|
||||||
mkdir -p "$dir/.git" "$dir/$VALIDATOR_DIR" "$dir/plugins/p/docs/research/docs/t"
|
mkdir -p "$dir/.git" "$dir/$VALIDATOR_DIR" "$dir/plugins/p/docs/research/docs/t"
|
||||||
cp -R "$REPO_ROOT/$VALIDATOR_DIR/." "$dir/$VALIDATOR_DIR/"
|
cp -R "$REPO_ROOT/$VALIDATOR_DIR/." "$dir/$VALIDATOR_DIR/"
|
||||||
cat > "$dir/plugins/p/docs/research/docs/t/sources.md" <<'EOF'
|
cat > "$dir/plugins/p/docs/research/docs/t/sources.md" <<'EOF'
|
||||||
|
|||||||
@@ -20,10 +20,8 @@ fi
|
|||||||
# Output assertions use here-strings, never `echo | grep -q` (pipefail race;
|
# Output assertions use here-strings, never `echo | grep -q` (pipefail race;
|
||||||
# see docs/spec/gates.md, Tests).
|
# see docs/spec/gates.md, Tests).
|
||||||
|
|
||||||
# One root per run: fixture helpers run inside $(...) subshells, where an
|
CLEANUP_DIRS=()
|
||||||
# array append never reaches the parent's trap, so register the root instead.
|
trap 'rm -rf ${CLEANUP_DIRS[@]+"${CLEANUP_DIRS[@]}"}' EXIT
|
||||||
RUN_TMP="$(mktemp -d)"
|
|
||||||
trap 'rm -rf "$RUN_TMP"' EXIT
|
|
||||||
|
|
||||||
# write_skill <repo> <plugin> <skill> <version-line|""> [body]
|
# write_skill <repo> <plugin> <skill> <version-line|""> [body]
|
||||||
# An empty version line writes a SKILL.md with no metadata block at all.
|
# An empty version line writes a SKILL.md with no metadata block at all.
|
||||||
@@ -50,7 +48,8 @@ commit() { (cd "$1" && git add -A && git commit -q -m "${2:-change}"); }
|
|||||||
# onto a feature branch.
|
# onto a feature branch.
|
||||||
make_fixture() {
|
make_fixture() {
|
||||||
local dir
|
local dir
|
||||||
dir="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
dir="$(mktemp -d)"
|
||||||
|
CLEANUP_DIRS+=("$dir")
|
||||||
(cd "$dir" && git init -q -b main && git config user.email [email protected] && git config user.name t)
|
(cd "$dir" && git init -q -b main && git config user.email [email protected] && git config user.name t)
|
||||||
write_skill "$dir" demo alpha 'version: "1.0.0"'
|
write_skill "$dir" demo alpha 'version: "1.0.0"'
|
||||||
write_skill "$dir" demo beta "version: 1.0.9"
|
write_skill "$dir" demo beta "version: 1.0.9"
|
||||||
@@ -256,7 +255,7 @@ expect_fail "the report names alpha and the versions read from origin/main's mer
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "--- 19. no main ref fails closed ---"
|
echo "--- 19. no main ref fails closed ---"
|
||||||
F="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
F="$(mktemp -d)"; CLEANUP_DIRS+=("$F")
|
||||||
(cd "$F" && git init -q -b trunk && git config user.email [email protected] && git config user.name t)
|
(cd "$F" && git init -q -b trunk && git config user.email [email protected] && git config user.name t)
|
||||||
write_skill "$F" demo alpha 'version: "1.0.0"'; commit "$F"
|
write_skill "$F" demo alpha 'version: "1.0.0"'; commit "$F"
|
||||||
expect_fail "missing main fails with a clear message" "neither origin/main nor main resolves" "$F"
|
expect_fail "missing main fails with a clear message" "neither origin/main nor main resolves" "$F"
|
||||||
@@ -324,7 +323,7 @@ expect_pass "a zero inside a part (1.0.10) is not a leading zero" "$F"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "--- 24. python3 / PyYAML failures are never reported as a missing version ---"
|
echo "--- 24. python3 / PyYAML failures are never reported as a missing version ---"
|
||||||
REAL_PYTHON="$(command -v python3)"
|
REAL_PYTHON="$(command -v python3)"
|
||||||
SHIM_ROOT="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
SHIM_ROOT="$(mktemp -d)"; CLEANUP_DIRS+=("$SHIM_ROOT")
|
||||||
mkdir -p "$SHIM_ROOT/shadow" "$SHIM_ROOT/noyaml" "$SHIM_ROOT/crash"
|
mkdir -p "$SHIM_ROOT/shadow" "$SHIM_ROOT/noyaml" "$SHIM_ROOT/crash"
|
||||||
printf 'raise ImportError("PyYAML deliberately unavailable in this fixture")\n' \
|
printf 'raise ImportError("PyYAML deliberately unavailable in this fixture")\n' \
|
||||||
> "$SHIM_ROOT/shadow/yaml.py"
|
> "$SHIM_ROOT/shadow/yaml.py"
|
||||||
@@ -603,7 +602,7 @@ echo "--- 40. a criss-cross history is judged against EVERY merge-base ---"
|
|||||||
# +-- feature: F1 bumps alpha to 1.0.1
|
# +-- feature: F1 bumps alpha to 1.0.1
|
||||||
# +-- main: M1 unrelated, then M2 merges F1
|
# +-- main: M1 unrelated, then M2 merges F1
|
||||||
# feature: F2 merges M1 -> merge bases {M1, F1}
|
# feature: F2 merges M1 -> merge bases {M1, F1}
|
||||||
F="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
F="$(mktemp -d)"; CLEANUP_DIRS+=("$F")
|
||||||
(cd "$F" && git init -q -b main && git config user.email [email protected] && git config user.name t)
|
(cd "$F" && git init -q -b main && git config user.email [email protected] && git config user.name t)
|
||||||
write_skill "$F" demo alpha 'version: "1.0.0"'; commit "$F" C0
|
write_skill "$F" demo alpha 'version: "1.0.0"'; commit "$F" C0
|
||||||
(cd "$F" && git checkout -q -b feature)
|
(cd "$F" && git checkout -q -b feature)
|
||||||
|
|||||||
@@ -23,14 +23,13 @@ unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_OBJECT_DIRECTORY GIT_COMMON_DIR
|
|||||||
# Output assertions use here-strings, never `echo | grep -q` (pipefail race;
|
# Output assertions use here-strings, never `echo | grep -q` (pipefail race;
|
||||||
# see docs/spec/gates.md, Tests).
|
# see docs/spec/gates.md, Tests).
|
||||||
|
|
||||||
# One root per run: fixture helpers run inside $(...) subshells, where an
|
CLEANUP_DIRS=()
|
||||||
# array append never reaches the parent's trap, so register the root instead.
|
trap 'rm -rf ${CLEANUP_DIRS[@]+"${CLEANUP_DIRS[@]}"}' EXIT
|
||||||
RUN_TMP="$(mktemp -d)"
|
|
||||||
trap 'rm -rf "$RUN_TMP"' EXIT
|
|
||||||
|
|
||||||
new_repo() {
|
new_repo() {
|
||||||
local dir
|
local dir
|
||||||
dir="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
dir="$(mktemp -d)"
|
||||||
|
CLEANUP_DIRS+=("$dir")
|
||||||
(cd "$dir" && git init -q -b main && git config user.email [email protected] && git config user.name t \
|
(cd "$dir" && git init -q -b main && git config user.email [email protected] && git config user.name t \
|
||||||
&& git config tag.gpgSign false && git config commit.gpgSign false)
|
&& git config tag.gpgSign false && git config commit.gpgSign false)
|
||||||
echo "$dir"
|
echo "$dir"
|
||||||
@@ -151,7 +150,7 @@ expect_rc "same tag on the right commit" 0
|
|||||||
expect_row "row is OK" delta 2.0.0 "$BUMP" OK
|
expect_row "row is OK" delta 2.0.0 "$BUMP" OK
|
||||||
|
|
||||||
echo "Case 6: shallow clone exits 2"
|
echo "Case 6: shallow clone exits 2"
|
||||||
S="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
S="$(mktemp -d)"; CLEANUP_DIRS+=("$S")
|
||||||
git clone -q --depth 1 "file://$R" "$S/c" 2>/dev/null
|
git clone -q --depth 1 "file://$R" "$S/c" 2>/dev/null
|
||||||
run "$S/c"
|
run "$S/c"
|
||||||
expect_rc "shallow clone" 2
|
expect_rc "shallow clone" 2
|
||||||
@@ -371,7 +370,7 @@ expect_row "ua 1.1.0 MISSING after the one-off" ua 1.1.0 "$U2" MISSING
|
|||||||
echo "Case 12l: default ref is origin/main, not local main"
|
echo "Case 12l: default ref is origin/main, not local main"
|
||||||
R="$(new_repo)"
|
R="$(new_repo)"
|
||||||
write_apm "$R" va 1.0.0; commit "$R" a; V1="$(head_sha "$R")"
|
write_apm "$R" va 1.0.0; commit "$R" a; V1="$(head_sha "$R")"
|
||||||
B="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
B="$(mktemp -d)"; CLEANUP_DIRS+=("$B")
|
||||||
git init -q --bare "$B/r.git"
|
git init -q --bare "$B/r.git"
|
||||||
(cd "$R" && git remote add origin "$B/r.git" && git push -q origin main 2>/dev/null)
|
(cd "$R" && git remote add origin "$B/r.git" && git push -q origin main 2>/dev/null)
|
||||||
write_apm "$R" va 2.0.0; commit "$R" local-only
|
write_apm "$R" va 2.0.0; commit "$R" local-only
|
||||||
@@ -545,7 +544,7 @@ expect_row "next version MISSING" om 1.3.0 "$OM4" MISSING
|
|||||||
echo "Case 12u: a git rev-list failure or an empty history exits 2, not a crash"
|
echo "Case 12u: a git rev-list failure or an empty history exits 2, not a crash"
|
||||||
R="$(new_repo)"
|
R="$(new_repo)"
|
||||||
write_apm "$R" rl 1.0.0; commit "$R" a
|
write_apm "$R" rl 1.0.0; commit "$R" a
|
||||||
W="$(mktemp -d "$RUN_TMP/fx.XXXXXX")"
|
W="$(mktemp -d)"; CLEANUP_DIRS+=("$W")
|
||||||
REAL_GIT="$(command -v git)"
|
REAL_GIT="$(command -v git)"
|
||||||
cat > "$W/git" <<EOF
|
cat > "$W/git" <<EOF
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|||||||
Reference in new issue
Block a user