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: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"name": "autodev",
"description": "Autonomous development workflow skills for coding agents",
"version": "6.6.2",
"version": "6.6.3",
"source": "./",
"author": {
"name": "Jon Langevin",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "autodev",
"description": "Autonomous development workflow skills for coding agents: design, review, planning, execution, monitoring, and retrospectives",
"version": "6.6.2",
"version": "6.6.3",
"author": {
"name": "Jon Langevin",
"email": "jon@gocodealone.com"
Expand Down
2 changes: 1 addition & 1 deletion .cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "autodev",
"displayName": "Autonomous Dev Kit",
"description": "Autonomous development workflow skills for coding agents",
"version": "6.6.2",
"version": "6.6.3",
"author": {
"name": "Jon Langevin",
"email": "jon@gocodealone.com"
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/resource-lifecycle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Resource Lifecycle
on:
push:
paths:
- 'scripts/job-resources.py'
- 'tests/job-resources.py'
- 'tests/resource-lifecycle-docs.sh'
- 'docs/resource-lifecycle.md'
- 'docs/README.codex.md'
- 'skills/executing-plans/**'
- 'skills/subagent-driven-development/implementer-prompt.md'
- 'skills/finishing-a-development-branch/**'
- '.github/workflows/resource-lifecycle.yml'
pull_request:
paths:
- 'scripts/job-resources.py'
- 'tests/job-resources.py'
- 'tests/resource-lifecycle-docs.sh'
- 'docs/resource-lifecycle.md'
- 'docs/README.codex.md'
- 'skills/executing-plans/**'
- 'skills/subagent-driven-development/implementer-prompt.md'
- 'skills/finishing-a-development-branch/**'
- '.github/workflows/resource-lifecycle.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
resource-lifecycle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Metadata safety and concurrent ownership
run: python3 tests/job-resources.py
- name: Guidance contracts
run: bash tests/resource-lifecycle-docs.sh
- name: Python syntax
run: python3 -m py_compile scripts/job-resources.py tests/job-resources.py
2 changes: 1 addition & 1 deletion .hermes/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "autodev",
"displayName": "Autonomous Dev Kit",
"description": "Autonomous development workflow skills for coding agents",
"version": "6.6.2",
"version": "6.6.3",
"author": {
"name": "Jon Langevin",
"email": "jon@gocodealone.com"
Expand Down
11 changes: 11 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Autonomous Dev Kit Release Notes

## v6.6.3 — 2026-10-05

Build-cache reuse and explicit job-resource closeout.

- Execution, implementer and finishing guidance now prefers native/stable compatible Go caches, preserves inherited GOCACHE and requires reasons/ownership for cold-cache isolation. Docker mounts and persistent database data require explicit classification.
- Optional POSIX `scripts/job-resources.py` records session/job resources, explicit success/failure closeout and conservative review hints. Stable locks, no-follow descriptor operations and atomic JSON writes protect cooperating concurrent writers; corrupt/unknown metadata is preserved.
- Active, failed, unknown, reusable, database, Docker-volume and worktree resources stay protected. Overlapping protected paths, links, worktree markers, changed/unreadable trees and inspection limits suppress candidate hints. The helper never runs resource commands or deletes resources.
- Added resource safety/concurrency regressions, guidance contracts and Ubuntu CI. Direct CLI and actual repeated Go-build smoke validate preservation/reuse; source checks do not establish host callback invocation.

No existing cache migration, cleanup daemon, automatic deletion or new lifecycle hook. Adoption is explicit guidance/CLI use and cannot guarantee bounded disk usage. Install in a safe maintenance window: native upgrades can prune older plugin paths used by active sessions.

## v6.6.2 — 2026-10-04

Session plan status and checkpoint acceptance fixes.
Expand Down
23 changes: 23 additions & 0 deletions decisions/0007-resource-closeout-is-nondeleting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ADR 0007: resource closeout records review hints without deleting

**Status:** Accepted
**Date:** 2026-10-05

Repeated temporary build caches and anonymous volumes consume disk, but stale
appearance does not establish ownership or disposable database data. Active caches
and concurrent jobs require preservation.

Use existing native/stable compatible cache reuse in workflow guidance, and an
optional project-local ownership ledger with explicit job closeout. The helper
writes metadata only. Default/unknown/active/failed/reusable resources stay
protected; eligible disposable directories become manual review hints. Docker
volumes, databases and worktrees stay protected. No timeout/PID ownership reclaim.

Rejected: automatic cleanup/prune, global GOCACHE rewrite, a new cache allocator,
resource migration, or undocumented host-hook enforcement. Those approaches add
data-loss/concurrency risks or recreate per-job cache growth.

Consequences: no guaranteed disk quota or automatic reclamation. Crashed jobs can
leave active metadata until their owner explicitly closes them. Live consumer and
data checks are required before any separately authorized removal. Source skills
and direct CLI tests do not prove Codex lifecycle hook invocation.
8 changes: 8 additions & 0 deletions docs/README.codex.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ The `using-autodev` skill is discovered automatically and enforces skill usage d

## Usage

For build/test resource ownership, follow [resource lifecycle guidance](resource-lifecycle.md).
Preserve inherited `GOCACHE`, reuse compatible caches and justify cold-cache
isolation. Identify Docker mounts and protect database data; record success/failure
closeout while preserving active, unknown, failed and reusable resources. Optional
`scripts/job-resources.py` is a POSIX metadata CLI, with manual records on other
hosts. It adds no Codex lifecycle hook or automatic deletion. Host callback
invocation is not established by these source/CLI checks.

Skills are discovered automatically. Codex activates them when:
- You mention a skill by name (e.g., "use brainstorming")
- The task matches a skill's description
Expand Down
27 changes: 27 additions & 0 deletions docs/plans/2026-10-05-resource-lifecycle-code-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Resource lifecycle independent code review

Final verdict SHIP-IT; no remaining findings. Independent review inspected
implementation HEAD `7d2e4d923f1642b7afc7b0d934672b15e0bff9a1`, tree
`56b6c2ecd41cf2d5f293fdf82be7e382a146cb39`; initial BLOCK findings resolved.

| ID | Severity | Finding | Resolution |
|---|---|---|---|
| RCR-01 | Important | Concurrent first lock creation intermittently fails; early test assertion leaves owned children unreaped. | Exclusive-create/existing-open bounded protocol; preserve missing existing-ledger lock; reap every child before assertions. Thirty stress batches pass. |
| RCR-02 | Important | Duplicate JSON fields silently drop unknown owners. | Reject duplicate object keys; report/record/closeout preserve ambiguous bytes. |
| RCR-03 | Important | Candidate scan can inspect detached old directory after path replacement. | Final ancestor-link and descendant identity/timestamp validation; candidate/ancestor/descendant/new-entry regressions preserve data. |

Reviewer inspected full spec/diff, safety attacks, static guidance/version checks,
and actual helper/Go smoke evidence. No resource command, cache rewrite, scope
expansion or manifest mismatch found. Integration proof remains direct CLI/Go;
optional adoption and host hook invocation are not established.

Follow-up RCR-04 (Minor): timeout while reaping a child could leave other owned
fixture processes alive. Added finally kill/reap and a real timeout regression;
this affects only test fixtures. A shared five-second lock deadline also matches
documented acquisition limits. Independent 36-test run, eight mutation attacks and
96 fresh-ledger concurrent operations passed before this harness-only addition.
Final independent run passed all 37 helper tests, nine mutation/corruption attacks
and 96 concurrent operations. Requirements/trace/scope, runtime proof, failure/
recovery, corruption/schema, ownership/identifiers, concurrency, containment/
privacy, performance bounds, compatibility, CI, rollback/release/version skew
and user guidance were scanned. No open production or harness finding remains.
31 changes: 31 additions & 0 deletions docs/plans/2026-10-05-resource-lifecycle-design-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Resource lifecycle design and plan review

Independent read-only adversarial reviewer; initial design FAIL, plan FAIL,
structural alignment PASS. No Critical findings; all inherited design and plan
bug classes scanned. No source/config/session changes by reviewer.

| ID | Phase | Severity | Finding | Author response |
|---|---|---|---|---|
| D1 | design | Important | Exact-resource protection omitted overlapping parents/children. | Suppress protected path overlaps; inspect ancestor/descendant worktree markers, reject ambiguous/budget-exceeded trees. |
| D2 | design | Important | Check/write races and replaceable lock inode could lose ownership. | Separate stable lock, no-follow descriptor-relative operations, parent/lock identity validation and explicit same-user race boundary. |
| D3 | design | Minor | Same cache path does not establish reuse. | Verify effective cache unchanged and second unchanged build avoids package compilation. |
| P1 | plan | Important | Overlap regressions unspecified. | Add protected/reusable/database parent/child and nested/ancestor worktree cases with preservation. |
| P2 | plan | Important | Generic races could miss critical interleavings. | Deterministic directory/lock swap barriers; competing writers across JSON replacements, stable lock and no lost owners. |
| P3 | plan | Minor | Verification commands/results underspecified. | Exact unittest/compile/doc/CLI lifecycle and real Go reuse assertions added. |
| P4 | plan | Minor | Unauthorized wording could imply authentication. | Cross-session attribution rejection; explicit non-authentication limitation. |

Scan: project guidance, assumptions, precedent, artifact class, YAGNI, failure
modes, security/privacy, infrastructure, multi-component/declared proof, UI,
rollback, simpler alternative, user intent and runtime validity. Additional plan
scan: decomposition, verification class, auth chains, dependencies, rollback/
integration wiring, matrix/UI routes, infrastructure, loader layout, schema,
identifiers and compile validity. Findings above cover all non-clean results.

Alternative: retain optional guidance/ledger with conservative overlap and stable
descriptor lock contract. Adoption remains voluntary; no bounded-disk guarantee.
Forward/reverse trace R1→Task2, R2/R3/R4→Task1, R5→Tasks3/4 is structural PASS.

Cycle 2: design PASS, plan PASS, alignment PASS; no open Important/Critical
findings. D4 (Minor) clarified ancestor inspection stops before the project root;
the author added the boundary and will test an ordinary Git project's candidate.
All D1-D4/P1-P4 findings are resolved or assigned to the existing regression task.
125 changes: 125 additions & 0 deletions docs/plans/2026-10-05-resource-lifecycle-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Resource lifecycle prevention design

Authorization: the user requested optimizations to reduce repeated disk exhaustion,
an independently reviewed release, and preservation of active caches/installations.
The separate disk cleanup work owns its approved deletions; this change performs none.

## Guidance and evidence

- `AGENTS.md`: generic multi-host workflows, isolated changes, repository contracts,
synchronized manifests and existing release process.
- Parent audit: 113 temporary Go caches (107.53 GiB); 238 new Docker volumes
(30.24 GiB), 236 anonymous, since October 3. Active caches and unique database
data require preservation. This is delegated audit evidence, not a fresh disk scan.
- [Go build cache documentation](https://pkg.go.dev/cmd/go#hdr-Build_and_test_caching):
native cache reuse supports concurrent Go commands and compiler/options changes;
changed C libraries require explicit rebuild handling.
- [Docker volume documentation](https://docs.docker.com/engine/storage/volumes/):
anonymous volumes persist and are not automatically reused between containers.
- [Issue #101](https://github.com/GoCodeAlone/autonomous-dev-kit/issues/101):
supported resource/runtime acceptance and explicit ownership remain follow-ups.

## Bounded response

R1: Existing execution/implementation/finishing guidance must prefer the effective
Go cache or a compatible stable project/toolchain cache. Preserve existing
`GOCACHE`; never change global Go settings. Require a concrete isolation reason
before a new cold cache, record its owner and closeout. Cache compatibility is not
database compatibility: identify every Docker mount and explicitly classify data.

R2: An optional POSIX Python standard-library helper records resources, closes
the calling job, and reports cleanup review candidates. It never executes Go,
Docker, removal, process stopping, or resource creation. Only its project-local
metadata is written. Guidance is usable without the helper on other platforms.

R3: Active, unknown, failed, reusable, database, Docker-volume and worktree
resources remain protected. A disposable directory can become a review candidate
only inside the project's `.autodev/tmp`, with a stated reason, existing directory,
no symlink/escape/worktree marker, and every recorded owner explicitly closed
successfully. Candidates cannot contain or lie within a protected recorded path.
Ancestor and descendant worktree markers, symlink descendants, unreadable trees,
or inspection beyond a bounded entry budget keep the directory protected.
Ancestor inspection stops before the enclosing project root, whose own Git
marker is expected; a positive normal-Git-project fixture verifies this boundary.
Output is a stale-able hint: live consumers and data intent must be
checked again before any separately authorized deletion.

R4: Concurrent writers must not lose ownership records. Session/job identities
are explicit attribution, not authentication. A different session cannot close a
job; closed jobs cannot be silently reused. Shared resources merge toward more
protective retention and purpose. Corrupt/unknown metadata is never reset. Failed
commands/crashes leave active ownership until explicit closeout, not PID/age guesses.

R5: Integrate meaningful helper and guidance regressions into CI, perform real CLI
and repeated Go-build smoke, review independently, and release v6.6.3 through the
existing tag/marketplace process. Preserve active native installation until the
existing maintenance condition is satisfied. No new hook declaration or claim of
Codex lifecycle invocation: this is explicit skill guidance and optional CLI use.

## Interface and ownership model

`scripts/job-resources.py --project <root> record --session <id> --job <id>
--kind directory|docker-volume|worktree --resource <path-or-name>
--purpose build-cache|test-fixture|database|unknown
--retention protected|reusable|disposable [--reason <brief>]`

`closeout --session <id> --job <id> --outcome success|failure` and `report`
return JSON. Record creates an active job on its first resource; no implicit owner
claim from timestamps, directory names, container state, or another session's log.
Default purpose and retention are unknown/protected. Disposable declarations for
external paths, databases, volumes or worktrees fail instead of weakening policy.

Metadata lives at `.autodev/state/job-resources.json` with a schema version and
project identity. POSIX `flock` uses a separate stable lock file that the helper
never replaces; only the JSON ledger is atomically replaced. Lock acquisition has
a bounded timeout. Metadata operations use no-follow directory descriptors and
descriptor-relative file opens/replacements, with parent/lock identity checks
before reads and commits. Observed directory/lock swaps fail without following
replacement targets. Cooperating helper writers are serialized; a same-user actor
can still move an already-opened original directory after validation. Such
tampering is not an authentication boundary: writes remain in that original owned
inode, not a replacement symlink's target, and detected changes are reported.
Read-only empty reports create nothing. Candidate paths are
revalidated at report time. The helper records identifiers and concise reasons,
not full command lines, environment dumps or credentials.

## Alternatives and limits

- Chosen: reuse native cache behavior plus explicit resource metadata and safe
closeout guidance. See `decisions/0007-resource-closeout-is-nondeleting.md`.
- Rejected: cleanup daemon, global cache rewrites, automatic volume pruning,
ownership inferred from age/PIDs, or migration of existing caches.
- Rejected: a new custom cache allocator. Native Go already provides stable reuse;
another per-job allocator could reproduce the reported growth.
- Limits: guidance does not programmatically block arbitrary future allocations.
The ledger knows only declared owners and cannot prove a path has no live
consumers. Docker/database data always requires manual review. Abrupt job loss
preserves resources and may leave conservative active records.

## Validation and rollback

Tests cover same-resource concurrent sessions, cross-session closeout rejection,
active/unknown/failed owners, policy escalation, repeated jobs, missing/corrupt or
future schema, lock/write failures, path traversal and deterministic directory/
lock swaps, nested/ancestor worktrees, protected parent/child overlaps, and byte
preservation of external/cache/database sentinels. Candidate
reporting must never remove or modify a resource. Test fixtures are owned temporary
directories; no real Docker volumes or other worktrees are touched.

Runtime smoke uses the shipped CLI and two real Go builds of an owned tiny project
with an existing effective cache, recording the same cache as reusable. Record
effective GOCACHE before/after and assert the unchanged second `go build -x`
contains no package compilation, rather than treating a shared path as reuse proof.
No new cold Go cache for demonstration. Host hook dispatch remains unverified and unused.
Rollback is a successor patch/revert; leave resource metadata/resources intact.
No installation refresh, destructive data migration, or protection-setting change.

## Backport 2026-10-05: review-discovered interleavings

Native concurrent nonexclusive lock creation reproduced intermittent ENOENT.
Use exclusive first creation plus bounded existing-open retry; never recreate a
missing lock beside an existing ledger. Independent review also demonstrated
duplicate JSON fields dropping unknown ownership and candidate scans of detached
old inodes. Reject duplicate fields and revalidate ancestor links plus bounded
descendant identities/timestamps before returning a hint. Inspection also stops
at 64 directory levels. Existing Tasks 1/3 cover these regressions; manifest unchanged.
9 changes: 9 additions & 0 deletions docs/plans/2026-10-05-resource-lifecycle-plan-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Resource lifecycle plan review

Independent read-only review: Cycle 1 FAIL; Cycle 2 PASS, alignment PASS.
P1 overlap, P2 deterministic race/serialization, P3 precise verification and P4
attribution terminology resolved as recorded in the design-review companion.
Every design requirement maps to an existing task, and every task is justified.
Structural scope validation passed: one PR, four tasks, unique task assignment.
All design/plan bug classes were scanned; no open Important/Critical findings.
Minor D4 is included in Task 1: positive candidate within a normal Git project.
Loading
Loading