@cassiomc1/forgeloop 1.6.2 → 1.6.4

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 (127) hide show
  1. package/DOCS_INDEX.md +26 -4
  2. package/EXECUTION_STATE.md +7 -0
  3. package/LOOP_ENGINEERING.md +58 -0
  4. package/LOOP_SYSTEM_DESIGN.md +54 -0
  5. package/ORCHESTRATOR_INTEGRATION.md +23 -0
  6. package/PROTOCOL_INTEGRATION.md +36 -0
  7. package/QUALITY_SCORECARD.md +21 -0
  8. package/README.md +57 -2
  9. package/TERMINOLOGY.md +11 -0
  10. package/THREAT_MODEL.md +7 -0
  11. package/completions/_forgeloop +85 -0
  12. package/completions/forgeloop.bash +173 -0
  13. package/completions/forgeloop.fish +544 -0
  14. package/docs/AGENT_PROTOCOL_SUMMARY.md +281 -0
  15. package/docs/ARTIFACT_REFERENCE.md +226 -0
  16. package/docs/CLI_REFERENCE.md +308 -2
  17. package/docs/CODE_ATTESTATION.md +141 -0
  18. package/docs/CROSS_HARNESS_CONTINUITY.md +22 -2
  19. package/docs/DOCUMENTATION_GUIDE.md +13 -11
  20. package/docs/GETTING_STARTED.md +98 -1
  21. package/docs/MCP.md +8 -0
  22. package/docs/PLATFORM_ADAPTERS.md +69 -0
  23. package/docs/RECIPES.md +138 -0
  24. package/docs/RELEASE_CHECKLIST.md +54 -0
  25. package/docs/REVISION_PROVIDERS.md +136 -0
  26. package/docs/SIGNING_PROVIDERS.md +83 -0
  27. package/docs/TROUBLESHOOTING.md +184 -0
  28. package/docs/UNIVERSAL_INTEGRATION.md +11 -0
  29. package/docs/assets/diagrams/forgeloop-code-attestation-flow.html +13841 -0
  30. package/docs/assets/diagrams/forgeloop-code-attestation-flow.receipt.json +37 -0
  31. package/docs/assets/diagrams/forgeloop-code-attestation-flow.svg +5046 -0
  32. package/docs/assets/diagrams/forgeloop-engineering-flow.html +46 -43
  33. package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +6 -6
  34. package/docs/assets/diagrams/forgeloop-engineering-flow.svg +41 -41
  35. package/docs/assets/diagrams/forgeloop-verification-trust-flow.html +13783 -0
  36. package/docs/assets/diagrams/forgeloop-verification-trust-flow.receipt.json +37 -0
  37. package/docs/assets/diagrams/forgeloop-verification-trust-flow.svg +4988 -0
  38. package/docs/diagrams/README.md +30 -22
  39. package/docs/diagrams/forgeloop-code-attestation-flow.workflow.json +125 -0
  40. package/docs/diagrams/forgeloop-engineering-flow.workflow.json +11 -8
  41. package/docs/diagrams/forgeloop-verification-trust-flow.workflow.json +116 -0
  42. package/docs/diagrams/manifest.json +42 -0
  43. package/docs/diagrams/reviews/forgeloop-code-attestation-flow.review.json +20 -0
  44. package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +3 -3
  45. package/docs/diagrams/reviews/forgeloop-verification-trust-flow.review.json +20 -0
  46. package/integrations/generic-ci/verify.sh +14 -0
  47. package/package.json +31 -9
  48. package/schemas/attestation-verification-result.schema.json +34 -0
  49. package/schemas/code-attestation.schema.json +61 -0
  50. package/schemas/code-manifest.schema.json +57 -0
  51. package/schemas/config.schema.json +57 -1
  52. package/schemas/handoff-envelope.schema.json +57 -0
  53. package/schemas/in-toto-statement.schema.json +32 -0
  54. package/schemas/responsibility.schema.json +37 -0
  55. package/schemas/verification-scope.schema.json +26 -0
  56. package/schemas/workspace-binding.schema.json +20 -0
  57. package/scripts/CI_VALIDATORS.md +3 -0
  58. package/scripts/benchmark-cli-startup.mjs +60 -0
  59. package/scripts/check-changelog-freshness.mjs +88 -0
  60. package/scripts/check-critical-coverage.mjs +58 -0
  61. package/scripts/generate-agent-protocol-summary.mjs +141 -0
  62. package/scripts/generate-shell-completions.mjs +132 -0
  63. package/scripts/write-forgeloop-attestation-summary.mjs +93 -0
  64. package/src/cli.js +114 -6
  65. package/src/commands/attestation-create.js +30 -0
  66. package/src/commands/attestation-status.js +12 -0
  67. package/src/commands/attestation-verify-range.js +32 -0
  68. package/src/commands/attestation-verify.js +23 -0
  69. package/src/commands/handoff-create.js +9 -0
  70. package/src/commands/handoff-list.js +12 -0
  71. package/src/commands/handoff-show.js +10 -0
  72. package/src/commands/responsibility-set.js +20 -0
  73. package/src/commands/responsibility-status.js +12 -0
  74. package/src/commands/run-check.js +43 -3
  75. package/src/commands/task-repair-legacy-recovery.js +1 -2
  76. package/src/commands/verify-scope.js +9 -0
  77. package/src/commands/workspace-bind.js +17 -0
  78. package/src/commands/workspace-status.js +19 -0
  79. package/src/core/artifact-registry.js +84 -0
  80. package/src/core/attestation-coverage.js +134 -0
  81. package/src/core/attestation-verifier.js +227 -0
  82. package/src/core/attestation.js +263 -0
  83. package/src/core/audit.js +67 -1
  84. package/src/core/bundles.js +210 -9
  85. package/src/core/cli-command-definitions.js +196 -0
  86. package/src/core/code-manifest.js +293 -0
  87. package/src/core/command-executors.js +79 -0
  88. package/src/core/command-input.js +69 -18
  89. package/src/core/command-runtime.js +2 -1
  90. package/src/core/completion.js +170 -8
  91. package/src/core/config.js +60 -2
  92. package/src/core/continuity-cli-options.js +9 -3
  93. package/src/core/continuity-reconciliation.js +20 -0
  94. package/src/core/diagnostic-projection.js +3 -1
  95. package/src/core/error-codes.js +146 -0
  96. package/src/core/events.js +109 -13
  97. package/src/core/exit-codes.js +22 -0
  98. package/src/core/handoff.js +208 -0
  99. package/src/core/information-gain-projection.js +3 -3
  100. package/src/core/integration-invocation-policy.js +40 -0
  101. package/src/core/integration-resources.js +54 -0
  102. package/src/core/next-action-phases.js +968 -0
  103. package/src/core/next-action.js +32 -951
  104. package/src/core/phase.js +29 -1
  105. package/src/core/protocol-info.js +41 -1
  106. package/src/core/repository.js +256 -11
  107. package/src/core/responsibility.js +265 -0
  108. package/src/core/revision/git.js +207 -0
  109. package/src/core/revision/provider.js +90 -0
  110. package/src/core/revision/registry.js +5 -0
  111. package/src/core/route-artifact.js +1 -1
  112. package/src/core/schema-validation.js +8 -0
  113. package/src/core/signing/none.js +23 -0
  114. package/src/core/signing/provider.js +21 -0
  115. package/src/core/signing/registry.js +7 -0
  116. package/src/core/signing/sigstore.js +158 -0
  117. package/src/core/task-command.js +9 -1
  118. package/src/core/task-paths.js +72 -0
  119. package/src/core/templates.js +8 -0
  120. package/src/core/verification-scope-capability.js +179 -0
  121. package/src/core/verification-scope.js +271 -0
  122. package/src/core/workspace-binding.js +211 -0
  123. package/src/integration.d.ts +91 -0
  124. package/AGENT_COMPATIBILITY.md +0 -11
  125. package/docs/RELEASE_CHECKLIST_1_4.md +0 -38
  126. package/docs/RELEASE_CHECKLIST_1_5_MCP.md +0 -78
  127. package/docs/RELEASE_CHECKLIST_1_6_1.md +0 -121
@@ -389,7 +389,103 @@ forgeloop task-migrate --json
389
389
 
390
390
  ---
391
391
 
392
- ## 8. Next Steps
392
+ ## 8. Optional advanced capabilities
393
+
394
+ The default walkthrough above is complete without these extensions. Add them
395
+ only when the task needs an extra boundary or provenance result.
396
+
397
+ ### Workspace binding, handoff, and responsibility
398
+
399
+ For a task that must remain in one Git worktree, bind it explicitly and check
400
+ the derived status before mutation:
401
+
402
+ ```bash
403
+ forgeloop workspace-bind --task <taskId> --json
404
+ forgeloop workspace-status --task <taskId> --json
405
+ ```
406
+
407
+ Record a deterministic handoff snapshot or an optional pass constraint when
408
+ the workflow needs those boundaries:
409
+
410
+ ```bash
411
+ forgeloop handoff-create --task <taskId> --note "Continue verification" --json
412
+ forgeloop handoff-list --task <taskId> --json
413
+ forgeloop handoff-show --task <taskId> --id <handoffId> --json
414
+ forgeloop responsibility-set --task <taskId> --label implementation --allowed-path src --required-check unit-tests --json
415
+ forgeloop responsibility-status --task <taskId> --json
416
+ ```
417
+
418
+ Workspace binding, handoff, and responsibility artifacts are optional. A
419
+ binding checks the complete derived repository/worktree identity; a branch name
420
+ or HEAD alone is not enough. A handoff is immutable protocol-derived context,
421
+ not delegation or evidence. A responsibility label is descriptive, not a
422
+ coder/reviewer/cleaner role, and its allowed paths, required checks, and frozen
423
+ inputs are mechanically enforced when present.
424
+
425
+ ### Differential Verification Scope
426
+
427
+ Configure a trusted scoped checker only when it can consume canonical paths:
428
+
429
+ ```json
430
+ {
431
+ "verification": {
432
+ "checkers": [
433
+ {
434
+ "checkId": "unit-tests",
435
+ "scopeMode": "PATH_ARGUMENTS",
436
+ "argvPrefix": ["node", "--test"],
437
+ "pathInsertion": "APPEND"
438
+ }
439
+ ]
440
+ }
441
+ }
442
+ ```
443
+
444
+ Then ask ForgeLoop to resolve the scope and pass its exact paths to the
445
+ checker:
446
+
447
+ ```bash
448
+ forgeloop verify-scope --task <taskId> --mode AUTO --json
449
+ forgeloop run-check --task <taskId> --id unit-tests \
450
+ --requirement "Unit tests" \
451
+ --scope-ref .forgeloop/task-state/<taskKey>/verification-scope.json \
452
+ -- node --test <paths-returned-by-verify-scope>
453
+ ```
454
+
455
+ `AUTO` can resolve to `CHANGED` or `CLAIMED` only with a trusted scoped
456
+ checker; otherwise it resolves to `FULL`. Explicit `CHANGED` or `CLAIMED`
457
+ without that checker returns `E_VERIFICATION_SCOPE_UNRESOLVED`, and an argv
458
+ mismatch is rejected before launch. This pre-completion decision is not
459
+ revision-range attestation coverage.
460
+
461
+ ## 9. Optional code attestation
462
+
463
+ When the project enables attestation, completion captures a source-content
464
+ manifest transactionally. After completion, create and inspect the deterministic
465
+ statement:
466
+
467
+ ```bash
468
+ forgeloop attestation-create --task <taskId> --json
469
+ forgeloop attestation-status --task <taskId> --json
470
+ forgeloop attestation-verify --task <taskId> --ref HEAD --json
471
+ ```
472
+
473
+ For a revision range, use the provider-neutral coverage command:
474
+
475
+ ```bash
476
+ forgeloop attestation-verify-range \
477
+ --revision-provider git \
478
+ --base origin/main \
479
+ --head HEAD \
480
+ --require-complete-coverage \
481
+ --json
482
+ ```
483
+
484
+ Verification commands are read-only. A valid source manifest proves exact
485
+ content binding to ForgeLoop evidence; only an additional valid external
486
+ signature can raise the trust level to `ATTESTED`.
487
+
488
+ ## 10. Next Steps
393
489
 
394
490
  - Continue a task across different AI harnesses: [`docs/CROSS_HARNESS_CONTINUITY.md`](./CROSS_HARNESS_CONTINUITY.md)
395
491
  - Optional: use ForgeLoop through MCP or the Integration API — [`docs/MCP.md`](./MCP.md) and [`docs/UNIVERSAL_INTEGRATION.md`](./UNIVERSAL_INTEGRATION.md). MCP is not required; CLI and MCP share the same canonical project/task state.
@@ -397,3 +493,4 @@ forgeloop task-migrate --json
397
493
  - Artifact and schema reference: [`docs/ARTIFACT_REFERENCE.md`](./ARTIFACT_REFERENCE.md)
398
494
  - Common symptoms and recovery: [`docs/TROUBLESHOOTING.md`](./TROUBLESHOOTING.md)
399
495
  - Real-world operational recipes: [`docs/RECIPES.md`](./RECIPES.md)
496
+ - Code attestation and revision coverage: [`docs/CODE_ATTESTATION.md`](./CODE_ATTESTATION.md)
package/docs/MCP.md CHANGED
@@ -83,6 +83,14 @@ content.
83
83
  Raw recovery artifacts, transaction journals, lock files, and unbounded event
84
84
  ledgers are intentionally not exposed.
85
85
 
86
+ Optional workspace binding, handoff, responsibility, verification-scope,
87
+ RevisionProvider, SigningProvider, and attestation operations remain governed
88
+ by the same canonical command executors when exposed by a compatible host.
89
+ MCP transport metadata cannot establish workspace identity, narrow a checker,
90
+ mint signer authority, or turn continuity into evidence. Read-only attestation
91
+ and range verification preserve the core `PROCESSED`, `VERIFIED`, and
92
+ `ATTESTED` distinctions and never write verification events.
93
+
86
94
  ## Optional stateless HTTP transport
87
95
 
88
96
  `forgeloop-mcp-http` serves the same deterministic catalog over the **strict
@@ -0,0 +1,69 @@
1
+ # Platform Adapters
2
+
3
+ Platform adapters are convenience layers around the provider-neutral
4
+ ForgeLoop verifier. They translate platform context into revisions and an
5
+ optional signing policy; they do not become part of ForgeLoop protocol
6
+ semantics.
7
+
8
+ ## Generic contract
9
+
10
+ Every adapter supplies:
11
+
12
+ ```text
13
+ revisionProvider
14
+ baseRevision
15
+ headRevision
16
+ optional signingProvider and signer policy
17
+ ```
18
+
19
+ The canonical command is:
20
+
21
+ ```bash
22
+ forgeloop attestation-verify-range \
23
+ --revision-provider "$FORGELOOP_REVISION_PROVIDER" \
24
+ --base "$FORGELOOP_BASE_REVISION" \
25
+ --head "$FORGELOOP_HEAD_REVISION" \
26
+ --require-complete-coverage \
27
+ --json
28
+ ```
29
+
30
+ The repository includes a shell adapter at
31
+ [`integrations/generic-ci/verify.sh`](../integrations/generic-ci/verify.sh).
32
+ It has no hosting-platform API dependency.
33
+
34
+ Generic CI is the first-class provider-neutral boundary. A thin platform
35
+ adapter may translate a pull request, merge request, branch comparison, or
36
+ job baseline into the generic `revisionProvider`, `baseRevision`, and
37
+ `headRevision` inputs, then present the canonical result. It must not add
38
+ platform-specific trust rules to the protocol core or treat a platform status
39
+ as a ForgeLoop signature.
40
+
41
+ The adapter preserves the verifier exit contract:
42
+
43
+ ```text
44
+ 0 = VALID
45
+ 1 = INVALID, stale, uncovered, or untrusted
46
+ 2 = invocation, environment, configuration, or provider error
47
+ ```
48
+
49
+ Missing or unavailable provider state is not a pass. The platform may publish
50
+ annotations after the generic command returns, but it cannot override an
51
+ invalid result or silently convert local success into publication, merge, or
52
+ deployment evidence.
53
+
54
+ ## Mapping examples
55
+
56
+ | Platform context | Base revision | Head revision |
57
+ | --- | --- | --- |
58
+ | GitHub change request | change-request base commit | change-request head commit |
59
+ | GitLab merge request | merge-request diff base | pipeline commit |
60
+ | Local branch comparison | `origin/main` | `HEAD` |
61
+ | Enterprise CI | job-provided baseline | job-provided candidate |
62
+
63
+ Adapters may add platform presentation, annotations, or status publication
64
+ after the generic verifier returns. They must not reimplement coverage,
65
+ content, evidence, or signature rules; override an invalid result; or require a
66
+ platform API in the core package.
67
+
68
+ Optional adapter examples must pin third-party actions or images immutably.
69
+ No adapter is installed into an existing target by ordinary `init` or `update`.
package/docs/RECIPES.md CHANGED
@@ -22,6 +22,12 @@ Concise, copy-paste friendly recipes for common ForgeLoop tasks.
22
22
  14. [Executable Policy, Baseline Ratchet, and Recovery](#recipe-14--executable-policy-baseline-ratchet-and-recovery)
23
23
  15. [Release and Reacquire Claims for an Abandoned Task](#recipe-15--release-and-reacquire-claims-for-an-abandoned-task)
24
24
  16. [Execute a Durable External Action Safely](#recipe-16--execute-a-durable-external-action-safely)
25
+ 17. [Bind a Task to the Current Workspace](#recipe-17--bind-a-task-to-the-current-workspace)
26
+ 18. [Create and Inspect an Immutable Handoff](#recipe-18--create-and-inspect-an-immutable-handoff)
27
+ 19. [Apply a Responsibility Contract](#recipe-19--apply-a-responsibility-contract)
28
+ 20. [Configure Trusted Narrow Verification](#recipe-20--configure-trusted-narrow-verification)
29
+ 21. [Generate and Verify Code Attestation](#recipe-21--generate-and-verify-code-attestation)
30
+ 22. [Verify a Revision Range](#recipe-22--verify-a-revision-range)
25
31
 
26
32
  ---
27
33
 
@@ -413,6 +419,138 @@ The efficiency comparison is present only when the scenario declares a
413
419
  positive `reference.comparableSteps`; absent host token/cost/model data stays
414
420
  unknown.
415
421
 
422
+ ---
423
+
424
+ ### Recipe 17 — Bind a Task to the Current Workspace
425
+
426
+ Bind only when the task must remain in the current Git worktree. The binding is
427
+ derived by ForgeLoop; do not supply branch or HEAD identity as actor input.
428
+
429
+ ```bash
430
+ forgeloop workspace-bind --task task-001 --json
431
+ forgeloop workspace-status --task task-001 --json
432
+ ```
433
+
434
+ If the repository or worktree identity changes, `workspace-status` reports a
435
+ mismatch and bound mutation or `run-check` fails closed before launch. Rebinding
436
+ is an explicit new decision, not an automatic repair.
437
+
438
+ ---
439
+
440
+ ### Recipe 18 — Create and Inspect an Immutable Handoff
441
+
442
+ Create a protocol-derived snapshot before changing tools or sessions, then
443
+ inspect it from the receiving harness:
444
+
445
+ ```bash
446
+ forgeloop handoff-create --task task-001 \
447
+ --recipient "next harness" \
448
+ --note "Continue verification" \
449
+ --json
450
+ forgeloop handoff-list --task task-001 --json
451
+ forgeloop handoff-show --task task-001 --id <handoffId> --json
452
+ ```
453
+
454
+ The envelope is immutable and digest-bound. Its note and recipient hint are
455
+ operational context only: a handoff is not delegation, authority, independent
456
+ review evidence, or completion evidence. Use `continuity.json` for mutable
457
+ resume notes and canonical execution artifacts for proof.
458
+
459
+ ---
460
+
461
+ ### Recipe 19 — Apply a Responsibility Contract
462
+
463
+ Declare a mechanical pass boundary with allowed paths, read-only paths, and
464
+ required checks. The label is descriptive and does not create an agent role.
465
+
466
+ ```bash
467
+ forgeloop responsibility-set --task task-001 \
468
+ --label implementation \
469
+ --allowed-path src \
470
+ --read-only-path docs \
471
+ --required-check unit-tests \
472
+ --freeze-contract --freeze-route --freeze-claims \
473
+ --json
474
+ forgeloop responsibility-status --task task-001 --json
475
+ ```
476
+
477
+ Path changes, missing required checks, or drift in frozen inputs fail closed.
478
+
479
+ ---
480
+
481
+ ### Recipe 20 — Configure Trusted Narrow Verification
482
+
483
+ Declare the checker capability in `.forgeloop/config.json`:
484
+
485
+ ```json
486
+ {
487
+ "verification": {
488
+ "checkers": [
489
+ {
490
+ "checkId": "unit-tests",
491
+ "scopeMode": "PATH_ARGUMENTS",
492
+ "argvPrefix": ["node", "--test"],
493
+ "pathInsertion": "APPEND"
494
+ }
495
+ ]
496
+ }
497
+ }
498
+ ```
499
+
500
+ Resolve the scope and pass the exact returned paths to `run-check`:
501
+
502
+ ```bash
503
+ forgeloop verify-scope --task task-001 --mode AUTO --json
504
+ forgeloop run-check --task task-001 --id unit-tests \
505
+ --requirement "Unit tests" \
506
+ --scope-ref .forgeloop/task-state/<taskKey>/verification-scope.json \
507
+ -- node --test <paths-returned-by-verify-scope>
508
+ ```
509
+
510
+ `AUTO` resolves to `CHANGED` or `CLAIMED` only with a trusted scoped checker;
511
+ otherwise it resolves to `FULL`. Explicit `CHANGED` or `CLAIMED` without one
512
+ returns `E_VERIFICATION_SCOPE_UNRESOLVED`. Any prefix or selected-path
513
+ mismatch is rejected before the checker process starts.
514
+
515
+ ---
516
+
517
+ ### Recipe 21 — Generate and Verify Code Attestation
518
+
519
+ After validator-backed completion, create the deterministic in-toto statement
520
+ and verify its exact content without mutating the task:
521
+
522
+ ```bash
523
+ forgeloop complete --task task-001 --json
524
+ forgeloop attestation-create --task task-001 --json
525
+ forgeloop attestation-status --task task-001 --json
526
+ forgeloop attestation-verify --task task-001 --ref HEAD --json
527
+ ```
528
+
529
+ The result is `PROCESSED` until the applicable relationships validate,
530
+ `VERIFIED` when exact source and completion bindings validate, and `ATTESTED`
531
+ only after a valid external signature passes the configured identity and issuer
532
+ policy. No private key or token is persisted.
533
+
534
+ ---
535
+
536
+ ### Recipe 22 — Verify a Revision Range
537
+
538
+ Use the provider-neutral command locally or from Generic CI:
539
+
540
+ ```bash
541
+ forgeloop attestation-verify-range \
542
+ --revision-provider git \
543
+ --base origin/main \
544
+ --head HEAD \
545
+ --require-complete-coverage \
546
+ --json
547
+ ```
548
+
549
+ The verifier reports changed, covered, uncovered, and conflicting paths. A
550
+ coverage gap or conflicting task digest is invalid; provider or invocation
551
+ failure is an error. This post-completion range result is distinct from the
552
+ pre-completion verification scope used by one checker.
553
+
416
554
  ## Run ForgeLoop through MCP (safe mode)
417
555
 
418
556
  Start the local MCP adapter and inspect what it exposes:
@@ -0,0 +1,54 @@
1
+ # ForgeLoop Release Checklist
2
+
3
+ This is the current release checklist for `@cassiomc1/forgeloop`. It is a
4
+ preparation and verification checklist; it does not authorize publication.
5
+
6
+ ## Contract and package identity
7
+
8
+ - [ ] `package.json` and `package-lock.json` contain the same package version.
9
+ - [ ] The package metadata declares the intended SPDX license (`MIT`).
10
+ - [ ] `PROTOCOL_VERSION` and the integration API version remain compatible.
11
+ - [ ] `npm run release:identity` passes for the candidate version.
12
+ - [ ] No release tag or registry version collision exists.
13
+
14
+ ## Protocol and attestation
15
+
16
+ - [ ] `npm run dependency:policy` passes without adding runtime dependencies.
17
+ - [ ] `npm run lint` passes.
18
+ - [ ] `npm test` passes.
19
+ - [ ] `npm run coverage` passes the configured global and critical-module gates.
20
+ - [ ] `npm run docs:check`, `npm run docs:generated:check`,
21
+ `npm run docs:conformance`, and `npm run docs:examples:check` pass.
22
+ - [ ] `npm run docs:diagrams:check` and `npm run docs:diagram:inventory` pass;
23
+ every active diagram has typed source, dark-first animated HTML/SVG,
24
+ reduced-motion handling, a deterministic receipt, a text fallback, and
25
+ a current source-bound visual review.
26
+ - [ ] `npm run completions:check` and `npm run summary:check` pass.
27
+ - [ ] Workspace binding, handoff, responsibility, verification scope, revision,
28
+ manifest, statement, signature, and range-coverage tests pass.
29
+ - [ ] Required attestation mode never leaves a task durably `COMPLETE` without
30
+ its code manifest.
31
+ - [ ] Read-only attestation verification does not write task state or ledger
32
+ events.
33
+
34
+ ## Integration and cross-platform evidence
35
+
36
+ - [ ] `npm run pack:check` and `npm run pack:smoke` pass.
37
+ - [ ] `npm run mcp:test` either runs the configured MCP tests or reports the
38
+ single actionable setup prerequisite.
39
+ - [ ] `npm run mcp:pack:check` passes when MCP dependencies are available.
40
+ - [ ] Generic CI verification uses explicit provider, base, and head revisions.
41
+ - [ ] Windows full-suite evidence is green on the main branch when scheduled.
42
+ - [ ] Frozen Python 3.9+ validators pass with `python3 -m unittest discover -s tests`.
43
+ - [ ] Secret scanning and Markdown validation pass.
44
+
45
+ ## Publication boundary
46
+
47
+ - [ ] The exact validated commit is the release source.
48
+ - [ ] GitHub Actions remain immutably pinned and use least-privilege permissions.
49
+ - [ ] The npm workflow retains trusted OIDC publishing and explicit provenance.
50
+ - [ ] Publication is performed only by the authorized release workflow.
51
+ - [ ] Post-publication registry, tag, checksum, and release identity checks pass.
52
+
53
+ Local package creation, a successful validation run, or a signed ForgeLoop
54
+ attestation does not by itself prove npm publication or production deployment.
@@ -0,0 +1,136 @@
1
+ # Revision Providers
2
+
3
+ Revision providers supply the exact source snapshot used by ForgeLoop code
4
+ manifests and revision-range coverage. The interface is source-control-host
5
+ neutral; Git is the first implementation.
6
+
7
+ ## Contract
8
+
9
+ A provider must expose these methods:
10
+
11
+ ```js
12
+ {
13
+ detect(target),
14
+ getCurrentRevision(target),
15
+ getChangedEntries({ target, baseRevision, headRevision, paths }),
16
+ readContent({ target, revision, path }),
17
+ getContentIdentity({ target, revision, path }),
18
+ getRepositoryIdentity(target)
19
+ }
20
+ ```
21
+
22
+ Changed entries use normalized forward-slash paths and carry an operation,
23
+ content kind, optional raw bytes, an optional provider content identity, and
24
+ provider metadata. Provider revision identifiers are opaque to ForgeLoop.
25
+
26
+ ## Git provider
27
+
28
+ The built-in `git` provider handles:
29
+
30
+ - worktree, commit, index, and opaque revision reads;
31
+ - exact raw bytes for files and symlink targets;
32
+ - deletion, rename, copy, type-change, and Gitlink entries;
33
+ - Git object identity when it is available;
34
+ - literal path arguments through `execFile`, without shell interpolation.
35
+
36
+ Select it explicitly in a range check:
37
+
38
+ ```bash
39
+ forgeloop attestation-verify-range \
40
+ --revision-provider git \
41
+ --base origin/main \
42
+ --head HEAD \
43
+ --require-complete-coverage
44
+ ```
45
+
46
+ Git metadata is an implementation detail of this provider. The attestation
47
+ core does not import Git helpers and can accept a future snapshot or
48
+ content-addressable provider without changing the statement schema.
49
+
50
+ ## Differential Verification Scope
51
+
52
+ The provider boundary has two consumers with different semantics:
53
+
54
+ 1. Differential Verification uses current changed entries or effective task
55
+ claims to decide which paths one checker may execute before completion.
56
+ 2. Attestation and revision-range coverage use exact content and valid task
57
+ attestations to decide whether changed paths across a revision range are
58
+ covered after completion.
59
+
60
+ A shared `RevisionProvider` does not make these questions interchangeable.
61
+ Verification scope is an execution-safety boundary; attestation coverage is a
62
+ provenance-coverage result. `CHANGED` or `CLAIMED` never means complete range
63
+ coverage.
64
+
65
+ ### Trusted scoped checker
66
+
67
+ Differential verification uses the same provider boundary as attestation. A
68
+ project may opt into a narrow checker by declaring a schema-validated,
69
+ deterministic descriptor in `.forgeloop/config.json`:
70
+
71
+ ```json
72
+ {
73
+ "schemaVersion": 1,
74
+ "protocolVersion": 1,
75
+ "complianceMode": "standard",
76
+ "verification": {
77
+ "checkers": [
78
+ {
79
+ "checkId": "unit-tests",
80
+ "scopeMode": "PATH_ARGUMENTS",
81
+ "argvPrefix": ["node", "--test"],
82
+ "pathInsertion": "APPEND"
83
+ }
84
+ ]
85
+ }
86
+ }
87
+ ```
88
+
89
+ With this descriptor, `AUTO` may resolve to `CHANGED` or `CLAIMED`. The
90
+ corresponding `run-check` invocation must contain the exact prefix followed by
91
+ the selected canonical paths:
92
+
93
+ ```bash
94
+ forgeloop verify-scope --task task-001 --mode CHANGED
95
+ forgeloop run-check --task task-001 --id unit-tests \
96
+ --requirement "unit tests" \
97
+ --scope-ref .forgeloop/task-state/<task-key>/verification-scope.json \
98
+ -- node --test src/example.js
99
+ ```
100
+
101
+ Without a trusted descriptor, `AUTO` resolves to `FULL`; explicit `CHANGED`
102
+ and `CLAIMED` requests fail closed. A mismatched scoped argv is rejected
103
+ before the checker process starts, and successful binding records the scope
104
+ and capability fingerprints with the execution evidence.
105
+
106
+ The [Verification Trust Flow](./assets/diagrams/forgeloop-verification-trust-flow.html)
107
+ explorer and its [animated SVG fallback](./assets/diagrams/forgeloop-verification-trust-flow.svg)
108
+ show the claims, provider changes, checker capability, fingerprints, exact
109
+ argv, and observed evidence boundary. If no trusted checker exists, `AUTO`
110
+ falls back to `FULL`; an explicit `CHANGED` or `CLAIMED` request returns
111
+ `E_VERIFICATION_SCOPE_UNRESOLVED` rather than guessing.
112
+
113
+ The canonical source is `docs/diagrams/forgeloop-verification-trust-flow.workflow.json`.
114
+
115
+ ## Error boundary
116
+
117
+ Providers must expose stable ForgeLoop errors rather than requiring callers to
118
+ parse command output:
119
+
120
+ | Code | Meaning |
121
+ | --- | --- |
122
+ | `E_REVISION_PROVIDER_UNAVAILABLE` | No selected provider can service the target. |
123
+ | `E_REVISION_PROVIDER_AMBIGUOUS` | Automatic detection found multiple providers. |
124
+ | `E_REVISION_PROVIDER_INVALID` | Provider output or contract is malformed. |
125
+ | `E_REVISION_NOT_FOUND` | The requested revision cannot be resolved. |
126
+ | `E_REVISION_CONTENT_UNAVAILABLE` | The requested path content cannot be read. |
127
+
128
+ Providers must reject unsafe or reserved paths, preserve deletion semantics,
129
+ and distinguish a missing content path from an unavailable provider. Unknown
130
+ provider semantics fail closed.
131
+
132
+ ## Conformance expectations
133
+
134
+ An implementation should be tested for deterministic identity, exact bytes,
135
+ binary and empty files, Unicode and space-containing paths, symlinks,
136
+ Gitlinks, deletions, renames, path traversal, and stable error mapping.
@@ -0,0 +1,83 @@
1
+ # Signing Providers
2
+
3
+ Signing providers are external authorities for ForgeLoop attestation
4
+ signatures. They are separate from the provider-neutral attestation predicate
5
+ and revision model.
6
+
7
+ ## Contract
8
+
9
+ ```js
10
+ {
11
+ detect(),
12
+ sign({ target, statementPath, outputPath, bundlePath }),
13
+ verify({ target, statementPath, bundlePath, policy })
14
+ }
15
+ ```
16
+
17
+ The `none` provider is always available and yields `VERIFIED` at most. The
18
+ optional `sigstore` provider can produce `ATTESTED` after successful Cosign
19
+ verification under an exact signer policy.
20
+
21
+ Signing is optional and never part of the basic completion path. When an
22
+ external signer is unavailable, times out, exits nonzero, or returns output
23
+ over the configured bound, the result stays `VERIFIED` only when the unsigned
24
+ attestation itself validates; a policy that requires a signature returns an
25
+ unavailable or invalid result and never upgrades trust. A manifest, receipt,
26
+ npm provenance signal, or platform status is not a signature.
27
+
28
+ ## Sigstore boundary
29
+
30
+ ForgeLoop delegates signing and verification to a locally available
31
+ Cosign-compatible executable. The provider:
32
+
33
+ - uses explicit argument arrays and no shell;
34
+ - applies a bounded timeout and output limit;
35
+ - never logs standard error as a persisted artifact;
36
+ - accepts an optional trusted-root path;
37
+ - keeps identity and issuer policy outside the signed predicate;
38
+ - returns stable unavailable, invalid, identity, and issuer error codes.
39
+
40
+ The provider must use bounded stdout/stderr capture and an explicit timeout.
41
+ Those limits protect the adapter boundary; they do not make the external
42
+ signer trustworthy by themselves. Credentials remain in the host environment
43
+ or signer configuration and never enter a ForgeLoop artifact, statement, or
44
+ receipt.
45
+
46
+ Example external signing command:
47
+
48
+ ```bash
49
+ cosign attest-blob \
50
+ --statement .forgeloop/task-state/<taskKey>/attestations/statement.json \
51
+ --bundle .forgeloop/task-state/<taskKey>/attestations/statement.sigstore.json \
52
+ --yes
53
+ ```
54
+
55
+ ForgeLoop never stores the private key, OIDC token, access token, or signing
56
+ credential. A bundle file is not trusted merely because it exists.
57
+
58
+ ## Policy
59
+
60
+ ```json
61
+ {
62
+ "provider": "sigstore",
63
+ "required": true,
64
+ "policy": {
65
+ "issuer": "https://token.actions.githubusercontent.com",
66
+ "identities": ["https://github.com/example/project/.github/workflows/attest.yml@refs/heads/main"],
67
+ "requireTransparencyLog": true
68
+ }
69
+ }
70
+ ```
71
+
72
+ Exact identity and issuer policy is required for `ATTESTED`. Broad regular
73
+ expressions and inferred trust are not accepted. Signature verification is
74
+ optional in ordinary local audit; a consumer can require it in range
75
+ verification with `--require-signature`.
76
+
77
+ ## Extension rules
78
+
79
+ KMS, HSM, enterprise PKI, and other implementations may be registered without
80
+ changing `statement.json`. They must not redefine ForgeLoop evidence binding,
81
+ revision coverage, trust levels, or CLI result semantics. Provider conformance
82
+ tests must cover unavailable tools, nonzero exits, invalid signatures, policy
83
+ mismatches, timeouts, and bounded output.