Implement F004 contributor workflow candidate

This commit is contained in:
rob
2026-11-17 15:46:32 +00:00
parent 6217b9e8fd
commit eda044ef43
6 changed files with 104 additions and 7 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
# Current state
FORGE-F001 foundation was human accepted and is present on `main` and `codex`. FORGE-F002 was accepted for commit and merge into `codex` on 2026-11-17. `bortstack-context` is implemented with a task-ID/worktree audit and ChatGPT snapshot command. The repository `testtask` entry point is provisioned but blocked because Forge has no application runtime or manual-test hook. Three other skill directories remain reserved. No generator, design integration, or active legacy-skill migration has been implemented. Windows has not been tested. Decisions FORGE-001 through FORGE-006 remain accepted.
FORGE-F001 and FORGE-F002 were human accepted and are present on `codex`. FORGE-F004 is in progress in its dedicated worktree. `bortstack-context` is implemented; `bortstack-contributor` is a candidate on F004 only. The repository `testtask` entry point is provisioned but blocked because Forge has no application runtime or manual-test hook. Two other skill directories remain reserved. No generator, design integration, or active legacy-skill migration has been implemented. Windows and JJ's hands-on workflow have not been tested. Decisions FORGE-001 through FORGE-006 remain accepted.
+5 -5
View File
@@ -1,11 +1,11 @@
# Handoff
FORGE-F002 was human accepted for commit and merge on 2026-11-17. Its task branch/worktree is `codex-forge-f002` at `/tmp/bortstack-forge-f002`; integration target is `codex`. Previous F001 and planning worktrees remain intact.
FORGE-F004 candidate is in `/tmp/bortstack-forge-f004` on `codex-forge-f004`, based on local `codex` commit `6217b9e`. Local implementation is Ready to Finalise; the task is Blocked / Suspended because JJ is unavailable for external validation. The candidate is committed on its task branch for preservation and has not been merged. F002 is already integrated locally; `codex` remains one commit ahead of `origin/codex`. Existing F001, F002, and planning worktrees remain intact.
Implementation: canonical `bortstack-context` skill, lifecycle/profile/design/snapshot contract, `scripts/context_audit.py`, safe current-worktree ZIP command, and a Forge `testtask` entry point that reports its runtime blocker. No installed Roborto skills or external projects were changed.
Implementation: `bortstack-contributor` skill and its review-handoff reference. It delegates lifecycle to `bortstack-context`, preserves Captain/Commander authority and legacy Roborto skills, guides task creation and isolated work, and defines the completion-to-PR gate with explicit local-only fallback. No provider, external project, installed skill, or production service was changed.
Validation: `python3 -m unittest discover -s tests -v` passed 7 tests; `python3 scripts/validate-skills.py` validated the new package; `python3 scripts/context_audit.py docs/TASKS.md --worktrees` reported no ID collision and detected this changed worktree; shell syntax checks passed. A ZIP was generated from the uncommitted task worktree. Temporary-repository tests verified edited and untracked inclusion and `.env`/prior snapshot exclusion. The ZIP predates final documentation edits and is stale for sharing; refresh it if needed.
Validation: `python3 -m unittest discover -s tests -v` passed 8 tests. `python3 scripts/validate-skills.py` accepted both implemented skills; `python3 scripts/install-skills.py --list` found contributor as installable. `git diff --check` passed. The new disposable Git fixture creates two consecutive task worktrees, preserves untracked work in the first, and verifies neither task merges into the integration branch. Its local review marker is not a real PR.
Limitations: `scripts/testtask.sh FORGE-F002` is provisioned but blocked because Forge has no application runtime or task-specific manual-test hook. Windows behavior has not been checked. Inspect archive contents before sharing. No push or deployment was performed.
Limitations: There is no configured review provider or application runtime in Forge. Real PR creation, JJ's Windows installation and live contributor run, and Docker/manual testing cannot be verified here. The repository `testtask` entry point remains blocked. Do not claim those gates passed or close F004 on the basis of the local fixture.
Next action: F003 and F004 can be briefed separately after integration; neither is authorised for implementation by this merge.
Next action: Captain can review the preserved task branch. When JJ is available, exercise a real two-task contributor handoff with a configured provider, including Windows and manual testing, or explicitly revise the acceptance criteria. No push, merge, or deployment was performed for F004.
+3 -1
View File
@@ -24,7 +24,7 @@ Track the Penpot integration workstream. Implement visual design for existing an
Acceptance: pilot an approved concept, design handoff, and visual validation, including the MCP fallback.
## FORGE-F004 — Implement `bortstack-contributor`
Status: Planned. Priority: High. Dependencies: FORGE-F002.
Status: Blocked / Suspended (JJ unavailable for external validation). Local implementation is Ready to Finalise. Priority: High. Dependencies: FORGE-F002. Branch/worktree: `codex-forge-f004` at `/tmp/bortstack-forge-f004`.
Migrate the contributor skill while preserving Commander JJ's established workflow, Captain/Commander terminology, independently created contributor tasks, isolated branches/worktrees, manual testing, disposable Docker conventions, Windows installation, legacy Roborto task reconciliation, and GitHub/Gitea workflows where available.
@@ -32,6 +32,8 @@ When JJ reports completion, Codex identifies the task/worktree, inspects changed
Acceptance: test two consecutive contributor tasks. Submit the first for review before implementing the second; abandon no uncommitted work and merge neither without Captain approval.
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.
## FORGE-F005 — Implement `bortstack-new`
Status: Planned. Priority: High. Dependencies: FORGE-F002, FORGE-F006, FORGE-F007.
+26
View File
@@ -0,0 +1,26 @@
---
name: bortstack-contributor
description: Guide an authorised contributor through scoped project tasks, isolated implementation, validation, and review handoff under Bortstack Context.
---
# 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.
## Orient and select work
Read the repository's `AGENTS.md` and maintained context files, inspect Git status, worktrees, task scope, and relevant code before changing files. Identify the integration branch and current task branch. Preserve unrelated and untracked changes. Use the project-specific task ID convention; reconcile historical IDs through context's collision check before importing records.
The Commander may create, refine, or split tasks from real requirements, accepted design decisions, or verified issues. Check for duplicates, define scope, non-goals, acceptance, dependencies, and status; task creation does not authorise implementation. The Commander may make in-scope product and visual decisions. Escalate security/auth, broad database architecture, privacy/legal, commercial commitments, destructive data changes, and production operations to Captain. Profile does not imply ownership or contributor permission; read the project's explicit permissions.
`lock on` briefs the task and risks without implementation. `engage` implements a briefed, accepted task in its dedicated branch and separate worktree. A read-only design contribution need not create a worktree; file changes do. A design-dependent implementation needs an approved design or recorded explicit override under context. Use the smallest relevant specialist skill for UI design, feature work, debugging, or visual QA.
## 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.
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.
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.
@@ -0,0 +1,17 @@
# Contributor review handoff
Follow repository `AGENTS.md`, `bortstack-context`, and the actual provider configuration. These steps are a gate sequence, not blanket permission for remote actions.
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.
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.
## Two-task gate exercise
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.
+52
View File
@@ -0,0 +1,52 @@
"""Exercise the contributor branch handoff with disposable Git repositories."""
import subprocess
import tempfile
import unittest
from pathlib import Path
def git(repo, *args):
return subprocess.check_output(["git", "-C", str(repo), *args], text=True).strip()
class ContributorWorkflowTests(unittest.TestCase):
def test_two_consecutive_tasks_preserve_unmerged_first_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 / "AGENTS.md").write_text("Dedicated task branches; Captain approves merges.\n")
git(base, "add", "AGENTS.md")
git(base, "commit", "-qm", "base")
root_commit = git(base, "rev-parse", "HEAD")
first = Path(temp) / "task-001"
git(base, "worktree", "add", "-qb", "task-001", str(first), "codex")
(first / "feature-a.txt").write_text("task A\n")
(first / "notes.txt").write_text("safe untracked note\n")
self.assertIn("?? notes.txt", git(first, "status", "--short"))
git(first, "add", "feature-a.txt")
git(first, "commit", "-qm", "task A ready for review")
first_commit = git(first, "rev-parse", "HEAD")
self.assertIn("?? notes.txt", git(first, "status", "--short"))
# A local marker exercises the ordering gate; it is not an actual PR.
review_reference = f"local-review:{first_commit[:8]}"
self.assertTrue(review_reference.startswith("local-review:"))
second = Path(temp) / "task-002"
git(base, "worktree", "add", "-qb", "task-002", str(second), "codex")
(second / "feature-b.txt").write_text("task B\n")
git(second, "add", "feature-b.txt")
git(second, "commit", "-qm", "task B candidate")
self.assertEqual(git(base, "rev-parse", "HEAD"), root_commit)
self.assertNotEqual(git(second, "rev-parse", "HEAD"), first_commit)
self.assertFalse((second / "feature-a.txt").exists())
self.assertTrue((first / "notes.txt").exists())
self.assertIn(str(first), git(base, "worktree", "list"))
self.assertIn(str(second), git(base, "worktree", "list"))
if __name__ == "__main__":
unittest.main()