@cassiomc1/forgeloop 1.8.1 → 1.10.0

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 (93) hide show
  1. package/.cursor/rules/project-loop.mdc +6 -3
  2. package/.github/copilot-instructions.md +5 -0
  3. package/AGENTS.md +6 -0
  4. package/AGENT_COMPATIBILITY.md +15 -0
  5. package/CLAUDE.md +6 -0
  6. package/DELEGATION_PROTOCOL.md +6 -0
  7. package/DOCS_INDEX.md +9 -2
  8. package/ENG/accessibility-eng.md +12 -2
  9. package/ENG/design-code-eng.md +22 -1
  10. package/LOOP_ENGINEERING.md +41 -0
  11. package/LOOP_SYSTEM_DESIGN.md +33 -0
  12. package/ORCHESTRATOR_INTEGRATION.md +9 -0
  13. package/PROTOCOL_INTEGRATION.md +57 -0
  14. package/QUALITY_SCORECARD.md +2 -0
  15. package/README.md +51 -0
  16. package/TERMINOLOGY.md +12 -0
  17. package/THREAT_MODEL.md +48 -0
  18. package/completions/_forgeloop +5 -1
  19. package/completions/forgeloop.bash +9 -1
  20. package/completions/forgeloop.fish +27 -1
  21. package/docs/ADVISORY_CONTEXT.md +174 -0
  22. package/docs/AGENT_PROTOCOL_SUMMARY.md +33 -2
  23. package/docs/ARTIFACT_REFERENCE.md +142 -0
  24. package/docs/CLI_REFERENCE.md +124 -1
  25. package/docs/CROSS_HARNESS_CONTINUITY.md +85 -0
  26. package/docs/DOCUMENTATION_GUIDE.md +7 -0
  27. package/docs/GETTING_STARTED.md +22 -0
  28. package/docs/KNOWLEDGE_SOURCES.md +171 -0
  29. package/docs/MCP.md +17 -1
  30. package/docs/RECIPES.md +111 -0
  31. package/docs/RELEASE_CHECKLIST.md +14 -0
  32. package/docs/STRUCTURAL_QUALITY.md +350 -0
  33. package/docs/TROUBLESHOOTING.md +161 -2
  34. package/docs/UNIVERSAL_INTEGRATION.md +60 -0
  35. package/package.json +4 -1
  36. package/schemas/config.schema.json +46 -0
  37. package/schemas/handoff-envelope.schema.json +1 -0
  38. package/schemas/preflight.schema.json +2 -1
  39. package/schemas/structural-quality.schema.json +175 -0
  40. package/scripts/check-changelog-freshness.mjs +27 -3
  41. package/scripts/generate-agent-protocol-summary.mjs +18 -0
  42. package/src/cli.js +24 -0
  43. package/src/commands/handoff-accept.js +36 -0
  44. package/src/commands/handoff-list.js +28 -2
  45. package/src/commands/handoff-show.js +27 -2
  46. package/src/commands/quality-baseline.js +28 -0
  47. package/src/commands/quality-status.js +34 -0
  48. package/src/commands/quality-verify.js +30 -0
  49. package/src/commands/reconcile-continuity.js +4 -0
  50. package/src/core/advisory-context/constants.js +74 -0
  51. package/src/core/advisory-context/provider.js +287 -0
  52. package/src/core/advisory-context/service.js +140 -0
  53. package/src/core/artifact-registry.js +12 -0
  54. package/src/core/audit.js +38 -0
  55. package/src/core/bundles.js +134 -1
  56. package/src/core/cli-command-definitions.js +62 -0
  57. package/src/core/command-executors.js +28 -0
  58. package/src/core/command-input.js +23 -1
  59. package/src/core/completion-artifacts.js +2 -0
  60. package/src/core/completion.js +42 -0
  61. package/src/core/config.js +3 -0
  62. package/src/core/continuity-lint.js +89 -0
  63. package/src/core/continuity-reconciliation.js +16 -0
  64. package/src/core/continuity.js +10 -11
  65. package/src/core/error-codes.js +186 -0
  66. package/src/core/events.js +32 -0
  67. package/src/core/execution-profile-context.js +15 -1
  68. package/src/core/filesystem.js +34 -3
  69. package/src/core/handoff-acceptance.js +277 -0
  70. package/src/core/handoff.js +41 -8
  71. package/src/core/inspect.js +64 -0
  72. package/src/core/integration-invocation-policy.js +34 -2
  73. package/src/core/integration-resources.js +38 -1
  74. package/src/core/next-action-model.js +11 -1
  75. package/src/core/next-action-phases.js +84 -5
  76. package/src/core/phase.js +9 -1
  77. package/src/core/portable-context.js +103 -0
  78. package/src/core/preflight.js +33 -0
  79. package/src/core/protocol-info.js +33 -2
  80. package/src/core/runtime-context.js +58 -0
  81. package/src/core/schema-validation.js +1 -0
  82. package/src/core/structural-quality/artifacts.js +329 -0
  83. package/src/core/structural-quality/constants.js +67 -0
  84. package/src/core/structural-quality/policy.js +227 -0
  85. package/src/core/structural-quality/provider.js +287 -0
  86. package/src/core/structural-quality/sentrux-mcp.js +477 -0
  87. package/src/core/structural-quality/service.js +1138 -0
  88. package/src/core/structural-quality/source-fingerprint.js +112 -0
  89. package/src/core/structural-quality/status.js +3 -0
  90. package/src/core/task-paths.js +24 -0
  91. package/src/core/templates.js +1 -0
  92. package/src/integration.d.ts +141 -0
  93. package/src/integration.js +36 -0
@@ -2,14 +2,11 @@
2
2
  description: Universal verified project loop
3
3
  alwaysApply: true
4
4
  ---
5
-
6
5
  <!-- FORGELOOP_PROJECT_PROTOCOL=REQUIRED -->
7
6
  # Cursor — Universal Project Loop
8
-
9
7
  This project is ForgeLoop-enabled. If your execution environment loaded this
10
8
  file, ForgeLoop applies regardless of model, provider, IDE, agent, or runtime.
11
9
  Do not treat ForgeLoop as vendor-specific, optional, or to follow only "in spirit".
12
-
13
10
  1. Read [`LOOP_ENGINEERING.md`](../../LOOP_ENGINEERING.md) and [`PROTOCOL_INTEGRATION.md`](../../PROTOCOL_INTEGRATION.md).
14
11
  2. Confirm [`PROJECT_PROFILE.md`](../../PROJECT_PROFILE.md) from real sources; initialize if in `template` mode.
15
12
  3. Use [`GUIDE_ROUTER.md`](../../GUIDE_ROUTER.md) to activate relevant guides and report IDs.
@@ -24,6 +21,12 @@ After implementation work for the current task is complete, run `forgeloop next`
24
21
 
25
22
  10. Report only demonstrated results and checks.
26
23
 
24
+ When `structuralQuality` is enabled, capture its baseline after planning and
25
+ before `EXECUTING`, evaluate the current cycle in `VERIFYING`, and route
26
+ regressions through the existing diagnosis/correction loop. Do not claim
27
+ `PASS` for unavailable evidence, replace a baseline after execution begins, or
28
+ expand scope to chase a perfect score.
29
+
27
30
  Do not stop for non-blocking missing product details. When a safe, reversible
28
31
  local default exists, record it as an agent assumption and follow the Blocking vs Non-Blocking Decisions policy in `LOOP_ENGINEERING.md`.
29
32
 
@@ -21,6 +21,11 @@ Use these instructions across the repository while preserving local rules.
21
21
  After implementation work for the current task is complete, run `forgeloop next` before returning a final result. Follow the returned lifecycle action until ForgeLoop reaches a terminal state or an explicit blocker.
22
22
 
23
23
  - Report results, checks actually run, limitations, and publication state.
24
+ - When `structuralQuality` is enabled, capture its baseline after planning and
25
+ before `EXECUTING`, evaluate the current cycle in `VERIFYING`, and route
26
+ regressions through the existing diagnosis/correction loop. Never claim
27
+ `PASS` for unavailable evidence, replace a baseline after execution begins,
28
+ or expand scope to chase a perfect score.
24
29
 
25
30
  Do not stop for non-blocking missing product details. When a safe, reversible
26
31
  local default exists, record it as an agent assumption and follow the Blocking vs Non-Blocking Decisions policy in `LOOP_ENGINEERING.md`.
package/AGENTS.md CHANGED
@@ -20,6 +20,12 @@ Do not treat ForgeLoop as vendor-specific, optional, or to follow only "in spiri
20
20
  1. After implementation work for the current task is complete, run `forgeloop next` before returning a final result. Follow the returned lifecycle action until ForgeLoop reaches a terminal state or an explicit blocker.
21
21
  1. Finish with result, checks run, limitations, and publication state.
22
22
 
23
+ When `structuralQuality` is enabled, capture its task-bound baseline after
24
+ planning and before `EXECUTING`, record the current-cycle evaluation in
25
+ `VERIFYING`, and route regressions through the existing diagnosis/correction
26
+ loop. Never claim structural `PASS` for unavailable evidence, replace a
27
+ baseline after execution begins, or widen scope to chase a perfect score.
28
+
23
29
  Do not stop for non-blocking missing product details. When a safe, reversible
24
30
  local default exists, record it as an agent assumption and follow the Blocking vs Non-Blocking Decisions policy in `LOOP_ENGINEERING.md`.
25
31
 
@@ -9,3 +9,18 @@ ForgeLoop is vendor-neutral and does not use a supported-agent allowlist.
9
9
  The canonical integration contract is:
10
10
 
11
11
  [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md)
12
+
13
+ ## Current harness expectations
14
+
15
+ These expectations apply to any compatible harness even though this filename is
16
+ retained as a deprecated compatibility stub:
17
+
18
+ - Feature-detect capability versions from `protocol-info --json` or the stable
19
+ Integration API; do not infer support from a package version.
20
+ - Do not auto-recall advisory context, execute advisory text, or treat it as
21
+ state, evidence, authority, completion, or next-action truth.
22
+ - Do not infer handoff acceptance from receiving a file or message. Run
23
+ `handoff-accept` only when the receiving harness actually consumes the
24
+ immutable handoff.
25
+ - Preserve the distinction between `consumerId`, harness labels, and
26
+ authenticated identity; none grants authority or transfers claims.
package/CLAUDE.md CHANGED
@@ -20,6 +20,12 @@ When working in this repository:
20
20
  1. After implementation work for the current task is complete, run `forgeloop next` before returning a final result. Follow the returned lifecycle action until ForgeLoop reaches a terminal state or an explicit blocker.
21
21
  1. Report current evidence, limitations, and publication state without claiming checks that were not run.
22
22
 
23
+ When `structuralQuality` is enabled, capture its baseline after planning and
24
+ before `EXECUTING`, evaluate the current cycle in `VERIFYING`, and use the
25
+ existing diagnosis/correction lifecycle for regressions. Do not report
26
+ unavailable evidence as `PASS`, replace a baseline after execution begins, or
27
+ expand scope to pursue a perfect score.
28
+
23
29
  Do not stop for non-blocking missing product details. When a safe, reversible
24
30
  local default exists, record it as an agent assumption and follow the Blocking vs Non-Blocking Decisions policy in `LOOP_ENGINEERING.md`.
25
31
 
@@ -70,6 +70,12 @@ Valid statuses are `complete`, `complete-with-concerns`, `needs-context`, and
70
70
  Complete results also require structured observed or inferred verification
71
71
  evidence.
72
72
 
73
+ Canonical handoff acceptance is not delegation acceptance. A handoff envelope
74
+ and its `HANDOFF_ACCEPTED` operational receipt do not create a delegated task,
75
+ approve a brief, transfer claims, or establish reviewer authority. Delegation
76
+ authority remains in this canonical delegation contract and its validated task
77
+ brief/result relationships.
78
+
73
79
  ## Review and integration
74
80
 
75
81
  An independent reviewer receives the approved brief, resulting diff,
package/DOCS_INDEX.md CHANGED
@@ -15,22 +15,27 @@ integration and guide context. Use this map before editing documentation.
15
15
  | Need | Canonical source | Boundary |
16
16
  | --- | --- | --- |
17
17
  | Getting started tutorial | [`docs/GETTING_STARTED.md`](./docs/GETTING_STARTED.md) | First-time walkthrough from init to completion |
18
- | Cross-harness continuity | [`docs/CROSS_HARNESS_CONTINUITY.md`](./docs/CROSS_HARNESS_CONTINUITY.md) | Operational handoff and multi-tool resumption |
18
+ | Cross-harness continuity | [`docs/CROSS_HARNESS_CONTINUITY.md`](./docs/CROSS_HARNESS_CONTINUITY.md) | Operational resume guidance, immutable handoffs, and multi-tool resumption |
19
19
  | Agent bootstrap summary | [`docs/AGENT_PROTOCOL_SUMMARY.md`](./docs/AGENT_PROTOCOL_SUMMARY.md) | Generated concise navigation aid for protocol invariants and commands |
20
20
  | CLI command reference | [`docs/CLI_REFERENCE.md`](./docs/CLI_REFERENCE.md) | Full syntax, options, and JSON examples for all commands |
21
21
  | Artifact and schema reference | [`docs/ARTIFACT_REFERENCE.md`](./docs/ARTIFACT_REFERENCE.md) | Purpose, mutability, and trust classifications of `.forgeloop/` |
22
22
  | Durable actions and trajectory evidence | [`docs/EXECUTION_TRACE.md`](./docs/EXECUTION_TRACE.md) and [`docs/RECIPES.md`](./docs/RECIPES.md) | Action provenance, reconciliation, metrics, and project-local evaluation |
23
23
  | Troubleshooting and recovery | [`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md) | Symptom-first recovery and stable error code reference |
24
24
  | Operational recipes | [`docs/RECIPES.md`](./docs/RECIPES.md) | Short copy-paste recipes for daily workflows |
25
+ | Structural quality feedback | [`docs/STRUCTURAL_QUALITY.md`](./docs/STRUCTURAL_QUALITY.md) | Provider-neutral baseline, delta policy, Sentrux boundary, lifecycle integration, and troubleshooting |
25
26
  | Diagnostic model | [`docs/DIAGNOSTIC_MODEL.md`](./docs/DIAGNOSTIC_MODEL.md) | Structured diagnostic cases, interventions, hypothesis dispositions, information gain |
26
27
  | Execution trace and observability | [`docs/EXECUTION_TRACE.md`](./docs/EXECUTION_TRACE.md) | `history`, `trace`, `reflect`, and task-level `inspect` read-only projections |
27
- | Workspace, handoff, responsibility, and scope | [`docs/ARTIFACT_REFERENCE.md`](./docs/ARTIFACT_REFERENCE.md) and [`docs/CLI_REFERENCE.md`](./docs/CLI_REFERENCE.md) | Optional task boundaries and deterministic verification planning |
28
+ | Workspace, handoff, responsibility, and scope | [`docs/ARTIFACT_REFERENCE.md`](./docs/ARTIFACT_REFERENCE.md) and [`docs/CLI_REFERENCE.md`](./docs/CLI_REFERENCE.md) | Optional task boundaries, immutable handoffs, and deterministic verification planning |
29
+ | Handoff acceptance | [`docs/CROSS_HARNESS_CONTINUITY.md`](./docs/CROSS_HARNESS_CONTINUITY.md) | Ledger-backed operational receipt; no claim transfer, evidence, or authority |
28
30
  | Code attestation and revision coverage | [`docs/CODE_ATTESTATION.md`](./docs/CODE_ATTESTATION.md) | Source-content manifests, in-toto statements, signatures, and range verification |
29
31
  | Revision and signing providers | [`docs/REVISION_PROVIDERS.md`](./docs/REVISION_PROVIDERS.md) and [`docs/SIGNING_PROVIDERS.md`](./docs/SIGNING_PROVIDERS.md) | Provider-neutral extension contracts |
30
32
  | Platform adapters | [`docs/PLATFORM_ADAPTERS.md`](./docs/PLATFORM_ADAPTERS.md) | Generic CI boundary and platform mapping guidance |
31
33
  | Universal integration API | [`docs/UNIVERSAL_INTEGRATION.md`](./docs/UNIVERSAL_INTEGRATION.md) | Programmatic integration subpath, envelope semantics, and consumer map |
34
+ | Advisory context providers | [`docs/ADVISORY_CONTEXT.md`](./docs/ADVISORY_CONTEXT.md) | Optional external host context, non-evidence trust boundary, allowlist normalization, and safety rules |
32
35
  | Local-first MCP adapter | [`docs/MCP.md`](./docs/MCP.md) | stdio default, optional strict loopback HTTP; server modes/capabilities and canonical resources |
33
36
  | Adaptive execution-profile benchmarks | [`docs/EXECUTION_PROFILE_BENCHMARKS.md`](./docs/EXECUTION_PROFILE_BENCHMARKS.md) | Measured provider/host runs, robust statistics, paired/distribution deltas, tail status, outliers, and profile-aware host context |
37
+ | Knowledge integration gap analysis | [`docs/KNOWLEDGE_INTEGRATION_GAP_ANALYSIS.md`](./docs/KNOWLEDGE_INTEGRATION_GAP_ANALYSIS.md) | Repository-only research audit of candidate coverage, proven gaps, canonical homes, context cost, and intentional skip/defer decisions |
38
+ | Knowledge sources and provenance | [`docs/KNOWLEDGE_SOURCES.md`](./docs/KNOWLEDGE_SOURCES.md) | Snapshot, licensing observations, source roles, accepted/skipped concepts, and reuse boundaries |
34
39
  | Documentation guide | [`docs/DOCUMENTATION_GUIDE.md`](./docs/DOCUMENTATION_GUIDE.md) | Rules and checklist for modifying documentation |
35
40
  | Current release checklist | [`docs/RELEASE_CHECKLIST.md`](./docs/RELEASE_CHECKLIST.md) | Package, protocol, attestation, integration, and publication gates |
36
41
  | ForgeLoop 1.6.1 release checklist (historical) | [`docs/RELEASE_CHECKLIST_1_6_1.md`](./docs/RELEASE_CHECKLIST_1_6_1.md) | Verification adapter boundary, isolation invariants, and publication gates |
@@ -66,6 +71,7 @@ integration and guide context. Use this map before editing documentation.
66
71
  | **Inspecting `.forgeloop/` files** | [`docs/ARTIFACT_REFERENCE.md`](./docs/ARTIFACT_REFERENCE.md) |
67
72
  | **Fixing a broken or stale state** | [`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md) |
68
73
  | **Looking for quick recipes** | [`docs/RECIPES.md`](./docs/RECIPES.md) |
74
+ | **Configuring structural quality feedback** | [`docs/STRUCTURAL_QUALITY.md`](./docs/STRUCTURAL_QUALITY.md) |
69
75
  | **Understanding verification trust** | [`docs/REVISION_PROVIDERS.md`](./docs/REVISION_PROVIDERS.md#differential-verification-scope) |
70
76
  | **Understanding attestation trust** | [`docs/CODE_ATTESTATION.md`](./docs/CODE_ATTESTATION.md#trust-levels) |
71
77
  | **Maintaining generated diagrams** | [`docs/diagrams/README.md`](./docs/diagrams/README.md) |
@@ -87,6 +93,7 @@ integration and guide context. Use this map before editing documentation.
87
93
  - **Fix a blocked, stale, or invalid state**: [`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md)
88
94
  - **Recover a stale task or reacquire released claims**: [`docs/RECIPES.md`](./docs/RECIPES.md#recipe-15--release-and-reacquire-claims-for-an-abandoned-task)
89
95
  - **Find operational copy-paste commands**: [`docs/RECIPES.md`](./docs/RECIPES.md)
96
+ - **Measure structural quality without replacing tests**: [`docs/STRUCTURAL_QUALITY.md`](./docs/STRUCTURAL_QUALITY.md)
90
97
  - **Read the normative protocol specification**: [`LOOP_ENGINEERING.md`](./LOOP_ENGINEERING.md)
91
98
  - **Integrate a new AI environment**: [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md)
92
99
  - **Map ForgeLoop state into an external runtime/orchestrator**: [`ORCHESTRATOR_INTEGRATION.md`](./ORCHESTRATOR_INTEGRATION.md)
@@ -3,7 +3,7 @@ name: accessibility-eng
3
3
  language: en
4
4
  description: "Practical WCAG 2.2-oriented accessibility protocol for web, mobile, and desktop."
5
5
  version: "2026.09"
6
- last-reviewed: "2026-08-10"
6
+ last-reviewed: "2026-08-31"
7
7
  guide-id: accessibility
8
8
  completion-evidence:
9
9
  - keyboard-navigation
@@ -77,6 +77,8 @@ To ensure technical integrity, any AI interacting with the project **MUST**:
77
77
  - **Keyboard (SC 2.1.1):** all functionality **MUST** be operable without a mouse. Where the function depends on the path of movement rather than only its endpoints, document why the WCAG exception applies and provide a practical alternative when possible. Avoid purely pointer-based listeners without keyboard event equivalents (`onKeyDown`).
78
78
  - **Focus (SC 2.4.7, 2.4.11):** focus **MUST** be visible, never entirely obscured by author content (e.g., sticky headers/footers), persistent, and never suppressed via CSS (`outline: none` without fallback is forbidden).
79
79
  - **SPA routing:** after client-side routing changes, focus **MUST** be managed and properly reset (e.g., sending focus to the top or an `h1`). Avoid lost focus on the screen.
80
+ - **Focus order and lifecycle (SC 2.4.3):** the sequential keyboard path **MUST** preserve meaning and operability. Prefer alignment between DOM order, reading order, and visual order when divergence would create confusing or illogical navigation. Avoid positive `tabindex` as a ForgeLoop accessibility best practice; repair the document structure whenever practical. When content is inserted, removed, expanded, collapsed, replaced, or routed, define the next logical focus destination and do not leave focus on a removed or unavailable node.
81
+ - **Modal dialog focus contract:** for a modal dialog, choose the initial focus target according to the modal task, move focus inside the modal, keep the inactive background out of the keyboard path, and remember the invoking control. On close, return focus to that control only when it still exists and is available; otherwise move focus to a documented logical fallback, such as the control that owns the resulting content or the newly exposed heading. A trigger removed during the operation is a lifecycle case, not permission to drop focus. Do not apply modal containment rules to non-modal dialogs.
80
82
  - **Targets (SC 2.5.8):** interactive elements MUST have a minimum size of **24×24 CSS pixels** — the WCAG 2.2 AA floor — except when an equivalent larger target exists, sufficient spacing prevents accidental activation, or the target sits inline in text.
81
83
  **House Rule†:** design to **44×44px** (48×48 under Shield), the ergonomic floor shared by Apple HIG and Material Design. Under Shield, 44×44 is normative (SC 2.5.5 AAA).
82
84
  - **Dragging (SC 2.5.7, AA):** all functionality operated by dragging MUST have a simple pointer alternative that does not require dragging, unless dragging is essential or the behavior is provided by the user agent and has not been modified by the author. The alternative cannot rely only on a path-based gesture.
@@ -96,6 +98,12 @@ To ensure technical integrity, any AI interacting with the project **MUST**:
96
98
  - **Semantic HTML:** **MUST** prefer native (HTML5) elements over custom ones.
97
99
  - **Interoperability:** the code **MUST** be compatible with current assistive technologies (ISO 9241-171).
98
100
 
101
+ ### Composite visuals, code, and status
102
+
103
+ - When several DOM nodes together communicate one informative visual, expose one meaningful semantic representation and keep decorative fragments out of the accessibility tree. Do not make users traverse borders, connector lines, repeated labels, or illustration layers that add no information.
104
+ - A code example **MUST** remain available as text with code semantics. Line-number gutters, syntax decoration, and duplicate visual labels **SHOULD** be hidden from assistive technology when they do not add meaning. A copy or expand action **MUST** be a named, keyboard-operable control; its result belongs in the pre-mounted status region described above rather than only in a changed icon or color.
105
+ - A composite presentation is not evidence that its semantics work. Verify the accessible name, role, value, focus path, and status announcement in the supported browser and assistive-technology combinations; automated tree checks cover only part of this behavior.
106
+
99
107
  ## 4. Visual directives (strict UI criteria)
100
108
 
101
109
  These directives combine WCAG requirements where identified and this guide's ergonomic recommendations. They support implementation but do not assure certification or legal compliance.
@@ -120,7 +128,7 @@ When identifying an unmapped or highly complex component (e.g., charts, dynamic
120
128
  - **Leaked focus traps:** **MUST NOT** create modals without managing focus. When a modal is open:
121
129
  - focus MUST move into the modal;
122
130
  - focus MUST be trapped within the modal;
123
- - focus MUST return to the triggering element when closed;
131
+ - focus MUST return to the triggering element when it still exists and remains available; otherwise focus MUST move to a documented logical fallback;
124
132
  - background content MUST NOT be interactive or reachable via keyboard.
125
133
  - **Placeholder labels:** **MUST NOT** use `placeholder` as the sole form of label. Crucial instructions (like date formats) **MUST** be visible outside the field to prevent disappearance during filling.
126
134
  - **ARIA soup:** **MUST NOT** add ARIA where native HTML already provides the semantics — no ARIA is better than bad ARIA. Forbidden by default: redundant roles (`role="button"` on a `<button>`), `aria-label` duplicating visible text (harmless today, but it drifts into an SC 2.5.3 failure when the text changes), and static ARIA states that are never updated (hardcoded `aria-expanded` — an SC 4.1.2 failure). ARIA is the fallback for gaps in native semantics ([First Rule of ARIA Use](https://www.w3.org/TR/using-aria/#rule1)), not a seasoning. The number of ARIA attributes is not evidence of accessibility; validate behavior, semantics, and assistive-technology support.
@@ -131,12 +139,14 @@ When identifying an unmapped or highly complex component (e.g., charts, dynamic
131
139
 
132
140
  - [ ] **Technical check:** run the project's already configured static accessibility checks and engines such as `Axe` where applicable (see [`test-code-eng.md`](./test-code-eng.md) for tool selection). Do not install a tool solely to satisfy this item; record a required unavailable check as blocked.
133
141
  - [ ] **Tab order:** `Tab` key path manually validated (ensures absence of frontend dead-ends).
142
+ - [ ] **Focus order and lifecycle:** sequential order preserves meaning and operability; DOM, reading, and visual order are aligned where divergence would create confusing or illogical navigation; no positive `tabindex` is used; inserted, removed, expanded, collapsed, replaced, and routed content has a defined logical focus destination; modal dialogs have intentional initial focus and a valid return or fallback target.
134
143
  - [ ] **Focus (SC 2.4.13, AAA when applicable):** measure the area equivalent to a 2 CSS pixel perimeter and 3:1 contrast between the same pixels in focused and unfocused states; also verify applicable non-text contrast.
135
144
  - [ ] **Dragging (SC 2.5.7, AA):** test every drag operation with a simple pointer alternative that does not require dragging; document the essentiality or user-agent exception, if any.
136
145
  - [ ] **Consistent help (SC 3.2.6, A):** compare pages in the same set and confirm repeated help mechanisms retain the same relative order, unless the user initiated a change.
137
146
  - [ ] **Redundant entry (SC 3.3.7, A):** run multi-step processes and confirm auto-population or selection of previously provided information, or record the applicable exception.
138
147
  - [ ] **Authentication (SC 3.3.8, AA):** test the whole flow, including MFA, without requiring unassisted memorization, solving, or transcription; confirm password-manager and paste support when they are the chosen mechanism.
139
148
  - [ ] **User flow and announcements:** manually test dynamic interactions without a mouse. Confirm DOM-present regions announce non-urgent messages through `role="status"` or `aria-live="polite"`, reserve `role="alert"` for urgent errors, and work in supported browser and assistive-technology combinations.
149
+ - [ ] **Composite content:** informative multi-node visuals have one meaningful representation, decorative fragments are not announced, code remains readable as text, code controls have names, and copy/result status is announced through the intended region.
140
150
  - [ ] **Zoom and reflow:** text resizes up to 200% without loss of content or function (SC 1.4.4); content reflows at 320 CSS px width — equivalent to 400% zoom on a 1280px viewport — without two-dimensional scrolling (SC 1.4.10). Preserve flexibility using relative units (rem/em).
141
151
  - [ ] **Color and perception:** no functional loss when color is unavailable; confirm the additional channel appropriate to the meaning without requiring universal visual redundancy.
142
152
  - [ ] **Exceptions audit:** `EXCEPTIONS.md` reviewed — every active entry has a risk owner, approver, tracking issue, and expiry; no expired entries left unaddressed.
@@ -3,7 +3,7 @@ name: design-code-eng
3
3
  language: en
4
4
  description: "Visual direction, UX, motion, and perceived performance for premium digital experiences."
5
5
  version: "2026.09"
6
- last-reviewed: "2026-08-17"
6
+ last-reviewed: "2026-08-31"
7
7
  guide-id: design
8
8
  requires-gates:
9
9
  - design
@@ -261,6 +261,27 @@ Canvas, WebGL, SVG displacement, and Liquid Glass effects follow the **normative
261
261
 
262
262
  ## Premium Components (measurable defaults)
263
263
 
264
+ ### Component state contract
265
+
266
+ Before polishing an interactive or data-bearing component, list the states it
267
+ can actually reach. Use only the applicable states; this is a review aid, not a
268
+ requirement to manufacture every variant.
269
+
270
+ - **Resting and interaction:** default, hover where supported, focus-visible,
271
+ and active/pressed.
272
+ - **Availability:** disabled and loading when the operation or dependency is
273
+ unavailable or in progress.
274
+ - **Data and outcome:** empty, selected, expanded/collapsed, success, and error
275
+ when the component can display those conditions.
276
+
277
+ Every reachable state must preserve the component's semantic name, action,
278
+ focus behavior, contrast, and a non-color cue where color alone would be
279
+ ambiguous. Define the authoritative transition for asynchronous states,
280
+ including cancellation or a repeated request, so an interrupted operation
281
+ cannot leave stale loading, success, or error feedback. Verify reachable
282
+ transitions with interaction and semantic checks; a screenshot can show an
283
+ appearance but cannot prove the state behavior or accessibility.
284
+
264
285
  **Primary button**
265
286
 
266
287
  - Padding: `14px 28px` (mobile `12px 24px`)
@@ -24,6 +24,7 @@
24
24
  - [Proportional Planning](#proportional-planning)
25
25
  - [Execution Loop](#execution-loop)
26
26
  - [Verification & Regression](#verification-and-regression)
27
+ - [Structural Quality Feedback](#structural-quality-feedback)
27
28
  - [Evidence-Driven Correction](#evidence-driven-correction)
28
29
  - [Precedence & Stop Conditions](#precedence)
29
30
  - [Final Delivery](#final-delivery)
@@ -1208,6 +1209,33 @@ Choose checks that match the artifact and risk.
1208
1209
  Regression depth grows with risk: specific check, related tests, then suite,
1209
1210
  build, and integration validation when reasonable.
1210
1211
 
1212
+ <a id="FL-SQ-001"></a> **FL-SQ-001 — Structural-quality evidence MUST remain provider-neutral, task-bound, delta-first, and separate from other verification dimensions.**
1213
+
1214
+ ### Structural quality feedback
1215
+
1216
+ Structural quality is an optional provider-neutral verification dimension. It
1217
+ is a measurement of dependency structure, not a guide, a static analyzer built
1218
+ into ForgeLoop, or a universal software-quality score. The external provider
1219
+ remains a replaceable sensor while ForgeLoop owns policy and evidence.
1220
+
1221
+ When enabled, capture a task-bound baseline after planning and immediately
1222
+ before execution. In `VERIFYING`, record the current-cycle evaluation before
1223
+ entering `REVIEWING`. A gate requires a comparable current-cycle pass; observe
1224
+ mode exposes the result or limitation without adding a completion blocker;
1225
+ off mode does not resolve or launch a provider.
1226
+
1227
+ The baseline is immutable after `EXECUTING`. Provider identity/version, policy,
1228
+ route, contract, scope, and rules drift makes observations incomparable. A
1229
+ regression follows the existing `VERIFYING -> DIAGNOSING -> CORRECTING ->
1230
+ VERIFYING` loop with evidence-backed diagnosis; ForgeLoop does not fabricate a
1231
+ diagnosis. Do not claim `PASS` for unavailable or malformed evidence.
1232
+
1233
+ Optional optimization is bounded, advisory, and scope-safe. It may use at most
1234
+ two extra evaluations in a verification cycle, never becomes required for
1235
+ completion, never widens claims, and never chases a perfect score. See
1236
+ [`docs/STRUCTURAL_QUALITY.md`](./docs/STRUCTURAL_QUALITY.md) for the provider
1237
+ contract, policy fields, commands, artifact layout, and Sentrux boundary.
1238
+
1211
1239
  ### Executable Policy & Autonomy-Preserving Invariants
1212
1240
 
1213
1241
  ForgeLoop enforces executable verification rules (`.forgeloop/policy/rules.json`) that evaluate constraints on code and artifacts.
@@ -1348,6 +1376,15 @@ completion. `CONTINUITY_CANNOT_GRANT_AUTHORITY`: continuity cannot authorize an
1348
1376
  installation or external action. <a id="FL-CONT-001"></a> **FL-CONT-001 — A receiving harness MUST reconcile**
1349
1377
  continuity against the current work state and checkout before acting on it.
1350
1378
 
1379
+ Canonical handoff acceptance is orthogonal to lifecycle phase transitions. The
1380
+ `HANDOFF_ACCEPTED` event is an exactly-once, ledger-backed operational receipt;
1381
+ it does not add a lifecycle phase, transfer claims, create evidence, authorize
1382
+ work, or approve review. A receiving harness runs `handoff-accept` only when it
1383
+ actually consumes the immutable handoff. Advisory context is also outside the
1384
+ canonical lifecycle: providers are lazy and opt-in through the Integration API,
1385
+ and their output cannot determine state, evidence, authority, completion, or
1386
+ the next action.
1387
+
1351
1388
  ## Optional task boundaries and code attestation
1352
1389
 
1353
1390
  ForgeLoop keeps the following extensions optional so existing task artifacts
@@ -1371,6 +1408,10 @@ review evidence, or prove completion. An optional actor note or recipient hint
1371
1408
  is descriptive metadata only. This envelope is distinct from mutable
1372
1409
  `continuity.json`, which is operational resume context and non-evidence.
1373
1410
 
1411
+ `handoff-accept` records the receiver's operational consumption only. It does
1412
+ not make `consumerId`, `harness`, a recipient hint, or a handoff envelope an
1413
+ authenticated identity, delegation approval, or lifecycle authority.
1414
+
1374
1415
  <a id="FL-SCOPE-001"></a> **FL-SCOPE-001 — A verification scope MUST narrow execution only from**
1375
1416
  current canonical changed paths, effective claims, or an explicit full-project
1376
1417
  requirement. The resolver never guesses impacted tests, and a stale scope is
@@ -465,6 +465,39 @@ The README explains the file set, activation behavior, current/relative/absolute
465
465
  target installation, first-run profile flow, local validation commands, and safe
466
466
  update practice.
467
467
 
468
+ ## Advisory and handoff trust boundaries
469
+
470
+ Optional advisory context remains outside canonical lifecycle state and evidence:
471
+
472
+ ```text
473
+ External advisory provider
474
+ |
475
+ v
476
+ bounded recall input
477
+ |
478
+ v
479
+ allowlist normalization
480
+ |
481
+ v
482
+ ADVISORY / NON_EVIDENCE / NON_EXECUTABLE
483
+ ```
484
+
485
+ Handoff acceptance is a separate operational receipt over an immutable snapshot:
486
+
487
+ ```text
488
+ canonical state + current repository
489
+ |
490
+ v
491
+ immutable handoff
492
+ |
493
+ v
494
+ HANDOFF_ACCEPTED ledger receipt
495
+ ```
496
+
497
+ Neither boundary transfers claims or creates evidence or authority. Advisory
498
+ providers are lazy and opt-in through the Integration API; handoff acceptance
499
+ is orthogonal to lifecycle phases and does not authorize the receiving harness.
500
+
468
501
  ## Out of scope
469
502
 
470
503
  - remote prompt services or databases;
@@ -159,6 +159,15 @@ claims, lifecycle transitions, evidence binding, completion, and fail-closed
159
159
  trust decisions. Workspace binding, responsibility, narrow verification,
160
160
  signing, and MCP are not prerequisites for basic protocol compatibility.
161
161
 
162
+ Handoff acceptance is orthogonal to the lifecycle transition graph. An
163
+ orchestrator may call `handoff-accept` only after the receiving harness has
164
+ actually consumed the immutable snapshot. The resulting `HANDOFF_ACCEPTED`
165
+ event is an exactly-once operational receipt; it does not accept delegation,
166
+ transfer claims, create evidence, authenticate `consumerId` or `harness`, or
167
+ grant lifecycle or review authority. Advisory context is likewise optional,
168
+ lazy, and Integration-API-only; it must not be loaded automatically or used as
169
+ an executable instruction source.
170
+
162
171
  Focused visual fallbacks are maintained in the [Verification Trust
163
172
  Flow](./docs/REVISION_PROVIDERS.md#differential-verification-scope) and [Code
164
173
  Attestation Chain](./docs/CODE_ATTESTATION.md#completion-flow).
@@ -181,6 +181,37 @@ authority, provenance, and safety-floor decisions remain unchanged.
181
181
  validator-backed completion remains unchanged.
182
182
  ```
183
183
 
184
+ ## Capability negotiation
185
+
186
+ The public capability handshake exposes additive capability families separately
187
+ from Protocol v1, schema v1, and Integration API v1:
188
+
189
+ | Capability family | Version | Boundary |
190
+ | --- | --- | --- |
191
+ | `canonicalHandoffs` | v2 | Immutable handoff snapshots with ledger-backed exactly-once operational acceptance |
192
+ | `advisoryContextProviders` | v1 | Lazy, opt-in, provider-neutral Integration API injection only |
193
+
194
+ `canonicalHandoffs` v2 advertises `supported: true`, immutable snapshots,
195
+ `lifecycleAuthority: false`, `evidenceAuthority: false`,
196
+ `exactlyOnceAcceptance: true`, `acceptanceLedgerBacked: true`, and the
197
+ `handoff-accept` command with `OPEN`, `ACCEPTED`, `UNBOUND`, and `INCONSISTENT`
198
+ status projections. Acceptance is an operational receipt only: it does not
199
+ transfer claims or create evidence or authority, and it is orthogonal to phase
200
+ transitions.
201
+
202
+ `advisoryContextProviders` v1 is `integrationApiOnly: true`, lazy, and opt-in.
203
+ Its results are never persisted by ForgeLoop and are never canonical state,
204
+ evidence, authority, completion truth, next-action authority, or executable
205
+ instructions. `protocol-info` may advertise the capability, but advisory
206
+ recall remains a programmatic Integration API operation; there is no stock
207
+ `context-recall` CLI command.
208
+
209
+ A consumer that understands `canonicalHandoffs` v1 but not v2 may disable the
210
+ handoff-specific UI while keeping Protocol v1 core functionality available.
211
+ Consumers must feature-detect the capability family and must not mark the
212
+ whole project incompatible merely because an optional capability version is
213
+ newer.
214
+
184
215
  Optional observability is lazy. Reflection, trajectory evaluation, handoff,
185
216
  responsibility, attestation, benchmark analysis, and continuity artifacts are
186
217
  not required merely because the capability exists; policy, user/host request,
@@ -506,6 +537,7 @@ The ownership boundary for these extensions is explicit:
506
537
  | Handoff envelope | Creates immutable protocol-derived snapshots and verifies their digest and ledger relationships | Supplies any descriptive note or recipient hint; it cannot turn the envelope into delegation or evidence |
507
538
  | Responsibility contract | Validates allowed/read-only paths, required checks, and frozen-input fingerprints | Chooses the optional boundary and performs the work inside it |
508
539
  | Verification scope | Resolves `AUTO`, `CHANGED`, `CLAIMED`, or `FULL`, binds scoped-checker argv, and fails closed on stale or mismatched inputs | Declares checker configuration and consumes the returned scope without guessing a narrower one |
540
+ | Structural quality | Owns provider-neutral baseline/evaluation artifacts, delta policy, typed check provenance, and lifecycle/completion semantics | Supplies or selects a runtime provider and consumes `quality-status`; it does not provide arbitrary executable or shell input |
509
541
  | RevisionProvider | Reads opaque revisions, exact bytes, normalized changes, and range coverage through the provider contract | Supplies or selects the provider and revision identifiers |
510
542
  | SigningProvider | Validates provider results and preserves `VERIFIED` versus `ATTESTED` semantics | Owns the external signer, identity/issuer policy, credentials, and availability |
511
543
  | Generic CI / MCP | Keeps canonical command, evidence, and trust semantics | Owns the platform job, transport, scheduling, and presentation layer |
@@ -526,6 +558,31 @@ OIDC tokens, and credentials outside ForgeLoop artifacts. Signing and
526
558
  verification may use an external provider, while the persisted statement stays
527
559
  deterministic and provider-neutral.
528
560
 
561
+ <a id="FL-SQ-002"></a> **FL-SQ-002 — A structural-quality integration MUST preserve unavailable, malformed, stale, incomparable, and blocked provider results without promoting them to PASS.**
562
+
563
+ ## Structural quality integration
564
+
565
+ Structural quality is an optional provider-neutral capability. The public
566
+ integration API exposes `StructuralQualityProvider`, normalized detection and
567
+ snapshot types, and runtime provider injection through the context. Project
568
+ configuration selects only a registered provider name and policy; it cannot
569
+ select an executable path, shell command, arbitrary argument vector, raw score,
570
+ or baseline.
571
+
572
+ The canonical commands are `quality-baseline` and `quality-verify` for bounded
573
+ provider execution and task mutation, plus read-only `quality-status`. MCP and
574
+ the integration API consume the same declarative command definitions and
575
+ preserve `PASS`, `FAIL`, `BLOCKED`, and `NOT_OBSERVED` without duplicating
576
+ lifecycle logic. The read-only `task/structural-quality` resource never starts
577
+ the provider.
578
+
579
+ The built-in `sentrux` provider uses the local MCP stdio boundary, requires a
580
+ supported version, and keeps output, timeout, path, and secret handling inside
581
+ ForgeLoop's normalized evidence boundary. Sentrux is not a runtime dependency;
582
+ installation and analytics preferences remain user-managed. Quality evidence
583
+ does not replace behavioral, security, performance, accessibility, review,
584
+ publication, or production-readiness evidence.
585
+
529
586
  ## Executable Policy Protocol Integration
530
587
 
531
588
  ForgeLoop integrates executable verification rules directly into the lifecycle:
@@ -15,6 +15,7 @@ policy are all present.
15
15
  | Portability | Node 20/22/24 Linux depth, OS smoke coverage, path/line-ending fixtures, and adapter compatibility evidence. |
16
16
  | Observability | `inspect`/`status`/`validate-protocol` shared derived state classification, real schema health, shared evidence, rich doctor findings, receipts, and no telemetry. |
17
17
  | Completion enforcement | Canonical contract, persisted route, guide-declared gates, preflight, phase ledger, structured checks, evidence coverage, `audit`, `report`, and `complete` validators. |
18
+ | Structural quality feedback | Provider-neutral baseline and delta policy, five root-cause scores, typed task artifacts, bounded Sentrux MCP adapter, gate/observe semantics, and corrective lifecycle integration. |
18
19
  | Agent lifecycle navigation | Read-only `forgeloop next` decisions, stable action/reason output, persisted-state safety, and adapter guidance at lifecycle boundaries. |
19
20
  | Execution → Verification handoff | Legal `EXECUTING` → `VERIFYING` transition, implementation-step reconciliation, and preservation of verification evidence. |
20
21
  | Pre-contract autonomy — structural | Blocking vs Non-Blocking Decisions policy, classify-before-ask invariant, PRE-QUESTION CHECK, explicit ASSUMPTION / source=agent-default recording, contract-before-clarification ordering, deterministic reason-code helper, and positive/negative tests. |
@@ -101,6 +102,7 @@ are both present:
101
102
  | Security boundary | realpath containment, bounded JSON, `THREAT_MODEL.md`, secret-free artifacts, authority and no-runtime rules | `tests/security-limits.test.js`, Markdown/loop validators, and `scripts/scan_secrets.py` |
102
103
  | Cross-artifact conformance | `src/core/conformance.js`, `classifyLoadedWorkState`, and `forgeloop validate-protocol --contract-file` | `tests/conformance.test.js`, `tests/validate-protocol-cli.test.js`, and protocol fixtures covering precedence and stale evidence |
103
104
  | Protocol preparation and completion | `src/core/preflight.js`, `src/core/completion.js`, `src/core/events.js`, policy packs, and portable bundles | `tests/preflight.test.js`, `tests/completion.test.js`, `tests/lifecycle.test.js`, `tests/policy.test.js`, and `tests/bundle.test.js` |
105
+ | Structural quality feedback | `docs/STRUCTURAL_QUALITY.md`, `LOOP_ENGINEERING.md`, `src/core/structural-quality/`, quality CLI commands, lifecycle projections, and `schemas/structural-quality.schema.json` | Structural-quality policy, provider, lifecycle, Sentrux adapter, artifact, bundle, and real-provider E2E tests; local Sentrux 0.5.7 cycle-regression scenario verified |
104
106
  | Protocol activation resumability | `src/core/resumability.js`, READY consistency checks, event matrix, and `next` repair semantics | `tests/resumable-protocol.test.js` |
105
107
  | Hidden kit layout | `src/core/target-layout.js`, safe init/update migration, manifest layout version, native shims, and profile resolver | `tests/hidden-layout.test.js`, package and compatibility tests |
106
108
  | Contextual frontend taste | `ENG/taste-frontend-eng.md`, router metadata, attribution, and design/accessibility precedence | `tests/taste-guide.test.js`, route fixtures |
package/README.md CHANGED
@@ -31,11 +31,13 @@ relevant guides.
31
31
  - **Inspect a real ForgeLoop execution** → [`poc/README.md`](./poc/README.md)
32
32
  - **Full protocol specification** → [`LOOP_ENGINEERING.md`](./LOOP_ENGINEERING.md)
33
33
  - **Integrating an AI harness** → [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md)
34
+ - **Optional advisory context providers** → [`docs/ADVISORY_CONTEXT.md`](./docs/ADVISORY_CONTEXT.md)
34
35
  - **Agent bootstrap summary** → [`docs/AGENT_PROTOCOL_SUMMARY.md`](./docs/AGENT_PROTOCOL_SUMMARY.md)
35
36
  - **Continuing another harness's task** → [`docs/CROSS_HARNESS_CONTINUITY.md`](./docs/CROSS_HARNESS_CONTINUITY.md)
36
37
  - **CLI command reference** → [`docs/CLI_REFERENCE.md`](./docs/CLI_REFERENCE.md)
37
38
  - **Artifact & schema reference** → [`docs/ARTIFACT_REFERENCE.md`](./docs/ARTIFACT_REFERENCE.md)
38
39
  - **Operational recipes** → [`docs/RECIPES.md`](./docs/RECIPES.md)
40
+ - **Structural quality feedback** → [`docs/STRUCTURAL_QUALITY.md`](./docs/STRUCTURAL_QUALITY.md)
39
41
  - **Troubleshooting & error codes** → [`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md)
40
42
  - **Code attestation & revision coverage** → [`docs/CODE_ATTESTATION.md`](./docs/CODE_ATTESTATION.md)
41
43
  - **System architecture & safety** → [`LOOP_SYSTEM_DESIGN.md`](./LOOP_SYSTEM_DESIGN.md) & [`THREAT_MODEL.md`](./THREAT_MODEL.md)
@@ -70,6 +72,7 @@ changed the repository.
70
72
  | Accessibility | [`ENG/accessibility-eng.md`](./ENG/accessibility-eng.md) |
71
73
  | Web games | [`ENG/games-code-design-web-eng.md`](./ENG/games-code-design-web-eng.md) |
72
74
  | Documentation quality | [`ENG/documentation-quality-eng.md`](./ENG/documentation-quality-eng.md) |
75
+ | Structural quality feedback | [`docs/STRUCTURAL_QUALITY.md`](./docs/STRUCTURAL_QUALITY.md) |
73
76
 
74
77
  Each guide declares its name, language, version, and review date in
75
78
  frontmatter. Repository validators keep the catalog and metadata synchronized.
@@ -124,6 +127,23 @@ does not prove authorship or absolute security. See
124
127
  [`docs/CODE_ATTESTATION.md`](./docs/CODE_ATTESTATION.md) for configuration,
125
128
  read-only verification, signatures, and revision-range coverage.
126
129
 
130
+ ### Optional structural quality feedback
131
+
132
+ Projects may enable a provider-neutral structural-quality comparison. Capture
133
+ an immutable baseline before execution, verify the current cycle, and let the
134
+ configured `off`, `observe`, or `gate` mode determine whether the result is
135
+ informational or completion-required. Sentrux is an optional user-managed
136
+ sensor, not a ForgeLoop dependency or a universal software-quality score. See
137
+ [`docs/STRUCTURAL_QUALITY.md`](./docs/STRUCTURAL_QUALITY.md).
138
+
139
+ ### Optional advisory context
140
+
141
+ ForgeLoop can consume host-provided advisory context through the Integration
142
+ API. Providers are lazy and opt-in, and ForgeLoop does not persist their
143
+ results. Provider output is never lifecycle state, evidence, authority,
144
+ completion truth, or next-action authority, and it is never executable as a
145
+ protocol command. See [`docs/ADVISORY_CONTEXT.md`](./docs/ADVISORY_CONTEXT.md).
146
+
127
147
  ### Optional task boundaries and differential verification
128
148
 
129
149
  Workspace binding, immutable handoff envelopes, and responsibility contracts
@@ -220,6 +240,10 @@ authoritative. Hosts without `task/context` use balanced compatibility behavior
220
240
  and must not invent a local LIGHT heuristic. Optional context usage is
221
241
  host-reported or `UNKNOWN`; values are never estimated.
222
242
 
243
+ `protocol-info --json` advertises the optional `advisoryContextProviders` v1
244
+ capability, but advisory recall remains Integration API only. The stock CLI
245
+ does not auto-recall providers and does not expose a `context-recall` command.
246
+
223
247
  Before npm publication, the same source checkout can be exercised without a
224
248
  network or package lookup:
225
249
 
@@ -292,6 +316,33 @@ forgeloop reconcile-continuity --task example-task --json
292
316
  forgeloop next --task example-task --json
293
317
  ```
294
318
 
319
+ For an explicit immutable handoff, use the complete operational flow:
320
+
321
+ ```bash
322
+ forgeloop handoff-create --task example-task --recipient codex --json
323
+ forgeloop handoff-list --task example-task --json
324
+ forgeloop handoff-show --task example-task --id <handoff-id> --json
325
+ forgeloop handoff-accept \
326
+ --task example-task \
327
+ --handoff <handoff-id> \
328
+ --consumer-id codex-session-42 \
329
+ --harness codex \
330
+ --json
331
+ ```
332
+
333
+ Handoff projections use these statuses:
334
+
335
+ ```text
336
+ OPEN valid bound snapshot awaiting operational acceptance
337
+ ACCEPTED exactly-once operational receipt recorded
338
+ UNBOUND legacy handoff without exact work-state binding
339
+ INCONSISTENT ledger, digest, or acceptance history is not trustworthy
340
+ ```
341
+
342
+ Acceptance is `OPERATIONAL_RECEIPT_ONLY`: it transfers no claims and creates
343
+ no evidence or authority. Same-consumer retries are idempotent; a different
344
+ consumer receives a fail-closed `E_HANDOFF_ALREADY_ACCEPTED` result.
345
+
295
346
  See [`docs/CROSS_HARNESS_CONTINUITY.md`](./docs/CROSS_HARNESS_CONTINUITY.md) for full handoff and recovery procedures.
296
347
 
297
348
  ### Multi-task concurrent project state
package/TERMINOLOGY.md CHANGED
@@ -47,6 +47,18 @@
47
47
  | Attestation statement | A deterministic in-toto Statement v1 binding the code manifest to valid ForgeLoop completion evidence. |
48
48
  | Revision-range coverage | A post-completion result asking whether changed paths between two revisions are covered by valid task attestations. |
49
49
  | Generic CI | The provider-neutral range-verification boundary that thin platform adapters may invoke without adding platform trust rules to the core. |
50
+ | Advisory Context | Optional host-provided information returned for human or agent consideration; it is not canonical task state, evidence, authority, completion truth, or next-action authority. |
51
+ | Advisory Context Provider | A runtime-injected Integration API provider with a declared identity and bounded recall method; providers are lazy, opt-in, and not persisted by ForgeLoop. |
52
+ | Portable Context | Bounded text normalized for transport, with control characters, secrets, unsafe paths, and unsupported fields rejected or discarded according to the canonical boundary. |
53
+ | Handoff Acceptance | An exactly-once, ledger-backed operational receipt that records consumption of an immutable handoff without transferring claims or creating evidence or authority. |
54
+ | Consumer ID | A caller-supplied descriptive key used to make handoff acceptance idempotent; it is not an authenticated identity. |
55
+ | Acceptance Status | The derived handoff projection `OPEN`, `ACCEPTED`, `UNBOUND`, or `INCONSISTENT`; it is not a lifecycle phase. |
56
+ | Continuity Lint | Non-authoritative, non-evidence diagnostics for stale or contradictory operational resume hints. |
57
+
58
+ `consumerId` is not an authenticated identity. A `harness`, recipient hint,
59
+ session label, or transport channel is descriptive metadata, not authority.
60
+ The harness owns execution and presentation; ForgeLoop owns canonical state,
61
+ evidence relationships, and validated lifecycle decisions.
50
62
 
51
63
  | Execution continuity | Bounded current-task implementation context used to resume the same ForgeLoop task across sessions or harnesses. |
52
64
  | Continuity artifact | `.forgeloop/continuity.json`; non-evidence operational context bound to canonical work state. |