@juangcarmona/lighthouse-sdlc 0.14.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +48 -125
  2. package/capabilities.json +14 -8
  3. package/completion.md +2 -2
  4. package/github-actions.md +104 -0
  5. package/host-contract.md +1 -1
  6. package/model-profiles.md +101 -0
  7. package/package.json +9 -1
  8. package/request-triage.md +32 -0
  9. package/schemas/estimate.schema.json +23 -0
  10. package/schemas/request-analysis.schema.json +37 -0
  11. package/schemas/triage.schema.json +1 -0
  12. package/skills/concise-results/SKILL.md +10 -0
  13. package/skills/refine/SKILL.md +1 -1
  14. package/skills/triage/SKILL.md +3 -3
  15. package/src/completion.mjs +1 -1
  16. package/src/host-contract.mjs +3 -0
  17. package/src/implementation.mjs +6 -1
  18. package/src/install-workflows.mjs +11 -5
  19. package/src/integration-evidence.mjs +1 -1
  20. package/src/issue-actions.mjs +62 -18
  21. package/src/model-profiles.mjs +58 -0
  22. package/src/opencode-execute.mjs +17 -4
  23. package/src/pr-state-actions.mjs +106 -0
  24. package/src/pr-state.mjs +75 -0
  25. package/src/profile-delegation.mjs +111 -0
  26. package/src/proposal.mjs +1 -1
  27. package/src/request-triage.mjs +42 -0
  28. package/src/stage-dispatch.mjs +21 -5
  29. package/src/stage-transition.mjs +10 -0
  30. package/src/triage.mjs +4 -0
  31. package/templates/change-request.yml +24 -0
  32. package/workflows/lighthouse-sdlc-apply-review.lock.yml +14 -13
  33. package/workflows/lighthouse-sdlc-apply-review.md +2 -1
  34. package/workflows/lighthouse-sdlc-implement.lock.yml +13 -13
  35. package/workflows/lighthouse-sdlc-implement.md +1 -1
  36. package/workflows/lighthouse-sdlc-integrate.lock.yml +13 -13
  37. package/workflows/lighthouse-sdlc-integrate.md +1 -1
  38. package/workflows/lighthouse-sdlc-propose.lock.yml +13 -13
  39. package/workflows/lighthouse-sdlc-propose.md +1 -1
  40. package/workflows/lighthouse-sdlc-refine.lock.yml +18 -13
  41. package/workflows/lighthouse-sdlc-refine.md +6 -1
  42. package/workflows/lighthouse-sdlc-review.lock.yml +13 -13
  43. package/workflows/lighthouse-sdlc-review.md +1 -1
  44. package/workflows/lighthouse-sdlc-router.yml +38 -5
  45. package/workflows/lighthouse-sdlc-triage.lock.yml +283 -1169
  46. package/workflows/lighthouse-sdlc-triage.md +175 -29
package/README.md CHANGED
@@ -1,146 +1,69 @@
1
- # Lighthouse SDLC
1
+ # Lighthouse delivery
2
2
 
3
- This package provides the provider-neutral delivery contract for Lighthouse adopters.
3
+ Use GitHub labels to request work. The router authenticates the owner, dispatches one worker and publishes its result. Installed policy can continue delivery automatically; questions, `future`, human reservations and required approvals stop it.
4
4
 
5
- It owns the six lifecycle skills, their command entrypoints, route, stage and gate descriptors, deterministic triage and decomposition projections, rebuildable state checks and the provider-neutral control-plane contract.
5
+ ## Check the installed version first
6
6
 
7
- It publishes `command-aliases.json` as the versioned, machine-readable mapping from selected `/lh:*` aliases to canonical `/lighthouse:*` command assets. Run `lighthouse-sdlc aliases --format json` to inspect it; the configured agent host decides how to expose the aliases.
7
+ Before explaining or changing an adopter's process, read its installed `@juangcarmona/lighthouse-sdlc/package.json`, this guide and `.github/workflows/lighthouse-sdlc-router.yml`. Check the router's pinned Lighthouse commit, enabled stages, `LIGHTHOUSE_AUTO_IMPLEMENT`, repository variable `LIGHTHOUSE_AUTOMATION_ENABLED` and current Git branch. Package installation, workflow installation and successful execution are separate facts. An older checkout cannot establish what is deployed on GitHub.
8
8
 
9
- It also provides the `browser-e2e` evidence contract for Playwright journeys. The contract belongs to the SDLC because it records delivery evidence; the tests, journeys and browser configuration remain owned by the adopter.
9
+ ## GitHub Actions
10
10
 
11
- It provides a neutral evidence contract for delivery, product and architecture references. `lighthouse-sdlc evidence` validates records or builds a deterministic coverage index; it does not replace ProductShape, ArcShape or a future quality evaluator.
11
+ These actions require installed workers, enabled automation and the repository owner as actor. Opening an issue alone starts no agent. Every result links to its execution; an Actions success can contain a blocked assessment.
12
12
 
13
- It has no persistent execution service, transcript store or cross-repository dispatcher. The optional Actions adapter executes the selected engine under operator policy. ProductShape, ArcShape and OpenSpec retain their own authority.
13
+ | Owner action or event | Requirement | Result and continuation | Source |
14
+ | --- | --- | --- | --- |
15
+ | Add `triage` | Open issue; external authors need owner admission | Assess request and estimate; publish `triaged` or `needs-info`. Stop for owner decision. | [Intake](request-triage.md) |
16
+ | Add `refine` | Open issue; no active reservation | Define acceptance criteria; publish `ready` or a question. With implementation enabled, continue automatically unless `future` or another blocker pauses it. | [Refinement](workflows/lighthouse-sdlc-refine.md) |
17
+ | Add `propose` | Proposal worker installed; `ready` and current successful refinement evidence; no existing proposal PR | Create a separate OpenSpec proposal PR and set `waiting-review`. No implementation or merge. | [Proposal](workflows/lighthouse-sdlc-propose.md) |
18
+ | Add `implement` | Implementation enabled, current owner authorization and repository checks configured; no `future` | Create the OpenSpec plan, implement and verify in one workspace. Publish plan and code together in a draft PR. A separate proposal PR is optional. | [Implementation](skills/implement/SKILL.md) |
19
+ | Add `future` | Issue not yet admitted for implementation | Pause implementation, including continuation after refinement. Triage, refinement and proposal remain available. Removing it resumes a pending `implement` request. | [Event routing](src/issue-actions.mjs) |
20
+ | Answer the issue's pending question | Owner reply to the latest trusted blocked result | Resume that same stage. An unrelated comment grants no new work or approval. | [Reply admission](src/issue-actions.mjs) |
21
+ | Comment or request changes on a proposal/implementation PR | Eligible bot-created PR and current owner feedback | `apply review` updates the same PR and retains its original stage. | [Corrections](workflows/lighthouse-sdlc-apply-review.md) |
22
+ | Approve a proposal PR | Current proposal head | Record design approval. No implementation or merge starts. | [Proposal feedback](src/issue-actions.mjs) |
23
+ | Required CI passes for a complete implementation candidate | Current PR head and adopted checks | Mark the PR ready and project `pr-ready`; wait for merge authorization. | [PR state](src/pr-state-actions.mjs) |
24
+ | Approve the implementation PR | Completion installed; owner approval for current head and passing required checks | `integrate` assesses and performs the authorized merge. After successful post-merge CI, `review` records the retrospective and closes the issue if passed. | [Completion](completion.md) |
14
25
 
15
- ## External host contract
26
+ For design-only work, add `future` before `refine`, then add `propose` after refinement passes. For delivery, request `implement` directly or let successful refinement continue under the installed implementation policy. Planning still happens before code changes. Gates are evidence and decision checks; only gates configured for a human require a human stop.
16
27
 
17
- `src/host-contract.mjs` validates a supervised `triage` or `refine` request against a trusted host policy and validates the resulting stage/effect envelope. It is exported as `@juangcarmona/lighthouse-sdlc/host-contract`. See [the wire contract](host-contract.md) for fields and host obligations. Execution, credentials, admission, cancellation and publication remain host responsibilities.
28
+ The eight Actions names are `router`, `triage`, `refine`, `propose`, `implement`, `integrate`, `review` and `apply review`. `integrate`, `review` and `apply review` normally start from approved PR, CI or feedback events, not labels with those names. Manual router dispatch is available for recovery. [Triggers](workflows/lighthouse-sdlc-router.yml), [admission](src/issue-actions.mjs) and [continuation](src/stage-transition.mjs) define the executable behavior.
18
29
 
19
- The external-host adapter remains available for existing adopters. New repository automation uses the gh-aw path below; do not enable both routers for the same events.
30
+ ## Label catalog
20
31
 
21
- ## GitHub Actions execution
32
+ [capabilities.json](capabilities.json) contains the exact names, roles, colors and descriptions. A matching label name does not prove Lighthouse created it. Existing labels and custom descriptions are preserved by reconciliation.
22
33
 
23
- The optional router accepts an owner-added `refine` label, an owner reply to a pending `needs-info` question or an owner manual dispatch. It dispatches the compiled gh-aw refinement worker as a separate execution. With `--with-propose`, an owner-added `propose` label or explicit manual stage selection dispatches the proposal worker independently. Actions authorizes the request, reserves the issue, runs OpenCode, validates its result and publishes through a separately credentialed job. SoFa can observe these runs without participating in execution.
34
+ | Category | Labels | Meaning |
35
+ | --- | --- | --- |
36
+ | Requests | `triage`, `refine`, `propose`, `implement` | Owner-added commands consumed by the native router; presence alone is not authorization. |
37
+ | Results | `triaged`, `ready`, `needs-info`, `waiting-review`, `pr-draft`, `pr-ready` | Read the linked result or PR for outcome, question or required decision. |
38
+ | Overlays | `future`, `agent-working`, `human-working` | Pause implementation, show an agent reservation or reserve work for a human. The host owns the lock. |
39
+ | Compatibility states | `wip`, `review` | Available to configured trackers; adding them does not dispatch a native worker. |
40
+ | Size | `size-s`, `size-m`, `size-l`, `size-xl` | Relative work-item size. Point estimates use the separate [estimate contract](request-triage.md#estimate-contract). |
41
+ | Urgency | `urgency-normal`, `urgency-asap`, `urgency-now` | Normal, soon or immediate attention. |
42
+ | Impact | `impact-low`, `impact-medium`, `impact-high` | Expected impact. |
43
+ | Risk | `risk-low`, `risk-medium`, `risk-high` | Delivery risk. |
44
+ | Affected surface | `blast-radius-low`, `blast-radius-medium`, `blast-radius-high` | Extent of potentially affected components and consumers. |
24
45
 
25
- Preview installation with `node node_modules/@juangcarmona/lighthouse-sdlc/src/install-workflows.mjs <repository> <immutable-lighthouse-commit>`. Install gh-aw v0.93.2, then add `--apply` to write and compile the selected sources. Existing different files require review and `--replace-reviewed`. Commit the Markdown, router, shared engine definition, generated lock and action pins together. Set the repository variable `LIGHTHOUSE_AUTOMATION_ENABLED=true` after provisioning the runner and disabling previous routers.
46
+ Use at most one classification value per dimension. Repository labels such as `bug`, `documentation` or `integrate` are outside this catalog unless the adopter declares them. `planned` and `done` are gate results, not shipped labels. Labels capability version 2 corrects request roles and removes the obsolete `triage → refine` state-transition example; generic triage CLI callers must declare their own state transitions. Native Actions uses its authenticated result and continuation rules.
26
47
 
27
- The installer enables `refine` by default. Add `--with-propose` to install the proposal worker as well. Add `--with-implement` for implementation (including proposal support). Add `--with-completion` to enable integration and review with an explicit GitHub profile opt-in; see the [completion guide](completion.md). Foundation initialization and upgrades do not install workflows. On upgrade from an older baseline, existing workflows remain untouched and leave the foundation's managed-file inventory. Review and remove obsolete projections explicitly.
48
+ ## Install or update workflows
28
49
 
29
- Create the `propose` request label and the amber `waiting-review` attention label when opting in. The proposal worker requires `ready` and a successful refinement from the same source revision and owner intent. Preparation authenticates its Actions request and result artifacts; a label or copied comment is insufficient. If evidence expired or the source changed, run `refine` again first. The explicit owner request authorizes proposal work. It does not approve the resulting design or implementation.
50
+ Installing or upgrading npm packages does not install or update Actions workflows. Use the [workflow installer](src/install-workflows.mjs) from the selected package:
30
51
 
31
- OpenSpec 1.15.0 supplies the `spec-driven` scaffold and artifact instructions in preparation. OpenCode returns bounded Markdown files under `openspec/changes/issue-<number>-proposal/`. The separate publisher validates those files with the provider, creates a fresh proposal branch and opens a PR with a link to the run. Existing proposal directories and open proposal PRs stop admission. Product code, existing branches and OpenSpec configuration remain untouched. Failed publication may leave a proposal branch; inspect it before retrying. The adopter must allow Actions to create PRs; this repository setting also permits Actions approvals, although these workflows never approve or merge PRs. PRs created with `GITHUB_TOKEN` generate `pull_request` runs that require maintainer approval. Review the proposed changes, then select **Approve workflows to run** on the PR before relying on CI. This is a CI execution gate, separate from accepting the proposal or authorizing implementation. See [GitHub token-triggered runs](https://docs.github.com/en/actions/concepts/security/github_token#when-github_token-triggers-workflow-runs).
32
-
33
- A completed proposal links its PR and sets `waiting-review`. Review the proposal there: owner comments, inline comments and submitted change requests run the independent `apply-review` worker with a `propose` result against the existing artifacts and update the same PR. Only open, same-repository proposals created by `github-actions[bot]` are eligible. The host checks current feedback, issue readiness and the PR head before a non-forced branch update. A changed head or discussion stops publication. Approval is acknowledged for the reviewed commit and never starts implementation or merges. This feedback route covers proposal PRs; implementation review remains governed by the completion guide.
34
-
35
- Blocked refinement and initial proposal questions can be answered on the issue. Other issue comments receive routing guidance instead of silently appearing accepted. Worker executions serialize by the source issue, including requests from its proposal PR, so unrelated issues retain independent queues. The latest queued feedback execution reads the complete bounded owner discussion, including comments posted while another execution was active. No separate bot account or GitHub App is required for this review path.
36
-
37
- The worker requires a Linux runner labelled `lighthouse-workflow`, Node.js, Docker, `flock` and `LIGHTHOUSE_ENGINE_CONFIG` pointing to an operator-owned configuration. See the source repository's `src/examples/opencode-engine` deployment example. The imported OpenCode engine starts a foreground container with read-only product source and harness package, a writable result directory and operator-managed provider authentication. Packaged skills load from `/harness/skills`; consumers do not copy the lifecycle skills into their source tree.
38
-
39
- Implementation can opt into [repository execution environments](execution-environments.md) for preflighted Node or .NET images and temporary host-managed PostgreSQL. Existing undeclared consumers keep their current image configuration.
40
-
41
- The subscription profile uses Docker isolation and explicitly disables gh-aw's AWF agent sandbox. It has no AWF egress filtering or credential proxy. The engine gets no GitHub token or Docker socket. Only trusted repository workflows may use the runner, whose Docker access is privileged infrastructure access. All repository runners sharing a host must use the same operator lock path to serialize model execution.
42
-
43
- Actions exposes the `OpenCode progress and result` step with public progress messages, concise tool activity, quiet-period notices and the validated result. Redacted structured events remain in a separate `opencode-events` artifact and feed the standard gh-aw session and usage parser. The result envelope and runtime receipt identify source, harness and image revisions. Logs redact common credential formats; this is not a guarantee that arbitrary sensitive product content is removed. Review public-repository content and artifact access accordingly. Agent artifacts use GitHub retention; they are not a permanent retrospective archive.
44
-
45
- Publication validates the Lighthouse envelope and rereads owner answers, issue state and source revision. Three unresolved reply rounds require an explicit new `refine` label. `agent-working` signals a reservation; human takeover or a changed source prevents publication. Labels are cooperative signals, not locks against arbitrary editors. A runner or artifact failure can require manual reservation reconciliation. A completed refinement never authorizes the next stage or a merge.
46
-
47
- Run `lighthouse-sdlc triage --input <file>` to validate one structured triage result and receive its proposed workflow and classification labels. The command is read-only by default; `--apply --labels-file <file>` writes only after the report is ready and the labels file still matches the input.
48
-
49
- Use `lighthouse-sdlc route --route <name>` to inspect a route before running it, `stage-result --input <file>` to validate a stage result, `state --input <events.json>` to replay workflow events, `control-plane --input <file>` to validate host declarations, `decompose --input <file>` to produce a dependency-checked slice plan and `stacked --input <file>` to produce an ordered pull-request plan.
50
-
51
- Use `lighthouse-sdlc browser-e2e --input <evidence.json>` to validate a Playwright journey result. It is read-only and does not start a browser or write provider state.
52
-
53
- Use `lighthouse-sdlc evidence --input <record-or-index.json>` to validate evidence, or add `--build --output <index.json>` to build an index and its compact record files from full records. The command is read-only unless the output path is explicitly provided.
54
-
55
- Use `lighthouse-sdlc github-triage --repo <owner/repo> --issue <number> --assessment <file>` for the first GitHub projection. It reads issue metadata by default; `--apply` is the explicit label mutation boundary and rereads the issue before writing.
56
-
57
- Use `lighthouse-sdlc github-decompose --repo <owner/repo> --issue <number> --input <file>` to turn a validated slice plan into child-issue operations. The default is a preview; `--apply` creates the child issues in dependency order with the parent link and acceptance evidence in each body.
58
-
59
- Declare selected adoption capabilities in a JSON file that follows `schemas/capabilities.schema.json`. `reconcile-labels` previews and optionally applies the first local label projection; `github-labels` reads the repository labels through `gh`, creates only missing labels after an explicit `--apply`, preserves existing values and records `.lighthouse/reconciliation/labels.json`.
60
-
61
- `capabilities.json` is the versioned adoption catalog. It currently declares the GitHub labels capability, its label roles and classifications, suggested colors and descriptions, declared transition policy and allowed operations.
62
-
63
- The catalog is descriptive until a consumer creates an explicit plan. `lighthouse upgrade` can discover it, but only `lighthouse capabilities apply --plan-file ... --authorize ...` may write provider state.
64
-
65
- Every catalog entry must name a registered adapter. Package verification fails when an entry has no adapter, and a new adapter is complete only when its plan, apply, verification, evidence and packaged-consumer fixture are covered by CI.
66
-
67
- `selected-by-default` capabilities appear as pending until the adopter selects or declines them. `opt-in` capabilities appear as available and do not make `upgrade` or `verify` fail until the adopter selects them.
68
-
69
- Evidence is explicit: an absent field appears in `missingEvidence`, a check that cannot run appears in `unavailableChecks`, and a judgement awaiting review appears in `pendingReview`. Only `provided` evidence can make a report ready to apply.
70
-
71
- The package is a source of lifecycle instructions and contracts; an adopter's host adapter decides where provider-specific projections are installed.
72
-
73
- The [external host contract](host-contract.md) supports owner-authorized `refine` labels, schema-1 compatibility and the shared deterministic event router. Work reservations use `agent-working` and `human-working`; the host owns the durable lock.
74
-
75
- ## Implementation delivery
76
-
77
- Install with `--with-implement` and provision the implementation engine image. An owner can request `implement` directly. With this worker installed, successful refinement also hands the issue to an independently dispatched implementation workflow. A blocked refinement waits for the owner's answer; `future` pauses implementation.
78
-
79
- The router has two jobs: decide the stage and dispatch it. Every installed stage (`refine`, `propose`, `implement`, `integrate`, `review`) has its own execution. The router records a receipt on the source issue before sending and preserves the original event in an Actions artifact. Preparation authenticates the bot comment, router run and attempt, artifact digest, stage and worker revision, then rechecks current source and owner intent. Workflow revision and product revision remain separate so an owner can test a reviewed workflow branch. Native events dispatch the default-branch worker while preserving the originating event revision; PR review events can use a [PR merge ref](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_review), which is not a dispatchable branch.
80
-
81
- Each stage request is stable across router reruns. Automatic continuation also keys on the completed source run, preventing duplicate completion events from launching the next stage twice. Dispatch jobs serialize receipt creation; workers serialize execution by issue and claim each request once. Owner PR feedback can wait behind a confirmed active worker and reads the current bounded discussion when admitted. Unconfirmed sends block further requests for the issue until inspected. Routine reruns never reclaim an already claimed request.
82
-
83
- Issue receipts show `📥 Requested`, `▶️ Execution admitted`, `⏸️ Waiting for your response`, `✅ Completed` or `❌ Failed or cancelled`, with the phase and execution link. These are the last host observations; open Actions for current queue, cancellation and job status. Result comments retain their validated outcome separately. A lost response or interrupted cleanup can leave an older receipt status, so the display never grants permission to continue.
84
-
85
- Successful refinement continues through a verified completion event when implementation is installed. The next worker checks the original request, published result, current owner intent and `future` before executing. Owner replies resume the blocked stage; proposal review and completion keep their existing approval checks. Integration still requires an explicit owner merge decision for the accepted head. Review retains its integration origin with the protected evidence record, without depending on temporary request artifacts to authenticate that historical record.
86
-
87
- For acceptance or deliberate event replay, dispatch the router with `issue`, the expected next `stage` and `after_run` set to the completed execution ID. This is owner-only and uses the same fresh observations and deduplication as `workflow_run`; it cannot force a transition or resend an uncertain request. An expired request artifact, changed source, changed intent or edited receipt blocks admission. Request artifacts last 14 days. Inspect origin and worker runs before reconciling uncertainty; there is no database, persistent dispatcher or SoFa dependency.
88
-
89
- The worker creates the OpenSpec plan, implements it and runs checks in one workspace. The PR contains both the plan and code. A separate proposal PR remains available for design-only work; merging one is not an implementation prerequisite.
90
-
91
- By default, repositories with a `verify` npm script use `npm ci --ignore-scripts` and `npm run verify`. Other repositories configure checks once in `.lighthouse/implement.json`:
92
-
93
- ```json
94
- {
95
- "defaults": {
96
- "reviewRequired": false,
97
- "scope": "Implement only the issue and its acceptance criteria.",
98
- "paths": ["*"],
99
- "checks": [["npm", "ci", "--ignore-scripts"], ["npm", "run", "verify"]]
100
- }
101
- }
52
+ ```sh
53
+ node node_modules/@juangcarmona/lighthouse-sdlc/src/install-workflows.mjs . <immutable-lighthouse-commit> --with-completion
102
54
  ```
103
55
 
104
- `*` permits project files; credentials, Git metadata, workflow and harness configuration remain protected. A directory ending in `/` limits writes to that subtree. Existing issue-specific policies still override defaults. `reviewRequired: true` reserves candidate acceptance for a human and produces a draft; `false` allows a checked candidate to be ready for PR review. Neither setting authorizes merge.
105
-
106
- OpenCode edits a temporary copy, with 30 minutes to return an envelope. The adapter validates at most 512 changed regular files, 4 MiB per file and 16 MiB total, excluding Git-ignored new output while retaining every tracked edit. New reports follow the project’s `.gitignore`; an ignore rule cannot hide changes to existing source. It reconstructs the exact candidate and reruns the configured commands in a fresh container without provider or GitHub credentials. Checks share a ten-minute limit. Only the candidate files enter the PR; logs, screenshots and the retrospective remain in the `implementation-evidence` Actions artifact for 30 days. Result receipts and redacted OpenCode events retain their existing 14-day lifetime. These artifacts are evidence delivery, not permanent archival.
107
-
108
- The publisher rechecks source, owner answers, reservation and policy before creating a new branch. Required human review or failed host checks produces a draft PR with blockers and `waiting-review`; it does not mark `done`, close the issue or start integration. An open implementation PR stops a second implementation run. Review and finish that PR before requesting another slice. Owner PR feedback updates that same branch with a non-forced push; a changed head or edited feedback stops publication. The subscription engine still has outbound networking and provider authentication inside its container; shell permissions are not credential isolation. Use only owner-authorized work on the dedicated host.
109
-
110
- To recover a failed candidate, an owner may add `"seed": {"base": "<40-character commit>", "head": "<40-character commit>"}` to that issue’s implementation policy. The head must be one commit directly on the declared base in the same repository. Preparation rejects out-of-scope files, links and changes whose base file no longer matches the current default branch. It binds the validated seed to the request and restores it in the disposable workspace. The engine continues that candidate, reruns checks and creates a fresh PR; the seed branch is never modified. A seed supplies work to inspect, not completion or approval evidence.
111
-
112
- ## Integration and review
113
-
114
- The optional [GitHub completion adapter](completion.md) handles PR approval, CI completion, merge checks and the final review. Install with `--with-completion` and explicitly adopt evidence publication in the GitHub profile. Merge authorization remains separate from a passed agent assessment.
115
-
116
- ## Replies to blocked stages
117
-
118
- An owner reply to a blocked refinement or proposal resumes that same stage. The router reads current issue state, acknowledges receipt with a reaction and verifies the latest trusted blocked report before admitting work. Preparation validates its run and artifacts, binds the reply to the previous input and adds a source-linked acknowledgement. Proposal replies retain the passed refinement evidence and include all owner answers; they do not approve implementation or merge. Published reports name the stage explicitly.
119
-
120
- Passed proposal reports and unrelated issue comments do not grant continuation. Owner feedback on an implementation PR updates that PR; approval requests integration when completion is enabled. Reservations and existing proposal PRs prevent duplicate work. Changed source, edited earlier intent, unavailable artifacts or withdrawn readiness fail admission rather than reusing stale approval. The owner can request fresh refinement when those inputs change. Direct GitHub replies remain supported independently of any future external-client comment or receipt contract.
121
-
122
- The source repository [worker catalogue](../../../docs/architecture/06-runtime-view/worker-catalogue.md) describes installed routes and worker boundaries.
123
-
124
- The `apply-review` worker is installed with proposal support. It also handles implementation feedback when implementation is installed, preserving its `implement` result. Verified feedback has a stable dispatch identity across repeated events. Approval retains its separate integration route.
125
-
126
- ## Worker maintenance
127
-
128
- Install the optional deterministic workflow with `--with-maintenance`. After reviewing its permissions, set `LIGHTHOUSE_MAINTENANCE_ENABLED=true` and the existing `LIGHTHOUSE_AUTOMATION_ENABLED=true` to observe open owner issues every 30 minutes, or dispatch a single issue manually. Observation alone performs no retry. Set `LIGHTHOUSE_RECOVERY_ENABLED=true` separately to permit bounded recovery; removing it also stops admission of already-requested retries.
129
-
130
- Recovery authenticates the original dispatch and its bounded chain, current source and workflow revision, owner intent, reservation and Actions job evidence. It retries only failed or timed-out refine/propose/implement/apply-review executions whose preparation passed and whose trusted publication step is positively recorded as skipped. Each retry is a new receipt and immutable request, at most two per original request, delayed at least 30 minutes after the previous execution. A newer owner request supersedes older recovery candidates. Workers retain their lifecycle gates and current authority checks.
131
-
132
- Cancellation, integration/review, human decisions, stale intent/source, expired artifacts, incomplete jobs, uncertain dispatch or publication, and abandoned reservations require operator inspection. A matching unclaimed execution can be identified for reconciliation, but missing confirmation never authorizes resend. Inspect the linked run and its actual effects before making a new owner request. Retries never clear another execution's reservation. Current receipt and Actions observations determine the decision; raw agent prose cannot grant retry authority.
133
-
134
- Maintenance bounds are 100 open owner issues, 500 scanned issue/PR entries, 1,000 comments per issue and 100 jobs per execution. Exceeding a bound fails visibly. Original dispatch artifacts retain their existing 14-day lifetime. Recovery does not outlive missing evidence. Scheduled observation only scans open owner issues; closed work requires explicit operator inspection.
135
-
136
- An active or queued execution without an Actions update for two hours is reported as stalled. Maintenance does not cancel it or release its reservation.
137
-
138
- ### Worker error reports
56
+ The default installs `triage` and `refine`. `--with-propose` adds proposal and corrections; `--with-implement` adds implementation and automatic refinement continuation; `--with-completion` also adds integration and review. Maintenance is a separate `--with-maintenance` opt-in.
139
57
 
140
- Create one open issue as the repository owner, without workflow labels, for the worker report index. Set `LIGHTHOUSE_REPORT_INDEX_ISSUE` to its issue number after enabling maintenance. The reporter preserves owner prose and maintains a reserved HTML block with report links and creation intent. Removing the variable disables report publication; recovery remains a separate opt-in.
58
+ Review the preview, then repeat with `--apply`; updating differing existing workflows also requires `--replace-reviewed`. Use gh-aw v0.93.2. Commit the source Markdown, router, compiled locks and action pins together. Reconcile [labels](commands/github-labels.md) through the [capability plan/apply commands](commands/capabilities.md); retain adopter customizations. Existing declarations need an explicit review when adopting labels capability version 2. Provision the runner and disable older routers before setting `LIGHTHOUSE_AUTOMATION_ENABLED=true`. See [operator setup and recovery](github-actions.md) and [completion configuration](completion.md).
141
59
 
142
- Reports group failures by worker and a fixed cause code. They contain source issue and execution links, retry state, distinct observed counts and a concrete next action. No logs, issue text or model output enter the report. Repeated observations do not increase counts. Only a successful execution from the same request chain resolves an occurrence; unrelated success cannot hide an earlier failure. A new occurrence reopens the existing report. Manual closure survives repeated observation of that same failure.
60
+ ## References
143
61
 
144
- The index prevents duplicate creation when a GitHub response is lost. A later pass links a uniquely matching bot-owned report. If creation is still unconfirmed, reporting stops for inspection instead of sending again. Disable reporting, inspect the maintenance run and search open and closed reports for that worker/cause before editing the index. Preserve a pending entry until a report can be linked or the owner has established that no creation occurred; deleting it permits a new create. Resume only after reconciling actual effects.
62
+ - [Lifecycle stages](stages.json), [gates](gates.json) and [routes](routes.json): provider-neutral contracts. Native worker compositions are described above; an implementation worker includes planning.
63
+ - [Commands](contract.json) and [aliases](command-aliases.json): CLI utilities and agent commands; the configured host exposes aliases.
64
+ - [Operator reference](github-actions.md): installation, credentials, receipts, runtime limits, maintenance and recovery.
65
+ - [Execution environments](execution-environments.md) and [model profiles](model-profiles.md): optional runtime configuration.
66
+ - [External host contract](host-contract.md): legacy host integration; enable only one router for the same events.
67
+ - [Evidence](commands/evidence.md) and [browser evidence](commands/browser-e2e.md): validation contracts. Missing evidence, unavailable checks and pending review remain separate from success.
145
68
 
146
- The reporter scans at most 500 issue/PR entries and retains at most 100 worker/cause entries and 200 distinct observations per report, within a 60 KB body. Overflow fails visibly and requires operator archival; nothing is silently evicted. Counts reflect observations made while reporting was enabled. A closed source issue is outside scheduled scanning, so explicitly dispatch maintenance for it when checking recovery. All report writes share one repository-wide Actions concurrency group.
69
+ ProductShape, ArcShape and OpenSpec own their artifacts. Lighthouse supplies delivery contracts and the optional GitHub adapter; the operator supplies runtime and credentials.
package/capabilities.json CHANGED
@@ -7,20 +7,26 @@
7
7
  "id": "labels",
8
8
  "provider": "github",
9
9
  "adapter": "github-labels",
10
- "version": "1",
10
+ "version": "2",
11
11
  "title": "Lighthouse tracker labels",
12
12
  "selection": "selected-by-default",
13
13
  "configuration": {
14
14
  "roles": ["state", "command", "classification", "overlay"],
15
15
  "labels": [
16
- { "name": "triage", "role": "state", "color": "8B949E", "description": "Work item is being assessed." },
17
- { "name": "refine", "role": "state", "color": "4DA3FF", "description": "Work item is being refined." },
18
- { "name": "implement", "role": "state", "color": "1F6FEB", "description": "Work item is being implemented." },
16
+ { "name": "triage", "role": "command", "color": "8B949E", "description": "Owner request to assess this issue; publication stops at triaged." },
17
+ { "name": "refine", "role": "command", "color": "4DA3FF", "description": "Owner request to refine; installed policy may continue to implementation." },
18
+ { "name": "implement", "role": "command", "color": "1F6FEB", "description": "Owner request to plan and implement this issue in one PR." },
19
+ { "name": "propose", "role": "command", "color": "A371F7", "description": "Owner request for a separate proposal PR from current refinement evidence." },
20
+ { "name": "future", "role": "overlay", "color": "8B949E", "description": "Pause implementation; triage, refinement and proposal remain available." },
21
+ { "name": "waiting-review", "role": "state", "color": "D29922", "description": "Inspect the result or PR for feedback or a pending decision." },
19
22
  { "name": "wip", "role": "state", "color": "D29922", "description": "Work item is actively in progress." },
20
23
  { "name": "agent-working", "role": "overlay", "color": "D29922", "description": "An agent holds the host reservation; wait before editing." },
21
24
  { "name": "human-working", "role": "overlay", "color": "A371F7", "description": "Human reservation: agents must stop and release their work." },
22
- { "name": "ready", "role": "state", "color": "238636", "description": "Refinement passed; this does not authorize implementation or merge." },
23
- { "name": "needs-info", "role": "state", "color": "D876E3", "description": "Refinement needs information or a decision; inspect its report." },
25
+ { "name": "ready", "role": "state", "color": "238636", "description": "Refinement passed; continuation depends on installed policy and future. Never authorizes merge." },
26
+ { "name": "pr-draft", "role": "state", "color": "8B949E", "description": "The linked implementation PR is a draft." },
27
+ { "name": "pr-ready", "role": "state", "color": "238636", "description": "The linked implementation PR is ready for human review." },
28
+ { "name": "triaged", "role": "state", "color": "4FB3A4", "description": "Owner-admitted triage passed; the owner decides whether to refine." },
29
+ { "name": "needs-info", "role": "state", "color": "D876E3", "description": "Triage or refinement needs information; the owner answers the reported question." },
24
30
  { "name": "review", "role": "state", "color": "A371F7", "description": "Work item is awaiting review." },
25
31
  { "name": "size-s", "role": "classification", "dimension": "size", "value": "S", "color": "BFE3FF", "description": "Small work item." },
26
32
  { "name": "size-m", "role": "classification", "dimension": "size", "value": "M", "color": "80C2FF", "description": "Medium work item." },
@@ -39,10 +45,10 @@
39
45
  { "name": "blast-radius-medium", "role": "classification", "dimension": "blast-radius", "value": "medium", "color": "4FB3A4", "description": "Medium affected surface." },
40
46
  { "name": "blast-radius-high", "role": "classification", "dimension": "blast-radius", "value": "high", "color": "0F766E", "description": "Large affected surface." }
41
47
  ],
42
- "transitions": [{ "from": "triage", "to": "refine" }],
48
+ "transitions": [],
43
49
  "transitionPolicy": {
44
50
  "mode": "declared-only",
45
- "description": "Only transitions declared by the adopter are legal; the catalog supplies the initial triage-to-refine example."
51
+ "description": "Declare state transitions for the generic triage CLI explicitly. Native Actions requests and results follow the authenticated adapter; command labels are not state transitions."
46
52
  }
47
53
  },
48
54
  "operations": {
package/completion.md CHANGED
@@ -4,7 +4,7 @@ The optional completion adapter finishes an implementation through the adopter's
4
4
 
5
5
  ## Adoption
6
6
 
7
- Install with `install-workflows <repository> <immutable-lighthouse-commit> --with-completion`. Preview first; `--apply` writes selected workflows and compiles them with gh-aw v0.93.2. Existing differing files require `--replace-reviewed`. Completion includes refine, propose and implement; it adds no new lifecycle stage.
7
+ Follow the [packaged workflow installation and update procedure](README.md#install-or-update-workflows) with `--with-completion`. This includes triage, refine, propose, implement and corrections; it adds no new lifecycle stage.
8
8
 
9
9
  In the existing `.lighthouse/github.json`, retain the adopted required checks and protected `evidenceBranch`, and add:
10
10
 
@@ -25,7 +25,7 @@ GitHub hides `bypass_actors` from tokens that cannot edit rulesets. Before activ
25
25
 
26
26
  ## Owner entry
27
27
 
28
- Approve the implementation PR in GitHub when it is ready. The router checks that the approval belongs to the owner and the current commit, then assesses integration. If CI is still running, its completion resumes the check. Comments request changes on the same PR; they do not authorize merge.
28
+ Approve the implementation PR in GitHub when it is ready. A complete candidate starts as a draft, and passing required CI marks it ready. Manual draft changes are reflected on the issue; marking an incomplete or unchecked PR ready returns it to draft with a blocker. The router checks that approval belongs to the owner and the current commit, then assesses integration. If CI is still running, its completion resumes the check. Comments request changes on the same PR; they do not authorize merge.
29
29
 
30
30
  Manual `integrate` and `review` dispatches remain available for recovery. They require the issue, PR and accepted head SHA; integration needs `merge: true` to authorize a merge.
31
31
 
@@ -0,0 +1,104 @@
1
+ # GitHub Actions operator reference
2
+
3
+ For labels, everyday actions and automatic continuation, start with the [delivery guide](README.md). Read this reference when installing workflows, provisioning the runtime or recovering a failed execution.
4
+
5
+ ## Installation and runtime
6
+
7
+ The optional router accepts owner-added `triage` and `refine` labels, owner replies to pending questions and owner manual dispatches. It dispatches the compiled gh-aw refinement worker as a separate execution. With `--with-propose`, an owner-added `propose` label or explicit manual stage selection dispatches the proposal worker independently. Actions authorizes the request, reserves the issue, runs OpenCode, validates its result and publishes through a separately credentialed job. SoFa can observe these runs without participating in execution.
8
+
9
+ Preview installation with `node node_modules/@juangcarmona/lighthouse-sdlc/src/install-workflows.mjs <repository> <immutable-lighthouse-commit>`. Install gh-aw v0.93.2, then add `--apply` to write and compile the selected sources. Existing different files require review and `--replace-reviewed`. Commit the Markdown, router, shared engine definition, generated lock and action pins together. Set the repository variable `LIGHTHOUSE_AUTOMATION_ENABLED=true` after provisioning the runner and disabling previous routers.
10
+
11
+ The installer enables `triage` and `refine` by default. Add `--with-propose` to install the proposal worker as well. Add `--with-implement` for implementation (including proposal support). Add `--with-completion` to enable integration and review with an explicit GitHub profile opt-in; see the [completion guide](completion.md). Foundation initialization and upgrades do not install workflows. On upgrade from an older baseline, existing workflows remain untouched and leave the foundation's managed-file inventory. Review and remove obsolete projections explicitly.
12
+
13
+ Reconcile the [label catalog](capabilities.json), including `propose`, `waiting-review` and `future`, before enabling the corresponding workers. The proposal worker requires `ready` and a successful refinement from the same source revision and owner intent. Preparation authenticates its Actions request and result artifacts; a label or copied comment is insufficient. If evidence expired or the source changed, run `refine` again first. The explicit owner request authorizes proposal work. It does not approve the resulting design or implementation.
14
+
15
+ OpenSpec 1.15.0 supplies the `spec-driven` scaffold and artifact instructions in preparation. OpenCode returns bounded Markdown files under `openspec/changes/issue-<number>-proposal/`. The separate publisher validates those files with the provider, creates a fresh proposal branch and opens a PR with a link to the run. Existing proposal directories and open proposal PRs stop admission. Product code, existing branches and OpenSpec configuration remain untouched. Failed publication may leave a proposal branch; inspect it before retrying. The adopter must allow Actions to create PRs; this repository setting also permits Actions approvals, although proposal workers never approve or merge PRs. The optional integration worker merges only after current owner authorization and passing checks. PRs created with `GITHUB_TOKEN` generate `pull_request` runs that require maintainer approval. Review the proposed changes, then select **Approve workflows to run** on the PR before relying on CI. This is a CI execution gate, separate from accepting the proposal or authorizing implementation. See [GitHub token-triggered runs](https://docs.github.com/en/actions/concepts/security/github_token#when-github_token-triggers-workflow-runs).
16
+
17
+ A completed proposal links its PR and sets `waiting-review`. Review the proposal there: owner comments, inline comments and submitted change requests run the independent `apply-review` worker with a `propose` result against the existing artifacts and update the same PR. Only open, same-repository proposals created by `github-actions[bot]` are eligible. The host checks current feedback, issue readiness and the PR head before a non-forced branch update. A changed head or discussion stops publication. Approval is acknowledged for the reviewed commit and never starts implementation or merges. This feedback route covers proposal PRs; implementation review remains governed by the completion guide.
18
+
19
+ Blocked refinement and initial proposal questions can be answered on the issue. Other issue comments receive routing guidance instead of silently appearing accepted. Worker executions serialize by the source issue, including requests from its proposal PR, so unrelated issues retain independent queues. The latest queued feedback execution reads the complete bounded owner discussion, including comments posted while another execution was active. No separate bot account or GitHub App is required for this review path.
20
+
21
+ The worker requires a Linux runner labelled `lighthouse-workflow`, Node.js, Docker, `flock` and `LIGHTHOUSE_ENGINE_CONFIG` pointing to an operator-owned configuration. See the source repository's `src/examples/opencode-engine` deployment example. The imported OpenCode engine starts a foreground container with read-only product source and harness package, a writable result directory and operator-managed provider authentication. Packaged skills load from `/harness/skills`; consumers do not copy the lifecycle skills into their source tree.
22
+
23
+ Implementation can opt into [repository execution environments](execution-environments.md) for preflighted Node or .NET images and temporary host-managed PostgreSQL. Existing undeclared consumers keep their current image configuration.
24
+
25
+ Workers can opt into [OpenAI model profiles and bounded delegation](model-profiles.md). Project settings cannot replace the legacy operator model without explicit operator opt-in; configuration receipts do not prove live provider access.
26
+
27
+ The subscription profile uses Docker isolation and explicitly disables gh-aw's AWF agent sandbox. It has no AWF egress filtering or credential proxy. The engine gets no GitHub token or Docker socket. Only trusted repository workflows may use the runner, whose Docker access is privileged infrastructure access. All repository runners sharing a host must use the same operator lock path to serialize model execution.
28
+
29
+ Actions exposes the `OpenCode progress and result` step with public progress messages, concise tool activity, quiet-period notices and the validated result. Redacted structured events remain in a separate `opencode-events` artifact and feed the standard gh-aw session and usage parser. The result envelope and runtime receipt identify source, harness and image revisions. Logs redact common credential formats; this is not a guarantee that arbitrary sensitive product content is removed. Review public-repository content and artifact access accordingly. Agent artifacts use GitHub retention; they are not a permanent retrospective archive.
30
+
31
+ Publication validates the Lighthouse envelope and rereads owner answers, issue state and source revision. Three unresolved reply rounds require an explicit new `refine` label. `agent-working` signals a reservation; human takeover or a changed source prevents publication. Labels are cooperative signals, not locks against arbitrary editors. A runner or artifact failure can require manual reservation reconciliation. Refinement can continue only under the still-effective implementation authorization recorded by the installed router; it never authorizes merge.
32
+
33
+ ## Implementation delivery
34
+
35
+ Install with `--with-implement` and provision the implementation engine image. An owner can request `implement` directly. With this worker installed, successful refinement also hands the issue to an independently dispatched implementation workflow. A blocked refinement waits for the owner's answer; `future` pauses implementation.
36
+
37
+ The router decides the stage and dispatches it. Every installed stage (`triage`, `refine`, `propose`, `implement`, `integrate`, `review`) has its own execution. The router records a receipt on the source issue before sending and preserves the original event in an Actions artifact. Preparation authenticates the bot comment, router run and attempt, artifact digest, stage and worker revision, then rechecks current source and owner intent. Workflow revision and product revision remain separate so an owner can test a reviewed workflow branch. Native events dispatch the default-branch worker while preserving the originating event revision; PR review events can use a [PR merge ref](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_review), which is not a dispatchable branch.
38
+
39
+ Each stage request is stable across router reruns. Automatic continuation also keys on the completed source run, preventing duplicate completion events from launching the next stage twice. Dispatch jobs serialize receipt creation; workers serialize execution by issue and claim each request once. Owner PR feedback can wait behind a confirmed active worker and reads the current bounded discussion when admitted. Unconfirmed sends block further requests for the issue until inspected. Routine reruns never reclaim an already claimed request.
40
+
41
+ Issue receipts show `📥 Requested`, `▶️ Execution admitted`, `⏸️ Waiting for your response`, `✅ Completed` or `❌ Failed or cancelled`, with the phase and execution link. These are the last host observations; open Actions for current queue, cancellation and job status. Result comments retain their validated outcome separately. A lost response or interrupted cleanup can leave an older receipt status, so the display never grants permission to continue.
42
+
43
+ Successful refinement explicitly wakes the router after publication and reservation release when implementation is installed. This avoids depending solely on GitHub's follow-up events for work dispatched with `GITHUB_TOKEN`. The router waits up to two minutes for the refinement execution to finish and verifies its original owner request, installed continuation policy and published result. The next worker rechecks that evidence, current owner intent and `future` before executing. Native completion events and the explicit wake-up share one dispatch identity, so they cannot start implementation twice. Owner replies resume the blocked stage; proposal review and completion keep their existing approval checks. Integration still requires an explicit owner merge decision for the accepted head. Review retains its integration origin with the protected evidence record, without depending on temporary request artifacts to authenticate that historical record.
44
+
45
+ For acceptance or deliberate event replay, the owner can dispatch the router with `issue`, the expected next `stage` and `after_run` set to the completed execution ID. The bot can only request the authenticated refinement-to-implementation continuation. Both use the same fresh observations and deduplication as `workflow_run`; neither can force a transition or resend an uncertain request. If the bounded wait expires, inspect the source run and replay after it completes. An expired request artifact, changed source, changed intent or edited receipt blocks admission. Request artifacts last 14 days. Inspect origin and worker runs before reconciling uncertainty; there is no database, persistent dispatcher or SoFa dependency.
46
+
47
+ The worker creates the OpenSpec plan, implements it and runs checks in one workspace. The PR contains both the plan and code. A separate proposal PR remains available for design-only work; merging one is not an implementation prerequisite.
48
+
49
+ By default, repositories with a `verify` npm script use `npm ci --ignore-scripts` and `npm run verify`. Other repositories configure checks once in `.lighthouse/implement.json`:
50
+
51
+ ```json
52
+ {
53
+ "defaults": {
54
+ "reviewRequired": false,
55
+ "scope": "Implement only the issue and its acceptance criteria.",
56
+ "paths": ["*"],
57
+ "checks": [["npm", "ci", "--ignore-scripts"], ["npm", "run", "verify"]]
58
+ }
59
+ }
60
+ ```
61
+
62
+ `*` permits project files; credentials, Git metadata, workflow and harness configuration remain protected. A directory ending in `/` limits writes to that subtree. Existing issue-specific policies still override defaults. `reviewRequired: true` reserves candidate acceptance for a human; `false` allows a complete candidate to become ready for PR review after required CI passes. Every implementation PR starts as a draft. Neither setting authorizes merge.
63
+
64
+ OpenCode edits a temporary copy, with 30 minutes to return an envelope. The adapter validates at most 512 changed regular files, 4 MiB per file and 16 MiB total, excluding Git-ignored new output while retaining every tracked edit. New reports follow the project’s `.gitignore`; an ignore rule cannot hide changes to existing source. It reconstructs the exact candidate and reruns the configured commands in a fresh container without provider or GitHub credentials. Checks share a ten-minute limit. Only the candidate files enter the PR; logs, screenshots and the retrospective remain in the `implementation-evidence` Actions artifact for 30 days. Result receipts and redacted OpenCode events retain their existing 14-day lifetime. These artifacts are evidence delivery, not permanent archival.
65
+
66
+ The publisher rechecks source, owner answers, reservation and policy before creating a new branch. Starting implementation removes the issue's `ready` label. A linked draft PR projects `pr-draft`; a complete candidate becomes `pr-ready` only when required CI passes and GitHub marks the PR ready. A successful CI job may call `pr-state-actions.mjs` with `LIGHTHOUSE_CI_RECONCILE=true` to project that state immediately; the script verifies the current run and required checks. The router also rechecks open implementation PRs every five minutes because GitHub can suppress completion events in chained workflows. The issue comment links to the PR, whose description uses `Refs #...` until post-merge review closes the issue. Owner PR feedback updates the same branch with a non-forced push and returns it to draft while corrections run. A changed head or edited feedback stops publication. The subscription engine still has outbound networking and provider authentication inside its container; shell permissions are not credential isolation. Use only owner-authorized work on the dedicated host.
67
+
68
+ To recover a failed candidate, an owner may add `"seed": {"base": "<40-character commit>", "head": "<40-character commit>"}` to that issue’s implementation policy. The head must be one commit directly on the declared base in the same repository. Preparation rejects out-of-scope files, links and changes whose base file no longer matches the current default branch. It binds the validated seed to the request and restores it in the disposable workspace. The engine continues that candidate, reruns checks and creates a fresh PR; the seed branch is never modified. A seed supplies work to inspect, not completion or approval evidence.
69
+
70
+ ## Integration and review
71
+
72
+ The optional [GitHub completion adapter](completion.md) handles PR approval, CI completion, merge checks and the final review. Install with `--with-completion` and explicitly adopt evidence publication in the GitHub profile. Merge authorization remains separate from a passed agent assessment.
73
+
74
+ ## Replies to blocked stages
75
+
76
+ An owner reply to a blocked refinement or proposal resumes that same stage. The router reads current issue state, acknowledges receipt with a reaction and verifies the latest trusted blocked report before admitting work. Preparation validates its run and artifacts, binds the reply to the previous input and adds a source-linked acknowledgement. Proposal replies retain the passed refinement evidence and include all owner answers; they do not approve implementation or merge. Published reports name the stage explicitly.
77
+
78
+ Passed proposal reports and unrelated issue comments do not grant continuation. Owner feedback on an implementation PR updates that PR; approval requests integration when completion is enabled. Reservations and existing proposal PRs prevent duplicate work. Changed source, edited earlier intent, unavailable artifacts or withdrawn readiness fail admission rather than reusing stale approval. The owner can request fresh refinement when those inputs change. Direct GitHub replies remain supported independently of any future external-client comment or receipt contract.
79
+
80
+ The [router](workflows/lighthouse-sdlc-router.yml) and [event handler](src/issue-actions.mjs) define installed routes. The [implementation skill](skills/implement/SKILL.md) defines planning and coding within one execution.
81
+
82
+ The `apply-review` worker is installed with proposal support. It also handles implementation feedback when implementation is installed, preserving its `implement` result. Verified feedback has a stable dispatch identity across repeated events. Approval retains its separate integration route.
83
+
84
+ ## Worker maintenance
85
+
86
+ Install the optional deterministic workflow with `--with-maintenance`. After reviewing its permissions, set `LIGHTHOUSE_MAINTENANCE_ENABLED=true` and the existing `LIGHTHOUSE_AUTOMATION_ENABLED=true` to observe open owner issues every 30 minutes, or dispatch a single issue manually. Observation alone performs no retry. Set `LIGHTHOUSE_RECOVERY_ENABLED=true` separately to permit bounded recovery; removing it also stops admission of already-requested retries.
87
+
88
+ Recovery authenticates the original dispatch and its bounded chain, current source and workflow revision, owner intent, reservation and Actions job evidence. It retries only failed or timed-out refine/propose/implement/apply-review executions whose preparation passed and whose trusted publication step is positively recorded as skipped. Each retry is a new receipt and immutable request, at most two per original request, delayed at least 30 minutes after the previous execution. A newer owner request supersedes older recovery candidates. Workers retain their lifecycle gates and current authority checks.
89
+
90
+ Cancellation, integration/review, human decisions, stale intent/source, expired artifacts, incomplete jobs, uncertain dispatch or publication, and abandoned reservations require operator inspection. A matching unclaimed execution can be identified for reconciliation, but missing confirmation never authorizes resend. Inspect the linked run and its actual effects before making a new owner request. Retries never clear another execution's reservation. Current receipt and Actions observations determine the decision; raw agent prose cannot grant retry authority.
91
+
92
+ Maintenance bounds are 100 open owner issues, 500 scanned issue/PR entries, 1,000 comments per issue and 100 jobs per execution. Exceeding a bound fails visibly. Original dispatch artifacts retain their existing 14-day lifetime. Recovery does not outlive missing evidence. Scheduled observation only scans open owner issues; closed work requires explicit operator inspection.
93
+
94
+ An active or queued execution without an Actions update for two hours is reported as stalled. Maintenance does not cancel it or release its reservation.
95
+
96
+ ### Worker error reports
97
+
98
+ Create one open issue as the repository owner, without workflow labels, for the worker report index. Set `LIGHTHOUSE_REPORT_INDEX_ISSUE` to its issue number after enabling maintenance. The reporter preserves owner prose and maintains a reserved HTML block with report links and creation intent. Removing the variable disables report publication; recovery remains a separate opt-in.
99
+
100
+ Reports group failures by worker and a fixed cause code. They contain source issue and execution links, retry state, distinct observed counts and a concrete next action. No logs, issue text or model output enter the report. Repeated observations do not increase counts. Only a successful execution from the same request chain resolves an occurrence; unrelated success cannot hide an earlier failure. A new occurrence reopens the existing report. Manual closure survives repeated observation of that same failure.
101
+
102
+ The index prevents duplicate creation when a GitHub response is lost. A later pass links a uniquely matching bot-owned report. If creation is still unconfirmed, reporting stops for inspection instead of sending again. Disable reporting, inspect the maintenance run and search open and closed reports for that worker/cause before editing the index. Preserve a pending entry until a report can be linked or the owner has established that no creation occurred; deleting it permits a new create. Resume only after reconciling actual effects.
103
+
104
+ The reporter scans at most 500 issue/PR entries and retains at most 100 worker/cause entries and 200 distinct observations per report, within a 60 KB body. Overflow fails visibly and requires operator archival; nothing is silently evicted. Counts reflect observations made while reporting was enabled. A closed source issue is outside scheduled scanning, so explicitly dispatch maintenance for it when checking recovery. All report writes share one repository-wide Actions concurrency group.
package/host-contract.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Supervised external host contract
2
2
 
3
- This document describes the legacy external-host adapter. The optional repository-owned issue adapter described in [README.md](README.md#repository-owned-issue-refinement) keeps orchestration and publication in GitHub Actions and uses an independent executor. Neither adapter requires SoFa as a product dependency.
3
+ This document describes the legacy external-host adapter. The optional repository-owned issue adapter described in [README.md](README.md#github-actions) keeps orchestration and publication in GitHub Actions and uses an independent executor. Neither adapter requires SoFa as a product dependency.
4
4
 
5
5
  Schema version 1 supports one triage or refinement stage. The executable validator in `src/host-contract.mjs` is authoritative; unknown request and effect fields fail validation. Hosts install an exact package version outside the execution workspace.
6
6
 
@@ -0,0 +1,101 @@
1
+ # Worker model profiles
2
+
3
+ Profiles are opt-in settings, not permissions or proven presets. The existing operator `model` remains unchanged until the operator deliberately enables profiles. Authentication, billing and processing tier are not changed by this feature. A `fast` profile describes lightweight work; it never enables OpenAI Fast, Ultrafast, Flex or Batch processing.
4
+
5
+ ## Project declaration
6
+
7
+ Create `.lighthouse/models.json` in the consuming repository after verifying identifiers and reasoning variants on its runner. Lighthouse's own file is a dogfood candidate; it has no effect until the operator enables profiles. The identifiers below are placeholders, not an available model catalog:
8
+
9
+ ```json
10
+ {
11
+ "schemaVersion": 1,
12
+ "defaultProfile": "build",
13
+ "workers": { "refine": "plan", "propose": "plan", "implement": "build", "review": "plan", "apply-review": "fast" },
14
+ "profiles": {
15
+ "plan": { "model": "openai/verified-planning-model", "reasoningEffort": "high" },
16
+ "build": { "model": "openai/verified-building-model", "reasoningEffort": "medium" },
17
+ "fast": { "model": "openai/verified-lightweight-model", "reasoningEffort": "high" }
18
+ }
19
+ }
20
+ ```
21
+
22
+ The only profile names are `plan`, `build` and `fast`. Models must be OpenAI provider-qualified identifiers without an embedded variant. Effort is independent: `none`, `minimal`, `low`, `medium`, `high`, `xhigh` or `max`, but only values explicitly permitted for that model by the operator can run. The resolver rejects unknown configuration keys, providers, profile names, effort values and unsupported tier or transport fields. It never chooses an alternative on failure.
23
+
24
+ ## Operator opt-in and precedence
25
+
26
+ Merge these fields into the existing operator engine configuration. Retain `image`, `implementationImage`, `uid`, `authVolume`, `lock` and the current `model`. Do not copy provider credentials into project files or evidence.
27
+
28
+ ```json
29
+ {
30
+ "modelProfiles": {
31
+ "schemaVersion": 1,
32
+ "enabled": true,
33
+ "workers": { "review": "fast" },
34
+ "profiles": { "build": { "reasoningEffort": "high" } }
35
+ },
36
+ "modelCapabilities": {
37
+ "openai/verified-planning-model": { "available": true, "tools": true, "reasoningEfforts": ["high"] },
38
+ "openai/verified-building-model": { "available": true, "tools": true, "reasoningEfforts": ["medium", "high"] },
39
+ "openai/verified-lightweight-model": { "available": true, "tools": true, "reasoningEfforts": ["high"] }
40
+ }
41
+ }
42
+ ```
43
+
44
+ Selection precedence, highest first:
45
+
46
+ 1. A delegated task's explicit profile; this still requires operator opt-in and capability permission.
47
+ 2. Operator worker assignment.
48
+ 3. Project worker assignment.
49
+ 4. Operator default profile.
50
+ 5. Project default profile.
51
+
52
+ For the selected profile, operator model and effort fields override project fields independently. An incomplete selected profile fails. The operator capability inventory must explicitly permit availability, tool use and the effort; absent or denied capability fails before startup. This inventory is an operator declaration, not proof of current provider access. Actual provider failures stop execution, with no fallback or processing-tier change.
53
+
54
+ Without `modelProfiles.enabled: true`, ordinary workers forward the existing `model` byte-for-byte. Project declarations alone cannot replace it. Disabling profiles restores that route; delegated profile launches are rejected instead of falling back to a legacy model. Remove opt-in to roll back. Existing OpenCode 2.1.0 entrypoints already forward `--model`; the adapter supplies `provider/model#effort` in profile mode. Verify the selected variant and authentication on the actual runner before adoption.
55
+
56
+ ## Execution evidence
57
+
58
+ `runtime.json` retains its `model` field and adds `modelExecution`: requested settings, resolved settings and field provenance, capability-evidence classification, provider-reported fields and billing fields. The current adapter has no authenticated provider-settings receipt, so provider model and reasoning remain `null` with `unverified` status. Its resolved variant is configuration-derived only. Do not relabel an engine argument as provider confirmation.
59
+
60
+ Redacted OpenCode events retain any engine-exposed usage. Such token data is not necessarily account billing or subscription usage. Actual cost, API-equivalent estimates and subscription usage remain separate and unknown (`null`) unless independent evidence establishes them. An exit error or structured engine error fails the run, even if an envelope was produced.
61
+
62
+ ## Bounded delegation — host API
63
+
64
+ Import `runDelegatedTasks` from `@juangcarmona/lighthouse-sdlc/profile-delegation`. A trusted host supplies `parent`, `controlPlane`, `project`, `operator`, `tasks`, `maxParallel`, `launch`, `verifyWave` and optionally an `AbortSignal`. No worker tool or workflow automatically enables delegation. The package schedules and validates; the existing host remains responsible for actual child execution and isolation.
65
+
66
+ ```js
67
+ const report = await runDelegatedTasks({
68
+ parent, controlPlane, project, operator, maxParallel: 2,
69
+ tasks: [
70
+ { id: 'edit', specialist: 'editor', profile: 'fast', dependencies: [], affectedFiles: ['src/copy.md'], input: { instruction: 'Apply the approved copy edit.' } },
71
+ { id: 'review', specialist: 'reviewer', profile: 'plan', dependencies: ['edit'], affectedFiles: ['src/copy.md'], input: { instruction: 'Check the accepted edit.' } },
72
+ ],
73
+ launch: child => host.launch(child),
74
+ verifyWave: wave => host.verifyWave(wave),
75
+ });
76
+ ```
77
+
78
+ The example host callbacks are integration points, not included runtime services. Parent and child launches use the existing role contract: declared tools, output schema, allowed write scope, stop conditions and limits. Roles must be object contracts, not opaque provider strings. The existing role validator requires each child write-scope entry to appear explicitly in its specialist contract. The parent scope can be an exact file, directory prefix or `*`; affected files must be canonical relative files or trailing-slash directories. Globs, traversal, protected configuration and unknown scope syntax are rejected. Scope aliases and symlinks require host enforcement against actual changed files.
79
+
80
+ Task IDs and specialists are lowercase names; every task declares a profile, dependencies and affected files. At most 100 tasks, 100 distinct affected paths per task, 64 KiB of JSON task context and 1–8 simultaneous launches are accepted. Host `maxParallel` is authoritative. Parent limits require integer `timeoutSeconds` from 1–1800 and `maxAttempts: 1`; this first executor does not retry. Child limits can only tighten the deadline and retain one attempt. Other host limits, such as token budgets, are inherited unchanged and remain the host’s responsibility to enforce. Each child receives a unique run ID, parent identity, cloned task-only input, permitted tools and the resolved model argument. The host must construct fresh model context, enforce scope and tools, kill child execution on abort and retain its own evidence. The scheduler does not expand model permissions or publish results.
81
+
82
+ All profiles, launch contracts and the entire dependency graph are preflighted before any launch. Stable waves contain only verified-dependency-ready tasks with disjoint scopes. A directory conflicts with its descendants. Launch and verification callbacks must return `{ status: 'passed', evidence: [...] }` with nonempty evidence. The host must validate child output against its output schema, check actual modified paths and run repository checks during wave verification. A failed launch or wave blocks dependants transitively; independent tasks can continue. A deadline or cancellation stops new waves and signals all callbacks. This scheduling report cannot approve a lifecycle gate or merge.
83
+
84
+ ## Repeatable candidate evaluation
85
+
86
+ The issue's Sol High / Sol Medium / Luna High preset is a candidate only. No candidate identifiers or prices are installed as defaults. Compare Sol Medium with Terra on bounded implementation; evaluate Luna on selected lightweight tasks. Include GPT-5.6 when subscription terms make it relevant, rather than assuming API prices describe subscription economics. Astra is outside the default candidate set.
87
+
88
+ Use the same immutable source revision, task inputs, harness/image versions, checks, context regime and processing mode for each candidate. Declare the bar before running: all required checks pass, scope remains bounded, intended task acceptance passes and a reviewer accepts the result without unrecorded corrections. Use at least these four cases:
89
+
90
+ | Case | Fixed task | Acceptance |
91
+ | --- | --- | --- |
92
+ | Planning | Produce a dependency-ordered plan for a bounded resolver change | Required cases, scope and risks covered; no code changes |
93
+ | Implementation | Add one resolver validation case and its regression test | Identical targeted and repository checks pass; no unrelated edits |
94
+ | Review | Review a fixed fixture with a known precedence defect | Identify the seeded defect with a correct explanation and no false permission claim |
95
+ | Lightweight edit | Apply a fixed documentation correction | Exact requested diff, links and Markdown checks pass |
96
+
97
+ For every task/candidate record revision, exact prompt or fixture, model, effort, configured variant, provider-reported settings or unverified status, outcome, attempts/retries, human corrections, elapsed time, available usage and acceptance reviewer. Run two workers with distinct profiles and retain their runtime receipts. Keep deterministic routing/checks outside model usage.
98
+
99
+ Record the account route as operator-confirmed subscription, API or unknown; do not inspect credentials or switch routes. For API evaluations record uncached input, cached input, applicable cache writes, output/reasoning as actually billed, context regime and processing tier. Avoid counting reasoning twice when it is included in billed output. Record dated rate sources and compute API-equivalent estimates separately from actual charges. For subscriptions report only exposed usage; unknown is neither free nor unlimited. Flex and Batch are different transports and neither is implemented here.
100
+
101
+ Choose the least costly setting that meets the declared bar only when comparable accepted-task and account evidence supports that decision. Otherwise report selection as unresolved. This delivery supplies deterministic configuration and scheduling tests; it does not claim live candidate results or preset acceptance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juangcarmona/lighthouse-sdlc",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "type": "module",
5
5
  "description": "Provider-neutral SDLC skills, commands and route contracts for Lighthouse adopters",
6
6
  "repository": {
@@ -27,8 +27,12 @@
27
27
  "gates.json",
28
28
  "meta-commands",
29
29
  "README.md",
30
+ "github-actions.md",
31
+ "request-triage.md",
32
+ "templates",
30
33
  "host-contract.md",
31
34
  "execution-environments.md",
35
+ "model-profiles.md",
32
36
  "completion.md",
33
37
  "routes.json",
34
38
  "stages.json",
@@ -43,8 +47,12 @@
43
47
  "exports": {
44
48
  ".": "./src/sdlc.mjs",
45
49
  "./triage": "./src/triage.mjs",
50
+ "./request-triage": "./src/request-triage.mjs",
51
+ "./schemas/estimate.schema.json": "./schemas/estimate.schema.json",
46
52
  "./contracts": "./src/contracts.mjs",
47
53
  "./control-plane": "./src/control-plane.mjs",
54
+ "./model-profiles": "./src/model-profiles.mjs",
55
+ "./profile-delegation": "./src/profile-delegation.mjs",
48
56
  "./decompose": "./src/decompose.mjs",
49
57
  "./github": "./src/github.mjs",
50
58
  "./memory": "./src/memory.mjs",