8000 Fix claude.ai marketplace sync: move plugin/bin to libexec, add icon by adeelahmad · Pull Request #129 · adeelahmad/aloop · GitHub
[go: up one dir, main page]

Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ jobs:
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: claude plugin validate --strict
run: claude plugin validate ./plugin --strict
- name: claude plugin validate marketplace --strict
run: claude plugin validate . --strict
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ clippy: ## Clippy with warnings-as-errors
.PHONY: shellcheck
shellcheck: ## Lint gate scripts (skipped with a warning if shellcheck is absent)
@if ! command -v shellcheck >/dev/null; then echo "WARN: shellcheck not installed; skipping (CI enforces it)"; else \
shellcheck -S error -e SC1091 plugin/bin/_gatelib.sh plugin/bin/_failclosed.sh plugin/bin/_finddoc.sh $$(grep -l "^#!/usr/bin/env bash" plugin/bin/gate-*) plugin/bin/log-execution \
plugin/bin/selfcheck plugin/bin/transcripts plugin/bin/worktree-create plugin/bin/worktree-remove \
plugin/bin/worktree-hygiene plugin/bin/ensure-tools plugin/bin/md-db plugin/bin/ctx-symbols \
plugin/bin/session-start plugin/bin/_paths.sh plugin/bin/aloop plugin/bin/aladdin plugin/bin/agentic plugin/bin/bind plugin/bin/task-worktree; fi
shellcheck -S error -e SC1091 plugin/libexec/_gatelib.sh plugin/libexec/_failclosed.sh plugin/libexec/_finddoc.sh $$(grep -l "^#!/usr/bin/env bash" plugin/libexec/gate-*) plugin/libexec/log-execution \
plugin/libexec/selfcheck plugin/libexec/transcripts plugin/libexec/worktree-create plugin/libexec/worktree-remove \
plugin/libexec/worktree-hygiene plugin/libexec/ensure-tools plugin/libexec/md-db plugin/libexec/ctx-symbols \
plugin/libexec/session-start plugin/libexec/_paths.sh plugin/libexec/aloop plugin/libexec/aladdin plugin/libexec/agentic plugin/libexec/bind plugin/libexec/task-worktree; fi

.PHONY: pycheck
pycheck: ## Byte-compile the Python hook scripts
@python3 -m py_compile plugin/bin/budget plugin/bin/stats plugin/bin/aloop-init plugin/bin/gate-commit-author plugin/bin/_paths.py \
plugin/bin/_usage.py plugin/bin/_prices.py plugin/bin/_events.py plugin/bin/events plugin/bin/intent plugin/bin/lessons plugin/bin/ids plugin/bin/targets plugin/bin/impact plugin/bin/timebox plugin/bin/sweep plugin/bin/capabilities plugin/bin/models plugin/bin/_routes.py plugin/bin/host plugin/bin/_host.py plugin/bin/config plugin/bin/_config.py plugin/bin/layout plugin/bin/_lsp.py scripts/test/fixtures/fake-lsp.py plugin/bin/_timebox.py plugin/bin/host-adapter plugin/bin/install \
plugin/bin/_approval.py plugin/bin/mission plugin/bin/_mission.py plugin/bin/_mission_roles.py plugin/bin/_shellread.py plugin/bin/gate-mission-scope plugin/bin/gate-mission-artifact $$(ls plugin/mission/*.py 2>/dev/null) \
@python3 -m py_compile plugin/libexec/budget plugin/libexec/stats plugin/libexec/aloop-init plugin/libexec/gate-commit-author plugin/libexec/_paths.py \
plugin/libexec/_usage.py plugin/libexec/_prices.py plugin/libexec/_events.py plugin/libexec/events plugin/libexec/intent plugin/libexec/lessons plugin/libexec/ids plugin/libexec/targets plugin/libexec/impact plugin/libexec/timebox plugin/libexec/sweep plugin/libexec/capabilities plugin/libexec/models plugin/libexec/_routes.py plugin/libexec/host plugin/libexec/_host.py plugin/libexec/config plugin/libexec/_config.py plugin/libexec/layout plugin/libexec/_lsp.py scripts/test/fixtures/fake-lsp.py plugin/libexec/_timebox.py plugin/libexec/host-adapter plugin/libexec/install \
plugin/libexec/_approval.py plugin/libexec/mission plugin/libexec/_mission.py plugin/libexec/_mission_roles.py plugin/libexec/_shellread.py plugin/libexec/gate-mission-scope plugin/libexec/gate-mission-artifact $$(ls plugin/mission/*.py 2>/dev/null) \
$$(ls scripts/smoke/*.py 2>/dev/null) \
&& rm -rf plugin/bin/__pycache__ plugin/mission/__pycache__ scripts/smoke/__pycache__ && echo "python ok"
&& rm -rf plugin/libexec/__pycache__ plugin/mission/__pycache__ scripts/smoke/__pycache__ && echo "python ok"

.PHONY: test-hosts
test-hosts: ## Budget/worktree regression + Codex hooks emulation + OpenCode and dsh plugins end-to-end (no network, no tokens)
Expand Down Expand Up @@ -116,8 +116,8 @@ test-hosts: ## Budget/worktree regression + Codex hooks emulation + OpenCode and
python3 scripts/test/site.test.py
python3 scripts/test/readme.test.py
python3 scripts/test/layout.test.py
plugin/bin/layout check
plugin/bin/host check
plugin/libexec/layout check
plugin/libexec/host check
python3 scripts/test/targets-scope.test.py
python3 scripts/test/task-scope.test.py
python3 scripts/test/userspace.test.py
Expand Down Expand Up @@ -255,7 +255,7 @@ smoke: build ## Quick offline gate smoke test (structural gate on a tmp tree)
@export PATH="$(BIN_DIR):$$PATH"; \
cp "$(CTX)/target/release/ctx-symbols" "$(BIN_DIR)/ctx-symbols" 2>/dev/null || true; \
T=$$(mktemp -d); printf 'pub fn a(){let x=1;}\npub fn caller(){a();}\n' > "$$T/a.rs"; \
REPO_DIR="$$T" CLAUDE_PLUGIN_ROOT="$(CURDIR)/plugin" plugin/bin/gate-structural-integrity; \
REPO_DIR="$$T" CLAUDE_PLUGIN_ROOT="$(CURDIR)/plugin" plugin/libexec/gate-structural-integrity; \
echo "structural gate exit=$$?"; rm -rf "$$T"

.PHONY: clean
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ deliver results, grow adoption vs keep it simple.
/aladdin Add rate limiting to the API
```

**Codex:** from a clone, `plugin/bin/aloop install codex` (agent TOMLs and `aloop` on PATH), then
**Codex:** from a clone, `plugin/libexec/aloop install codex` (agent TOMLs and `aloop` on PATH), then
`codex plugin marketplace add adeelahmad/aloop`, `codex plugin add aloop@aloop-marketplace`, and trust
the hooks once in Codex's `/hooks`. **OpenCode:** `plugin/bin/aloop install opencode` renders
everything. **DeepSeek Harness:** `plugin/bin/aloop install dsh --project .` renders a `dsh` profile,
the hooks once in Codex's `/hooks`. **OpenCode:** `plugin/libexec/aloop install opencode` renders
everything. **DeepSeek Harness:** `plugin/libexec/aloop install dsh --project .` renders a `dsh` profile,
then run `dsh --profile aloop`. Every way you get full parity (hooks, agents, gates, time box, ledger,
stats, handoff). See [`plugin/README.md` → Codex and OpenCode](plugin/README.md#codex-and-opencode)
and [→ DeepSeek Harness](plugin/README.md#deepseek-harness-dsh).
Expand All @@ -277,7 +277,7 @@ and [→ DeepSeek Harness](plugin/README.md#deepseek-harness-dsh).
improve / add requests even if you never say "agile", or invoke `/aladdin`, `/aloop` or `/aloop:init`.
- **From a shell:** `aladdin "<intent>"` records the intent (on PATH inside host sessions; in your
own terminal after `aloop install codex|opencode|dsh` links it into `~/.local/bin`, or from a clone as
`plugin/bin/aladdin`); `aladdin status` (one line per task from
`plugin/libexec/aladdin`); `aladdin status` (one line per task from
the harness files, tasks to re-gate, token totals); `aladdin resume` (what the next session
loads); `aladdin report` (the sprint's `stats.md`); `aladdin target | context | refs | callers`
(the semantic queries). Every tool is also `aloop <tool>` (`aloop --list`).
Expand Down Expand Up @@ -365,7 +365,7 @@ change rationale.
```
.claude-plugin/marketplace.json marketplace catalog (source: ./plugin)
plugin/ the installable plugin (see plugin/README.md)
bin/ the tools and gates (aladdin, aloop, gate-*, budget, sweep, targets, events, host, mission …)
libexec/ the tools and gates (aladdin, aloop, gate-*, budget, sweep, targets, events, host, mission …)
agents/ the 16 roles (Aladdin's 10 + the mission layer's 6) · skills/ the supervisor playbooks (aloop, aladdin, init, mission)
hooks/ hooks.json (aloop:<role> matchers) · hosts/ capabilities, routes, the OpenCode and dsh plugins
mission/ the mission layer's areas (journeys, baseline, assess, evaluate …) and their schemas
Expand Down Expand Up @@ -428,7 +428,7 @@ enforce this. Tag releases `vMAJOR.MINOR.PATCH`.
`.github/workflows/ci.yml` runs on every push/PR:

- **rust**: `cargo fmt --check`, `cargo clippy -D warnings`, tests for `ctx-symbols` + `md-db`.
- **shellcheck**: lints every gate script (`plugin/bin/*`), errors fail the build.
- **shellcheck**: lints every gate script (`plugin/libexec/*`), errors fail the build.
- **hosts**: byte-compiles the Python hooks, then Codex hooks emulation + the OpenCode
and dsh plugins end-to-end, the dsh one also on the real (pinned) dsh runtime against a
scripted model (no network, no tokens).
Expand Down
14 changes: 7 additions & 7 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ execution input and carries the feedback loop.
| 8 personas | `agents/<role>.md` (dispatched via the Task tool) |
| per-task isolation | dispatch with `isolation: "worktree"` |
| deterministic gates | `hooks/hooks.json` — SubagentStop / Stop / PostToolUse |
| gate bodies | `bin/gate-*` (exit 0 pass, exit 2 block+feedback) |
| gate bodies | `libexec/gate-*` (exit 0 pass, exit 2 block+feedback) |
| artifact validation | `md-db validate ... --schema schemas/*.kdl` |
| code-structure checks | `ctx-symbols` (optional) with grep fallback |
| feedback channel | `init.md` / `output.md` per task attempt |
Expand Down Expand Up @@ -60,13 +60,13 @@ agentic-agile/
skills/agentic-agile/SKILL.md the orchestration the supervisor executes [OPEN-2]
agents/<role>.md 8 dispatchable personas (assembled from pipeline/)
hooks/hooks.json event -> matcher -> gate-script wiring
bin/gate-* gate bodies; bin/log-execution writes the ledger
libexec/gate-* gate bodies; libexec/log-execution writes the ledger
schemas/*.kdl md-db schemas
pipeline/ design source of truth (persona/init/artifacts/gate per activity)
```
`pipeline/` is the human-readable design source; `agents/` is assembled from
`pipeline/*/persona.md`. `${CLAUDE_PLUGIN_ROOT}` resolves to the installed plugin dir
inside every hook command, so all `bin/`/`schemas/` paths are addressed through it.
inside every hook command, so all `libexec/`/`schemas/` paths are addressed through it.

================================================================================
## 3. Control plane — who runs what
Expand Down Expand Up @@ -103,7 +103,7 @@ event and send stderr back to the supervisor**; other non-zero = surface as erro
`*` Planning is interactive, so the Stage-2 gate is awkward as a hard hook. Two
viable wirings, decided by [OPEN-3]: (a) a Stop hook on the planning command that
blocks "proceed to execution," or (b) a supervisor self-check step that calls
`bin/gate-stage2-complete` before the first dispatch. `gate-validate-artifact`
`libexec/gate-stage2-complete` before the first dispatch. `gate-validate-artifact`
(PostToolUse Write) is deterministic and works in interactive planning regardless.

**The feedback loop, exactly:** a SubagentStop gate exits 2 → Claude Code blocks the
Expand All @@ -123,14 +123,14 @@ orchestration engine.
```
md-db validate <attempt-or-story-dir> --schema ${CLAUDE_PLUGIN_ROOT}/schemas/<x>.kdl
```
`bin/gate-validate-artifact` routes by filename:
`libexec/gate-validate-artifact` routes by filename:
```
init.md|output.md -> agent-io.kdl
stories.md|tasks.md|validate.md|plan.md|plan-ready.md -> planning-artifacts.kdl
```
md-db enforces frontmatter, field types/enums/patterns, required sections, tables,
and cross-doc refs. It CANNOT enumerate the dynamic `## Tn` headings — those are
checked by `bin/gate-plan-shape` (grep: every checkbox line carries `path::fn`).
checked by `libexec/gate-plan-shape` (grep: every checkbox line carries `path::fn`).

**ctx-symbols (analyzes the source code).** `gate-scaffold-verify` and
`gate-structural-integrity` probe `command -v ctx-symbols`:
Expand Down Expand Up @@ -311,7 +311,7 @@ EXECUTION (autonomous, supervisor present, human absent)
`PostToolUse * -> transcripts record` (full payload); `Stop * -> transcripts snapshot`;
`SubagentStop * -> transcripts stop` (snapshot + stage-out). `final-gate` runs on
`SubagentStop`/`final-gate`.
- `bin/transcripts` (file-based) + per-worktree `.agentic/task.env` contract; `_gatelib.sh`
- `libexec/transcripts` (file-based) + per-worktree `.agentic/task.env` contract; `_gatelib.sh`
sources it so the gates get TASK_ID / SCOPE_GLOBS / SCAFFOLD_SYMBOLS / BASE_REF for
real (closes the env-injection gap). `.agentic/`, `.transcripts/` are git-ignored.
- Retrospective activity (`pipeline/planning/retrospective/`) + `archivist` agent +
Expand Down
6 changes: 3 additions & 3 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ tasks.md, validate.md, plan.md, plan-ready.md, sprintN/plan.md.
│ ├── post-planner.md # NEW: post-RED scaffold pass
│ └── final-gate.md
├── hooks/hooks.json # the deterministic gates (§ 10BC8 3)
├── bin/ # scripts the hooks call
├── libexec/ # scripts the hooks call
│ ├── gate-stage2-complete # planning→execution handoff gate
│ ├── gate-red-verify
│ ├── gate-green-verify
Expand All @@ -144,7 +144,7 @@ tasks.md, validate.md, plan.md, plan-ready.md, sprintN/plan.md.
- PostToolUse hooks cannot undo an action (tool already ran) — so destructive
prevention must be PreToolUse, not PostToolUse.
- This is a DESIGN. None of it is verified against a live runtime yet; the
bin/ gates are offline-testable, the hook wiring needs a real CC session.
libexec/ gates are offline-testable, the hook wiring needs a real CC session.

────────────────────────────────────────────────────────────────────────────
## 8. [OPEN] — not decided, do NOT guess
Expand Down Expand Up @@ -324,7 +324,7 @@ patterns not one-offs; bounded + deduped.
A global append-only `global.jsonl`, plus per-task `events.jsonl` (the full hook
payload per tool call + every user prompt) and `transcript.jsonl` (the complete session
snapshot — every message and thinking block — copied from the session's `transcript_path`
on stop). No FUSE. At `SubagentStart` the supervisor's `bin/transcripts stage-in` copies
on stop). No FUSE. At `SubagentStart` the supervisor's `libexec/transcripts stage-in` copies
the task's slice into the worktree as READ-ONLY (`.transcripts/`); `UserPromptSubmit`
records prompts; `PostToolUse *` records the full tool payload (`transcripts record`);
`Stop`/`SubagentStop *` snapshot the full transcript and remove the slice (`transcripts
Expand Down
6 changes: 3 additions & 3 deletions docs/KICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Then skim:
- `.claude-plugin/plugin.json` manifest (skills/agents/hooks registered)
- `agents/<role>.md` 8 personas, assembled from `pipeline/*/persona.md`
- `hooks/hooks.json` event -> matcher -> gate wiring (real)
- `bin/gate-*`, `bin/log-execution` gate bodies — REAL where structural, STUB
- `libexec/gate-*`, `libexec/log-execution` gate bodies — REAL where structural, STUB
(SUB-AGENT-TODO) where language/repo-specific
- `schemas/*.kdl` md-db schemas (agent-io / planning-artifacts / ledger)
- `pipeline/` design source of truth (4 files per activity)
Expand All @@ -54,7 +54,7 @@ Then skim:
[dispatched sub-agent; add the gate guard "a body implemented instead of
panic+TODO => reject".]
- OPEN-3 Stage-2 gate as a Stop hook or a supervisor self-check step.
[supervisor self-check calling bin/gate-stage2-complete; keep the
[supervisor self-check calling libexec/gate-stage2-complete; keep the
PostToolUse md-db hook either way.]
- OPEN-4 init.md/output.md path scheme.
[per-task `T<k>/attempt-K/` dirs — see ARCHITECTURE §6; gives per-task
Expand Down Expand Up @@ -111,7 +111,7 @@ DO NOT pull into the plugin (these are why this is a plugin, not that binary):
4. FINALIZE hooks.json per OPEN-3.
5. IMPLEMENT the data-plane writers in the skill: per-task `attempt-K/init.md`
(append-only, turn-counted), `output.md`, `plan-ready.md` (tick on pass only),
`execution.log` via `bin/log-execution`. Worktree per dispatch; merge on pass;
`execution.log` via `libexec/log-execution`. Worktree per dispatch; merge on pass;
abandon chain worktrees on HALT.
6. VERIFY end to end: `md-db validate` a sample init.md/output.md against
agent-io.kdl; dry-run a one-story sprint; confirm RED fails by assertion,
Expand Down
Loading
Loading
0