Define contributor finalisation and integration lifecycle
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
|
||||
`forge/` holds framework-independent helpers. `templates/` contains independent stack-specific packages; `flask-react/` now includes a descriptor, source payload, fresh context boilerplate, optional GitHub workflow, and a standalone generator. `skills/` is the canonical source for four skills. `profiles/` holds business and personal defaults. `scripts/` provides portable user-level skill distribution. `docs/specifications/` defines interfaces; integrations are optional.
|
||||
|
||||
The context skill owns project records, tasks, worktrees, profiles, and design approvals. New delegates lifecycle setup to context. Contributor uses the context lifecycle with Captain/Commander authority and isolated testing. Design uses context for approvals and records. These are contracts, not active skill implementations.
|
||||
The context skill owns project records, tasks, worktrees, profiles, design approvals, and the canonical lifecycle reference. New delegates lifecycle setup to context. Contributor uses the context lifecycle with Captain/Commander authority, automatic review submission after contributor completion, and isolated testing. Design uses context for approvals and records. Three skill packages are implemented; New remains reserved.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Current state
|
||||
|
||||
FORGE-F001, FORGE-F002, FORGE-F006, and FORGE-F007 were human accepted and are present on `codex`. F003 and F004 candidates are merged with external validation and acceptance pending. F006 provides an independent Flask/React template package and generator, with SQLite, PostgreSQL, MySQL, and MariaDB migrations verified in disposable Docker containers. Windows generation remains untested. The original bootstrap repository remains available; no external retirement was performed. Explicit business/personal profile configuration is implemented. `bortstack-context`, `bortstack-contributor`, and `bortstack-design` packages are present; one skill directory remains reserved. The repository `testtask` entry point is provisioned but blocked because Forge has no application runtime or manual-test hook. No cross-template generator or active legacy-skill migration has been implemented. Captain reports successful external validation of local Penpot 2.18 Docker and integrated MCP, but this session has no Penpot connector/browser. JJ's hands-on workflow has not been tested. Decisions FORGE-001 through FORGE-010 remain accepted. Captain has authorised direct `codex` work until further notice.
|
||||
FORGE-F001, FORGE-F002, FORGE-F006, and FORGE-F007 were human accepted and are present on `codex`. F003 and F004 candidates are merged with external validation and acceptance pending. A Captain-authorised F004 lifecycle follow-up is in isolated branch/worktree `codex-forge-f004-lifecycle` at `/tmp/bortstack-forge-f004-lifecycle`, based on `934e62c`; it extends F002's accepted context contract without reopening F002. F006 provides an independent Flask/React template package and generator, with SQLite, PostgreSQL, MySQL, and MariaDB migrations verified in disposable Docker containers. Windows generation remains untested. The original bootstrap repository remains available; no external retirement was performed. Explicit business/personal profile configuration is implemented. `bortstack-context`, `bortstack-contributor`, and `bortstack-design` packages are present; one skill directory remains reserved. The repository `testtask` entry point is provisioned but blocked because Forge has no application runtime or manual-test hook. No cross-template generator or active legacy-skill migration has been implemented. Captain reports successful external validation of local Penpot 2.18 Docker and integrated MCP, but this session has no Penpot connector/browser. JJ's hands-on and Windows workflow has not been tested. Decisions FORGE-001 through FORGE-011 remain accepted. FORGE-008 still authorises direct `codex` work generally; Captain explicitly requested isolation for this follow-up.
|
||||
|
||||
+4
-1
@@ -1,6 +1,6 @@
|
||||
# Architecture decisions
|
||||
|
||||
FORGE-001 through FORGE-005 were approved planning inputs on 2026-11-17 and are retained with subsequent approved details. FORGE-006 records the approved task identification policy. FORGE-007 supersedes only the PitchInvader pilot clause of FORGE-004; its design ownership and approval policy remain in force. FORGE-008 records Captain's temporary direct-`codex` workflow. FORGE-009 records the approved template migration defaults. FORGE-010 records the approved database set for the Flask/React template.
|
||||
FORGE-001 through FORGE-005 were approved planning inputs on 2026-11-17 and are retained with subsequent approved details. FORGE-006 records the approved task identification policy. FORGE-007 supersedes only the PitchInvader pilot clause of FORGE-004; its design ownership and approval policy remain in force. FORGE-008 records Captain's temporary direct-`codex` workflow. FORGE-009 records the approved template migration defaults. FORGE-010 records the approved database set for the Flask/React template. FORGE-011 records the contributor finalisation and integration policy.
|
||||
|
||||
## FORGE-001 — Technology-Agnostic Project Bootstrap Architecture
|
||||
Status: Accepted. Date: 2026-11-17. Rationale: project lifecycle must apply across stacks. Consequences: Core has no Flask, React, React Native, or other framework dependency; independently maintained templates own stack-specific behavior. Generated projects have no Forge runtime dependency. Supersedes: none.
|
||||
@@ -31,3 +31,6 @@ Status: Accepted. Date: 2026-11-17. Rationale: generated applications must remai
|
||||
|
||||
## FORGE-010 — Multi-Database Flask/React Template
|
||||
Status: Accepted. Date: 2026-11-17. Rationale: Captain wants the generated application to support multiple database engines and selected SQLite, PostgreSQL, MySQL, and MariaDB for FORGE-F006. Consequences: local generation defaults to persistent SQLite; PostgreSQL, MySQL, and MariaDB are opt-in Compose overlays with their respective Python drivers and configuration examples. Validate generated migrations against all four engines. Database credentials belong in private project configuration, never in tracked production files. Supersedes: the inherited assumption that MySQL is the default generated database.
|
||||
|
||||
## FORGE-011 — Contributor Finalisation and Verified Integration
|
||||
Status: Accepted. Date: 2026-11-17. Rationale: completed contributor tasks must not accumulate as uncommitted or unintegrated worktrees. Consequences: `bortstack-context` owns one state and evidence contract; `bortstack-contributor` automatically starts ordinary commit/push/review submission when JJ reports task completion, subject to repository policy and required checks. Captain approval precedes merging contributor PRs. Integrated requires combined-application verification; Closed requires human acceptance. Contributor-created temporary Docker test containers remain until JJ explicitly requests cleanup, subject to safety constraints. Windows exercise is mandatory before F004 is production-ready. The Captain explicitly requested an isolated branch/worktree for this follow-up, an exception to FORGE-008's current default. Supersedes: no earlier accepted decision; clarifies FORGE-F002 and FORGE-F004 lifecycle requirements.
|
||||
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
# Handoff
|
||||
|
||||
Current work: FORGE-F006 migrated the tracked `flask-react-auth-base` source at `ff139bf5f28f4604b4a7108f4ee26608dea9924e` into Forge on `codex`, starting from `bc6b6d2`. Captain accepted F006 on 2026-11-17; its status is Complete. The original source repository was read and remained clean/unchanged. Direct `codex` work follows FORGE-008. No external application, provider, or production infrastructure was modified.
|
||||
Current work: Captain authorised a contributor integration lifecycle follow-up to the existing FORGE-F004 candidate and FORGE-F002 context contract. F002 is Complete and remains so. F004 is still pending external validation and acceptance. This follow-up uses branch `codex-forge-f004-lifecycle`, worktree `/tmp/bortstack-forge-f004-lifecycle`, baseline `934e62c`, and integration target `codex`; it remains unmerged pending review. The original F004 worktree is preserved.
|
||||
|
||||
Implementation: `templates/flask-react/` now contains a descriptor, independent source payload, Python generator, fresh neutral context boilerplate, and optional GitHub workflow. Generated projects do not need GitHub, SWAG, Resend, a production host, or Forge at runtime. Email is disabled by default, branding is project-specific, and optional SWAG uses a separate Compose overlay. Under FORGE-010, the generated Compose base uses persistent SQLite; PostgreSQL, MySQL, and MariaDB have opt-in database overlays and example environment files. The API image includes psycopg and PyMySQL. Existing `roborto-*` skills and Forge distribution tooling are untouched.
|
||||
Implementation: `bortstack-context/references/task-lifecycle.md` is the canonical state, transition, evidence, identifier and integration contract. Context points to it; Contributor owns automatic conversational finalisation and the review handoff. Shared specifications and F004 requirements now distinguish isolated implementation/testing, verified review submission, Captain-approved integration with combined checks, and human-accepted closure. Docker test resources remain until Commander requests cleanup. `docs/validation/contributor-lifecycle.md` covers acceptance scenarios A-I. No external project, provider setting, production infrastructure or installed skill was modified.
|
||||
|
||||
Validation: Forge `python3 -m unittest discover -s tests -v` passed 15 tests and `python3 scripts/validate-skills.py` passed. A disposable `Orion Starter` generated at `/tmp/forge-f006-orion2` passed 14 backend tests in an ephemeral Docker container, SQLite migration upgrades, Compose configuration, and API/nginx image builds. A fresh `/tmp/forge-f006-orion3` passed base and optional SWAG-overlay Compose configuration, clean `npm ci`, 16 frontend tests, lint, and build in a Node container. A further disposable `/tmp/forge-f006-browser-trial` passed 23 Playwright checks with one intentional skip after Chromium OS libraries were installed in the ephemeral runner. A new `Matrix Trial` generation passed base and all database-overlay Compose configuration, API image build, and live Alembic upgrades on SQLite, PostgreSQL, MySQL, and MariaDB. Disposable database containers, networks, and volumes were removed. Generator tests cover local-only mode, optional local Git, collision refusal, copied capabilities, neutral identity, no active GitHub workflow, and the database overlays. `git diff --check` passed.
|
||||
Validation: `python3 -m unittest discover -s tests -v` passed 17 tests, `python3 scripts/validate-skills.py` accepted all three implemented skills, `python3 scripts/install-skills.py --dry-run --dest /tmp/forge-f004-lifecycle-install-check` planned all three without installation, and `git diff --check` passed. Local Git fixtures cover sequential tasks, failed combined checks, failed push preservation and paths with spaces; context fixtures cover historical and conflicting IDs. These tests cannot prove actual provider PR submission or JJ's conversational/Windows Docker workflow.
|
||||
|
||||
Limitations: Host Python lacked Flask, so a direct host test failed; an initial network-disabled pip install and API build also failed on dependency resolution. Container validation succeeded using available dependency/image cache and normal Docker networking. Host npm was absent, but a clean generated-project `npm ci` and subsequent checks passed inside Node Docker. `npm ci` reported 14 advisories in development dependencies (5 moderate, 7 high, 2 critical); `npm audit --omit=dev` reported zero production advisories. The first Playwright attempt failed because the minimal runner lacked Chromium libraries; after installing those libraries inside an ephemeral container, the suite passed. The full backend test suite has not been run separately on PostgreSQL, MySQL, or MariaDB; live migration checks passed on each. Windows generation and live email/hosting remain unverified. The original bootstrap remains available; retiring it would require a separate change outside Forge. Forge `testtask` remains blocked because Forge has no application runtime.
|
||||
Limitations: Windows and JJ hands-on testing remain mandatory before F004 is production-ready. A real provider push/PR and full combined-application UI/API verification are not available in this Forge-only exercise. The local `testtask` wrapper remains provisioned but blocked without an application runtime/hook. F003 retains its separate pending approval. The F006 template is accepted; its original source repository remains untouched.
|
||||
|
||||
Next action: F005 may use the accepted descriptor and generator. F008's F006 dependency is also satisfied. F003 and F004 still await their separate external validation and acceptance. No push or deployment has occurred.
|
||||
Next action: review the scoped branch and validation evidence, then obtain any required approval before integration into `codex`. After integration, run combined Forge checks and record the integration commit. F004 still needs JJ's Windows, Docker, provider and conversational acceptance exercises before Complete. Do not push or merge by assumption.
|
||||
|
||||
@@ -16,6 +16,8 @@ Acceptance: demonstrate lifecycle and collision checks with new and legacy repos
|
||||
|
||||
Implementation record (2026-11-17): Added the canonical skill, snapshot command reference, read-only task ID/worktree audit, ZIP snapshot entry point, and explicit blocked `testtask` entry point. Tests cover collision handling for new and legacy IDs and safe snapshots of edited/untracked files. The skill defines lifecycle gates and preservation of unfinished work. Runtime manual testing remains unavailable until Forge has a task-specific hook; Windows is untested.
|
||||
|
||||
Contributor integration follow-up (2026-11-17): F002 remains Complete. Its accepted context skill is being extended with the canonical state-transition and evidence reference under the Captain-authorised F004 lifecycle follow-up; this does not reopen or renumber F002. The reference owns collision resolution and combined-integration gates for other skills.
|
||||
|
||||
## FORGE-F003 — Implement `bortstack-design`
|
||||
Status: Merged into local `codex`; Captain design approval and external validation pending. Priority: High. Dependency: FORGE-F002, Complete and integrated into local `codex`; no dependency blocker. Implementation was committed on `codex-forge-f003` at `/tmp/bortstack-forge-f003` and fast-forward merged into `codex` on 2026-11-17. Planning reconciliation remains preserved separately at `/tmp/bortstack-forge-f003-reconciliation`.
|
||||
|
||||
@@ -44,6 +46,8 @@ Acceptance: test two consecutive contributor tasks. Submit the first for review
|
||||
|
||||
Implementation record (2026-11-17): Added the canonical contributor skill and review-handoff reference. A disposable Git test exercised two consecutive task branches/worktrees, selective staging, preserved untracked work, and no merge into the integration branch. The first review was represented by a local marker, not a provider PR. Real PR submission, JJ's Windows installation, manual Docker testing, and JJ's hands-on workflow remain unverified; do not mark Complete until the required human acceptance and external checks are resolved.
|
||||
|
||||
Contributor integration follow-up (2026-11-17): Captain authorised a dedicated `codex-forge-f004-lifecycle` branch at `/tmp/bortstack-forge-f004-lifecycle`, based on `934e62c`, to strengthen the existing F004 candidate and shared context contract. The contributor skill now initiates finalisation from natural completion language and uses context's canonical lifecycle; review submission, Captain-controlled integration, combined checks, recoverable failure handling, task-ID conflict resolution, Docker retention, and nontechnical messaging have explicit gates. Acceptance scenarios A-I are recorded in `docs/validation/contributor-lifecycle.md`; Windows and real provider/JJ exercises remain open. F004 stays pending external validation and human acceptance; do not mark it Complete from this follow-up alone.
|
||||
|
||||
## FORGE-F005 — Implement `bortstack-new`
|
||||
Status: Planned. Priority: High. Dependencies: FORGE-F002, FORGE-F006, FORGE-F007.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Integration and skill interfaces
|
||||
|
||||
`bortstack-context`: project overview/current state, decisions, tasks, handoffs, task-scoped branches/worktrees, design references/approvals, and profile interpretation for new and existing repositories. `bortstack-new`: template selection, generation orchestration, initial configuration and profile, optional Git repository configuration; delegates lifecycle conventions to context. `bortstack-contributor`: onboarding, permitted task creation and implementation, PR preparation, contributor tests and handoff; preserves JJ's task creation, Captain/Commander terminology, isolated branches, and disposable Docker test environments. Manual-testing containers remain available until the contributor is instructed to remove them. `bortstack-design`: visual design orchestration, optional Penpot/MCP operations, concepts, approved handoff, code guidance, and visual QA; delegates task status and approvals to context. Design-dependent implementation needs an approved design or an explicit recorded override.
|
||||
`bortstack-context`: project overview/current state, decisions, tasks, handoffs, task-scoped branches/worktrees, design references/approvals, and profile interpretation for new and existing repositories. Its `references/task-lifecycle.md` is the single source for task states, transition evidence, integration and closure gates, project-prefixed IDs, collision handling, and worktree preservation. `bortstack-new`: template selection, generation orchestration, initial configuration and profile, optional Git repository configuration; delegates lifecycle setup to context when implemented. `bortstack-contributor`: onboarding, permitted task creation and implementation, automatic finalisation after JJ reports completion, PR preparation, contributor tests and plain-language handoff; consumes context's lifecycle rather than duplicating it. It preserves JJ's task creation, Captain/Commander terminology, isolated branches, and disposable Docker test environments. Contributor-created manual-testing containers remain available until JJ explicitly requests removal, subject to safety constraints. `bortstack-design`: visual design orchestration, optional Penpot/MCP operations, concepts, approved handoff, code guidance, and visual QA; delegates task status and approvals to context. Design-dependent implementation needs an approved design or an explicit recorded override.
|
||||
|
||||
Git providers and Penpot are optional adapters. A provider integration must declare authentication, supported operations, failure behavior, and local-only fallback; no provider is assumed. Penpot absence must not block context or non-design tasks. No MCP server or provider integration is configured in this task.
|
||||
Git providers and Penpot are optional adapters. A provider integration must declare authentication, supported operations, failure behavior, and local-only fallback; no provider is assumed. A committed task is not a verified review submission, and a Git merge is not verified application integration. Captain approval precedes contributor-PR merging; combined-application checks precede Integrated, and human acceptance precedes Verified / Closed. Penpot absence must not block context or non-design tasks. No MCP server or provider integration is configured in this task.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Contributor lifecycle acceptance exercises
|
||||
|
||||
Use only disposable repositories and task-owned test resources. `python3 -m unittest tests/test_contributor_workflow.py tests/test_context.py` exercises the local Git and identifier fixtures on Linux. These fixtures validate preservation and ordering; they do not simulate a provider PR, a human approval, or Windows. For every exercise, record the task state and evidence fields from `skills/bortstack-context/references/task-lifecycle.md`.
|
||||
|
||||
| Scenario | Repeatable procedure and expected result | Current evidence |
|
||||
| --- | --- | --- |
|
||||
| A — Sequential tasks | In a disposable repo, complete Task A in its worktree, inspect/stage intended files, commit and submit it for review, then start independent Task B from the integration baseline. A remains recoverable and unmerged; B excludes A's commit. | Automated local fixture; review marker only, not a real PR. |
|
||||
| B — Combined failure | Pass Task A's isolated checks, approve and integrate it in a disposable target, then make a combined test fail. Record failure and keep A open; do not mark Integrated or Closed. | Automated local fixture checks the failure and open record. Real UI/API checks require an application. |
|
||||
| C — Parallel development | Create two independent worktrees from the same appropriate baseline, record both targets/dependencies, and verify neither branch contains the other's commit. | Automated local fixture. |
|
||||
| D — Failed push/PR | Commit Task A, use a deliberately failing disposable remote or unavailable provider, and run the submission gate. Verify the local commit/worktree survive, state remains pre-review, and Commander receives a plain-language saved-work explanation. | Automated failed-push fixture verifies preservation; provider dialogue pending live exercise. |
|
||||
| E — Docker testing | Start a uniquely named disposable task container, complete and submit the task, verify the container remains, then have Commander explicitly request cleanup and remove only that container. | Documented procedure; live Docker exercise with JJ pending. |
|
||||
| F — Legacy tasks | Inventory `TASK-001` and `FORGE-F001` beside a new prefixed ID. Verify stable IDs and no automatic rewrite. | `tests/test_context.py` fixture. |
|
||||
| G — Task-ID conflict | Put the same new ID in two task registers; run `python3 scripts/context_audit.py first.md second.md`. Expect collision locations and nonzero exit before integration. Captain authorises any renumbering; preview and update all references, then rerun. | `tests/test_context.py` fixture detects collision; authorised renumbering is a documented manual procedure. |
|
||||
| H — Windows | On JJ's Windows machine, use Codex CLI, Git, and Docker with a disposable repo under a path containing spaces. Complete and submit a task through conversation, check remote branch/PR, leave the test container until requested cleanup, and verify another task can start. Use PowerShell for any displayed shell command; avoid Bash assumptions and administrator privileges. | Mandatory external acceptance gate, unverified here. |
|
||||
| I — Nontechnical completion | Ask Commander to say "everything works" after exact-candidate manual testing. Observe Codex identify the task, inspect files, test, commit, push, submit review, and report saved/submitted status without asking Commander to run Git. Repeat with a failed submission and verify truthful ordinary-language recovery message. | Skill instructions and local Git fixtures; JJ's conversational end-to-end exercise pending. |
|
||||
|
||||
After Captain approval, repeat a successful integration exercise against the latest designated baseline, including affected screens, navigation, routes, APIs and dependencies as applicable. A Git merge is only one step. Record combined checks separately from isolated checks. Do not mark F004 production-ready for JJ until H and I pass on his environment and real provider submission is verified where configured.
|
||||
@@ -1,3 +1,3 @@
|
||||
# bortstack-context
|
||||
|
||||
Reserved for a separate implementation task. No SKILL.md is provided.
|
||||
Canonical context skill. `SKILL.md` defines project orientation and ownership; `references/task-lifecycle.md` defines the shared state, evidence, identifier and integration contract.
|
||||
|
||||
@@ -15,13 +15,13 @@ Bootstrap missing records minimally and reconcile existing records without destr
|
||||
|
||||
## Task IDs and reconciliation
|
||||
|
||||
Use a project-specific prefix and sequential number for new tasks (for example `PI-042`). A repository may specify a historical convention such as `FORGE-F###`; retain it. Historical identifiers including `TASK-001` stay valid. Before importing or merging task records, inventory IDs in both sources with `scripts/context_audit.py` or an equivalent check, report any repeated identifier with its source locations, and pause that merge until the human resolves the collision. Do not silently renumber historical records. This is a local collision check, not a global allocator.
|
||||
Follow `references/task-lifecycle.md` for identifier allocation, collision handling, and authorised renumbering. Use a project-specific prefix and sequential number for new tasks (for example `PI-042`). A repository may specify a historical convention such as `FORGE-F###`; retain it. Historical identifiers including `TASK-001` stay valid. Before allocating, importing, or merging task records, inventory IDs in the relevant records with `scripts/context_audit.py` or an equivalent read-only check. Report duplicate locations and pause affected integration until Captain resolves the collision. Never silently renumber historical records or use a global allocator.
|
||||
|
||||
## Task lifecycle
|
||||
|
||||
Use the repository's accepted scope and authority. The shared states are **In Progress**, **Ready to Finalise**, **Ready for Review**, **Merged**, **Closed**, and **Blocked / Suspended**. A planned task is not authorised merely because its dependencies are ready. `lock on` briefs objective, scope, acceptance, dependencies, risks, validation, and unresolved decisions; `engage` implements the briefed accepted task. Use the repository's current branch policy. For a simple scoped task, direct integration-branch work is valid when the Captain or repository explicitly authorises it, the checkout is clean or explained, no other console is changing that branch, and the task can be kept as a reviewable commit. Use a dedicated branch and separate worktree when required by repository policy, concurrent work, unresolved changes, or risk of mixing tasks. Do not check the same branch out twice or switch another console's worktree.
|
||||
`references/task-lifecycle.md` owns the states, valid transitions, evidence and approval gates. Its logical states are **Created**, **In Progress**, **Implementation Complete**, **Testing**, **Ready for Review / Integration**, **Integrated**, **Verified / Closed**, and **Blocked / Suspended**. Existing records may retain **Ready to Finalise** for an implementation candidate, **Ready for Review** for a submitted review, **Merged** for verified integration, and **Closed** for accepted completion. Do not map a passing implementation or a Git merge directly to closure. A planned task is not authorised merely because its dependencies are ready. `lock on` briefs objective, scope, acceptance, dependencies, risks, validation, and unresolved decisions; `engage` implements the briefed accepted task. Use the repository's current branch policy. For a simple scoped task, direct integration-branch work is valid when the Captain or repository explicitly authorises it, the checkout is clean or explained, no other console is changing that branch, and the task can be kept as a reviewable commit. Use a dedicated branch and separate worktree when required by repository policy, concurrent work, unresolved changes, or risk of mixing tasks. Do not check the same branch out twice or switch another console's worktree.
|
||||
|
||||
Before starting another implementation task, audit active worktrees, changes, and handoffs. Previous work must be committed and submitted for review, integrated, or explicitly suspended with its exact state documented. Detect and report unfinished worktrees, uncommitted or untracked files, and missing or incomplete handoffs. Never automatically delete an unfinished worktree. A dedicated branch/worktree is the default unless the repository's current `AGENTS.md` or Captain's explicit direction authorises direct integration-branch work; preserve task scope and status gates in either mode. An implementation passing automated tests is at most Ready to Finalise. Ready for Review requires the repository's review submission; Merged requires verified integration; Closed requires human acceptance and recorded cleanup. Blocked / Suspended preserves the branch, worktree, and resumption instructions. Commit, push, merge, rebase, reset, and deployment require repository-defined authority; do not infer it from `engage`.
|
||||
Before starting another implementation task, audit active worktrees, changes, and handoffs. Previous work must be committed and submitted for review, integrated, or explicitly suspended with its exact state documented. Detect and report unfinished worktrees, uncommitted or untracked files, and missing or incomplete handoffs. Never automatically delete an unfinished worktree. A dedicated branch/worktree is the default unless the repository's current `AGENTS.md` or Captain's explicit direction authorises direct integration-branch work; preserve task scope and status gates in either mode. Implementation Complete or Testing remains separate from review submission and integration. A contributor's completion statement initiates ordinary finalisation under repository policy; Captain approval is required before merging that contributor's PR. Integrated requires combined-application verification, and Verified / Closed requires human acceptance. Blocked / Suspended preserves the branch, worktree, and resumption instructions. Commit, push, merge, rebase, reset, and deployment follow the authority and restrictions in the canonical reference; do not infer integration or deployment authority from `engage`.
|
||||
|
||||
For authorised direct-branch work, record the active task and starting commit, inspect status before editing, keep unrelated changes untouched, and finish with a scoped diff and validation before committing. Record the resulting commit and pending acceptance in the task and handoff. Do not create a test worktree merely for branch ceremony; use the repository's manual-test adapter only when the task actually needs it. If another task or console changes the checkout, stop and reconcile before continuing. Direct commits do not bypass review, design approval, or human completion gates.
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# Shared task lifecycle
|
||||
|
||||
This is the canonical lifecycle for `bortstack-context`. Repository rules may use different labels, but must preserve these gates. Contributor, design, and new-project skills refer here instead of defining competing states. The task record is authoritative; Git and provider state are evidence to inspect, not a substitute for it.
|
||||
|
||||
## States and evidence
|
||||
|
||||
| State | Entry evidence | Permitted next state |
|
||||
| --- | --- | --- |
|
||||
| Created | Unique stable ID, scope, owner, dependencies, acceptance criteria; no implementation authority implied | In Progress, Blocked / Suspended |
|
||||
| In Progress | Authorised task, assigned branch/worktree or explicitly authorised direct branch, baseline commit, integration target, relevant dependencies | Implementation Complete, Blocked / Suspended |
|
||||
| Implementation Complete | Candidate diff reviewed, implementation commit or exact uncommitted state recorded, applicable automated checks recorded | Testing, Blocked / Suspended |
|
||||
| Testing | Exact candidate and manual-test environment identified, result or outstanding test gate recorded | Implementation Complete for fixes, Ready for Review / Integration, Blocked / Suspended |
|
||||
| Ready for Review / Integration | Required tests passed or an explicit accepted exception; intended files committed; branch and commit recorded; push and PR verified where the provider supports them, or a repository-approved local review handoff acknowledged | In Progress for requested changes, Integrated after Captain approval and combined verification, Blocked / Suspended |
|
||||
| Integrated | Captain-authorised integration commit on designated target, combined application tests and affected workflow checks passed, conflicts resolved without discarding work | Verified / Closed, In Progress for reconciliation if later verification fails |
|
||||
| Verified / Closed | Required acceptance criteria and human acceptance recorded, integration evidence linked, task-owned cleanup performed only when authorised | Terminal; reopen through an explicit new record or documented correction |
|
||||
| Blocked / Suspended | Actual step, reason, preserved branch/worktree/commit, owner and resumption action recorded | Previous active state after blocker resolution, or an explicitly authorised replacement state |
|
||||
|
||||
Implementation Complete never means Integrated. A passing isolated test or Git merge alone cannot close a task. A failed combined-application check leaves the task open; record the merge candidate and failure, and return to In Progress for reconciliation or Blocked / Suspended. Never rewrite a successful state merely to hide failed evidence.
|
||||
|
||||
## Required task record
|
||||
|
||||
Record the task ID, state, owner, branch and worktree, baseline commit, integration target, dependencies, implementation commit, provider remote and PR reference where applicable, isolated automated and manual tests, Captain approval, integration commit, combined tests and affected UI/API/dependency checks, acceptance outcome, and any cleanup instruction. Use `not applicable` or `pending` rather than inventing a value. Keep private credentials out of records. For a direct-branch task, record that authorisation and use `not applicable` for the separate worktree/PR fields.
|
||||
|
||||
## Start and finalisation gates
|
||||
|
||||
Before starting another implementation, inspect all worktrees and status, task records and handoffs. A prior task may be left pending review while an independent task starts, but its intended work must be committed and submitted for review, integrated, or explicitly suspended with exact recoverable state. Do not abandon a finished uncommitted worktree. Parallel tasks may use different branches from the latest appropriate integration baseline; record dependencies and targets. Do not use another task's unintegrated commit as an implicit baseline.
|
||||
|
||||
When a contributor says the task is complete or testing works, the contributor skill starts the finalisation sequence automatically. Verify the task and manual test result; inspect staged, unstaged and untracked paths, conflicts and likely secrets; run required checks; stage only intended files; commit; push and create/update a PR when supported; verify the remote commit and PR; record evidence and transition to Ready for Review / Integration. A completion statement is authority for ordinary task finalisation under the repository's contributor policy, not authority to merge, deploy, force-push, delete test resources, or change provider settings. If a gate fails, preserve everything and record the actual state. Stop automated repair after two unsuccessful attempts on the same failure.
|
||||
|
||||
Captain approval is required before merging a contributor PR. After approval, identify the designated integration target and current baseline, integrate using repository policy, resolve conflicts without silently losing changes, test the combined application and affected screens, routes, navigation, APIs and dependencies as relevant, then record integration commit and results. Only then mark Integrated. Human acceptance and remaining criteria control Verified / Closed. Never use destructive reset, forced push, or destructive worktree cleanup without explicit Captain approval. Keep pending-review branches and worktrees recoverable.
|
||||
|
||||
## Identifiers and reconciliation
|
||||
|
||||
New IDs follow the repository's documented project prefix and sequence, for example `PI-042`, `RB-018`, or Forge's historical `FORGE-F###`. Inventory existing task records before allocation. Recognise `TASK-001` and other historical IDs without changing them. Compare IDs from both sides before task-record integration; `scripts/context_audit.py` or an equivalent read-only check reports duplicate headings and locations. Pause the affected task-record merge and warn Captain. If a true collision needs resolution, Captain chooses which record keeps its ID and authorises a new unused ID for the other. Search the affected branch/worktree for task headings, filenames, branch names, handoffs, decisions, PR text and references; preview the exact replacements, update them consistently, then repeat collision and reference checks. Never rewrite historical records automatically or run a central allocator.
|
||||
|
||||
## Test resources and platforms
|
||||
|
||||
Record individual task tests separately from combined integration tests. Keep contributor-created temporary Docker containers available until the contributor explicitly requests removal, subject to safety constraints; task completion alone is not cleanup authority. Use platform-independent Git operations and paths, quote paths with spaces, and provide PowerShell/Bash variants where commands differ. Do not infer Windows compatibility from Linux checks; JJ's Codex CLI, Git and Docker finalisation path must be exercised on Windows before declaring the contributor skill production-ready.
|
||||
@@ -1,3 +1,3 @@
|
||||
# bortstack-contributor
|
||||
|
||||
Reserved for a separate implementation task. No SKILL.md is provided.
|
||||
Contributor skill. `SKILL.md` guides Commander through scoped work and conversational completion; `references/review-handoff.md` defines Codex's automatic review submission and Captain-controlled integration sequence. Shared states and evidence belong to `bortstack-context`.
|
||||
|
||||
@@ -5,7 +5,7 @@ description: Guide an authorised contributor through scoped project tasks, isola
|
||||
|
||||
# Bortstack Contributor
|
||||
|
||||
Use with `bortstack-context`; that skill and repository `AGENTS.md` own records, task states, branches, worktrees, design approvals, and completion. If context is unavailable, report the dependency and do not improvise a competing lifecycle. This skill provides a plain-language contributor interface. Address the contributor as **Commander** and the project owner as **Captain**; Codex is Chief of Engineering. Keep the tone restrained and the status precise. Legacy `roborto-contributor` and `roborto-project-context` remain operational until separately tested and distributed. Do not modify installed skills or historical task IDs.
|
||||
Use with `bortstack-context`; its `references/task-lifecycle.md` and repository `AGENTS.md` own records, task states, branches, worktrees, design approvals, integration evidence, and completion. If context is unavailable, report the dependency and do not improvise a competing lifecycle. This skill provides a plain-language contributor interface. Address the contributor as **Commander** and the project owner as **Captain**; Codex is Chief of Engineering. Keep the tone restrained and the status precise. Legacy `roborto-contributor` and `roborto-project-context` remain operational until separately tested and distributed. Do not modify installed skills or historical task IDs.
|
||||
|
||||
## Orient and select work
|
||||
|
||||
@@ -17,10 +17,10 @@ The Commander may create, refine, or split tasks from real requirements, accepte
|
||||
|
||||
## Test and handoff
|
||||
|
||||
Run the checks the repository requires and inspect the exact candidate diff. If the project provides `scripts/testtask.sh`, inspect its help and configuration before use. Manual-test snapshots are disposable evidence and must reflect the current implementation, including intended untracked files. Refresh after edits. Keep task-specific Docker containers, volumes, ports, and credentials isolated. Never touch unrelated services or production data. Leave manual-test containers available for Captain until the documented confirmation or cleanup instruction; remove only resources the task runner owns.
|
||||
Run the checks the repository requires and inspect the exact candidate diff. If the project provides `scripts/testtask.sh`, inspect its help and configuration before use. Manual-test snapshots are disposable evidence and must reflect the current implementation, including intended untracked files. Refresh after edits. Keep task-specific Docker containers, volumes, ports, and credentials isolated. Never touch unrelated services or production data. Keep contributor-created manual-test containers available until Commander explicitly requests cleanup, subject to safety constraints; remove only resources the task runner owns.
|
||||
|
||||
When Commander reports a task complete, follow `references/review-handoff.md`. Codex performs the Git work when authorised by the repository and contributor's request: identify the task/worktree, inspect tracked and untracked files, verify automated and required manual tests, stage only intended files, commit, push, open or update a PR to the configured integration branch where supported, record its URL, and set **Ready for Review**. Tell Commander Captain approval is pending. The Commander need not operate Git manually. If a gate fails, preserve all work and report the exact blocker. A new task can begin once the previous one is submitted for review. Never merge a Commander's PR without Captain approval. Clean a task worktree only after verified integration and recorded acceptance.
|
||||
When Commander says "task complete", "finished testing", "everything works", or equivalent, automatically start `references/review-handoff.md`. Treat that statement as confirmation of manual testing only when it unambiguously refers to the exact candidate; otherwise ask one plain-language question and continue independent checks. Codex identifies the task/worktree, checks staged, unstaged and untracked files, conflicts and likely secrets, runs required validation, stages only intended files, commits, pushes and opens or updates a PR where supported, verifies submission, records evidence, and asks Captain to review. Ordinary task finalisation does not need Captain intervention. The Commander need not operate Git manually. If a gate fails, preserve all work, explain whether it is safely saved and the next safe action, and stop after two unsuccessful repair attempts for the same failure. A new independent task can begin once the previous task is submitted for review, integrated, or explicitly suspended with recoverable work. Never merge a Commander's PR without Captain approval. Clean a task worktree only after verified integration and recorded acceptance; leave temporary manual-test Docker containers available until Commander explicitly requests removal.
|
||||
|
||||
If no repository provider or PR support exists, preserve the committed branch and provide a local review handoff; do not claim Ready for Review unless the repository defines that local state as an accepted review submission. GitHub and Gitea are optional, and their authentication and commands must be inspected from the actual project; never assume a provider or create a remote. Do not force-push, rebase shared work, or deploy.
|
||||
|
||||
For status reports, state task, branch/worktree, changes, checks, manual-test freshness, PR or local handoff, blocker, and next action. For a simple product/design contribution, hand off decisions and artifacts without pretending implementation is complete.
|
||||
Speak to Commander in ordinary language. For success: "Commander, your changes passed testing and are saved. I've submitted the task for the Captain's review. You can begin another task." Use this only after verifying the submission. On failure, state the problem, whether the work is saved, and one safe next step; give Git details only if requested. Guide decisions rather than asking Commander to remember Git commands. For status reports, state task, changes, checks, manual-test freshness, review submission, blocker, and next action; include branch/worktree details when useful or requested. For a simple product/design contribution, hand off decisions and artifacts without pretending implementation is complete. Windows operation with JJ's Codex CLI, Git and Docker remains an explicit production-readiness gate; Linux tests alone do not satisfy it.
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
# Contributor review handoff
|
||||
# Contributor review and integration handoff
|
||||
|
||||
Follow repository `AGENTS.md`, `bortstack-context`, and the actual provider configuration. These steps are a gate sequence, not blanket permission for remote actions.
|
||||
Use `bortstack-context/references/task-lifecycle.md` for states, evidence and approval gates. Follow repository `AGENTS.md` and actual provider configuration. This sequence starts automatically when Commander reports task completion. It is authority for ordinary contributor finalisation under repository policy, not for merge, deployment, destructive recovery or test-resource cleanup.
|
||||
|
||||
1. Identify the task ID, accepted scope, branch, source worktree, integration branch, and any other active worktrees. Report mismatches before changing Git state.
|
||||
2. Inspect `git status --short`, tracked diff, and every untracked path. Exclude secrets, local data, generated test output, and unrelated work. Preserve them in place. Do not use `git add -A` without a reviewed file list.
|
||||
3. Run required tests, lint/build/security checks, and `git diff --check`. Inspect the repository testtask interface and refresh its candidate after edits. Record manual-test result or the exact missing environment/confirmation. Required manual testing cannot be inferred from green automated checks.
|
||||
4. Update tasks, current state, and handoff with the exact candidate and limitations. Stage only intended files and inspect the staged diff. Commit on the task branch only when authorised by repository policy and the Commander's completion request.
|
||||
5. Check configured remote and provider capabilities. Push the task branch and create/update a PR to the configured integration branch when supported and authorised. Never create a provider account or repository by assumption. Record branch, commit, PR URL, validation, and Captain's pending approval. Set Ready for Review only after successful review submission.
|
||||
6. If validation, staging, commit, push, or PR creation fails, stop the sequence. Preserve worktree, commit, and test resources. Record the exact failed step and recovery command or decision. Never call the task Complete or silently begin another implementation task.
|
||||
7. Captain alone accepts and authorises merge unless repository policy explicitly delegates it. Verify integration before recording Merged; record human acceptance before Closed. Remove only task-owned test containers after authorised confirmation. Clean the task worktree only after both integration and acceptance are recorded.
|
||||
## Submit the completed task
|
||||
|
||||
For local-only Git, provide the committed task branch and exact diff/test commands to Captain. Its status remains Ready to Finalise or Blocked / Suspended according to repository policy until a review handoff is acknowledged. GitHub and Gitea may use different PR commands; discover them from available provider tools and record authentication and failure behavior. A missing provider is not a reason to lose the contribution.
|
||||
1. Identify the active task, accepted scope, source worktree, task branch, baseline commit, integration target, and any parallel task branches. If ambiguous, ask Commander to identify the task in plain language; preserve all work meanwhile.
|
||||
2. Confirm the required manual test covered the exact current candidate. "Everything works" may confirm it when the candidate and testing are clear. Record the result, environment and any limitation. Refresh the task's manual-test snapshot after edits.
|
||||
3. Inspect staged, unstaged and every untracked path; check conflicts, likely secrets, unexpected files and changes outside task scope. Preserve unrelated files. Never use an unreviewed blanket stage. Explain any needed choice without asking Commander to run Git.
|
||||
4. Run repository-required automated tests, lint/build/security checks as applicable and `git diff --check`. Record commands and results. Fix only within scope and stop automated repair after two unsuccessful attempts on the same failure.
|
||||
5. Update task, current state and handoff with branch/worktree, baseline, target, implementation commit when known, isolated test results and limitations. Stage only intended files, inspect staged diff, and commit to the task branch. Verify the commit and remaining working-tree status. A dirty worktree may contain preserved unrelated work; record it explicitly.
|
||||
6. Inspect the configured remote and provider capability. Push the task branch and verify the remote commit. Create or update a PR against the designated integration branch where supported; verify its URL, source/target and status. Record branch, commit, PR reference, test evidence and Captain approval pending. Set Ready for Review / Integration only after verified submission. A repository-approved local review handoff may be used without a provider; otherwise retain the truthful pre-review state. Never invent a PR or create provider settings by assumption.
|
||||
7. Tell Commander in ordinary language that the work is saved and submitted for Captain review, and that another independent task may begin. If any step fails, say what failed, whether the work is committed or only preserved in the worktree, and the next safe action. Do not claim review submission from a local commit or integration from a PR. Preserve branch, worktree and test resources.
|
||||
|
||||
## Two-task gate exercise
|
||||
## After Captain approval
|
||||
|
||||
Use a disposable repository to verify this sequence without touching a contributor project: create accepted tasks A and B; implement A in its own worktree; leave a safe untracked file and verify it appears in status; stage only intended files; commit A; simulate a review submission and record its reference; leave A unmerged; then create B in a different branch/worktree from the integration branch. Check A's worktree and branch remain intact, B does not contain A's commit, and neither task is marked Merged or Closed. If a real PR provider is unavailable, mark that part unverified; a simulated reference is not a PR.
|
||||
Captain approval is required before merging a contributor PR. Identify the current designated integration branch and baseline, check task-ID collisions and dependencies, and integrate with the repository's merge strategy. Resolve conflicts without discarding others' work. Run combined-application tests and verify affected screens, routing, navigation, APIs and dependencies where applicable; record the integration commit and results. Mark Integrated only when verification succeeds. If combined checks fail, preserve the branch and merge history or candidate, record affected files and a reconciliation plan, and leave the task open. Mark Verified / Closed only after required acceptance and human confirmation. Never force-push, destructively reset, or remove an uncommitted/unintegrated worktree without explicit Captain approval. Keep task-created Docker test containers until Commander requests cleanup.
|
||||
|
||||
## Local-only and platform notes
|
||||
|
||||
GitHub and Gitea are optional. Inspect the project's provider tooling and credentials; do not assume `gh`, a remote or PR support. For local-only Git, provide Captain the committed branch and exact review instructions, then wait for an acknowledged local review handoff before Ready for Review / Integration. Use Git argument forms that handle paths with spaces. Codex performs Git operations on both Linux and Windows; Commander needs no shell commands. On Windows, inspect the actual Codex CLI, Git, provider and Docker setup and run an end-to-end finalisation test before claiming production readiness. If commands must be shown, provide PowerShell and Bash variants.
|
||||
|
||||
@@ -47,6 +47,54 @@ class ContributorWorkflowTests(unittest.TestCase):
|
||||
self.assertIn(str(first), git(base, "worktree", "list"))
|
||||
self.assertIn(str(second), git(base, "worktree", "list"))
|
||||
|
||||
def test_failed_push_preserves_committed_task_and_worktree(self):
|
||||
with tempfile.TemporaryDirectory() as temp:
|
||||
base = Path(temp) / "project with spaces"
|
||||
base.mkdir()
|
||||
git(base, "init", "-q", "-b", "codex")
|
||||
git(base, "config", "user.name", "Fixture")
|
||||
git(base, "config", "user.email", "fixture@example.org")
|
||||
(base / "base.txt").write_text("base\n")
|
||||
git(base, "add", "base.txt")
|
||||
git(base, "commit", "-qm", "base")
|
||||
task = Path(temp) / "task with spaces"
|
||||
git(base, "worktree", "add", "-qb", "task-a", str(task), "codex")
|
||||
(task / "feature.txt").write_text("ready\n")
|
||||
git(task, "add", "feature.txt")
|
||||
git(task, "commit", "-qm", "task implementation")
|
||||
commit = git(task, "rev-parse", "HEAD")
|
||||
git(task, "remote", "add", "origin", str(Path(temp) / "missing-remote"))
|
||||
push = subprocess.run(["git", "-C", str(task), "push", "origin", "task-a"], capture_output=True, text=True)
|
||||
self.assertNotEqual(push.returncode, 0)
|
||||
self.assertEqual(git(task, "rev-parse", "HEAD"), commit)
|
||||
self.assertTrue((task / "feature.txt").exists())
|
||||
self.assertIn(str(task), git(base, "worktree", "list"))
|
||||
|
||||
def test_failed_combined_check_does_not_close_task(self):
|
||||
with tempfile.TemporaryDirectory() as temp:
|
||||
base = Path(temp) / "project"
|
||||
base.mkdir()
|
||||
git(base, "init", "-q", "-b", "codex")
|
||||
git(base, "config", "user.name", "Fixture")
|
||||
git(base, "config", "user.email", "fixture@example.org")
|
||||
(base / "shared.txt").write_text("base\n")
|
||||
(base / "TASKS.md").write_text("Task A: Ready for Review / Integration\n")
|
||||
git(base, "add", "shared.txt", "TASKS.md")
|
||||
git(base, "commit", "-qm", "base")
|
||||
task = Path(temp) / "task-a"
|
||||
git(base, "worktree", "add", "-qb", "task-a", str(task), "codex")
|
||||
(task / "feature.txt").write_text("passes isolated check\n")
|
||||
git(task, "add", "feature.txt")
|
||||
git(task, "commit", "-qm", "task implementation")
|
||||
self.assertTrue((task / "feature.txt").exists())
|
||||
git(base, "merge", "--no-ff", "-qm", "approved candidate", "task-a")
|
||||
combined = subprocess.run(["python3", "-c", "import sys; sys.exit(1)"], cwd=base)
|
||||
self.assertNotEqual(combined.returncode, 0)
|
||||
self.assertIn("Ready for Review / Integration", (base / "TASKS.md").read_text())
|
||||
self.assertNotIn("Integrated\n", (base / "TASKS.md").read_text())
|
||||
self.assertIn(str(task), git(base, "worktree", "list"))
|
||||
self.assertEqual(git(task, "rev-parse", "HEAD"), git(base, "rev-parse", "task-a"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user