project-loop-harness 0.2.4__tar.gz → 0.3.0__tar.gz

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 (290) hide show
  1. {project_loop_harness-0.2.4/src/project_loop_harness.egg-info → project_loop_harness-0.3.0}/PKG-INFO +1 -1
  2. project_loop_harness-0.3.0/agent-tasks/0108-target-bound-code-context-receipts.md +152 -0
  3. project_loop_harness-0.3.0/agent-tasks/0113-evidence-links-table.md +118 -0
  4. project_loop_harness-0.3.0/agent-tasks/0114-source-hash-drift.md +78 -0
  5. project_loop_harness-0.3.0/agent-tasks/0115-context-pack-contract-fixtures.md +72 -0
  6. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/README.md +9 -2
  7. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/code-context.md +44 -6
  8. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/context-pack.md +40 -18
  9. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/growth-plan-v0.2.4-v0.5.md +43 -1
  10. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/release-notes/v0.2.4.md +12 -2
  11. project_loop_harness-0.3.0/docs/release-notes/v0.3.0.md +77 -0
  12. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/pyproject.toml +1 -1
  13. project_loop_harness-0.3.0/src/pcl/__init__.py +1 -0
  14. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/cli.py +21 -0
  15. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/impact.py +94 -1
  16. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/receipts.py +40 -2
  17. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/context.py +188 -16
  18. project_loop_harness-0.3.0/src/pcl/db/migrations/007_evidence_links.sql +19 -0
  19. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/db.py +1 -1
  20. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/evidence.py +86 -1
  21. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/validators.py +46 -1
  22. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0/src/project_loop_harness.egg-info}/PKG-INFO +1 -1
  23. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/project_loop_harness.egg-info/SOURCES.txt +7 -0
  24. project_loop_harness-0.3.0/tests/fixtures/context_pack_code_context_contract_v0.json +334 -0
  25. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_cli_init.py +7 -4
  26. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_code_index.py +187 -1
  27. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_context.py +462 -15
  28. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_evidence_add.py +120 -0
  29. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_migrations.py +179 -50
  30. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_validation.py +76 -0
  31. project_loop_harness-0.2.4/src/pcl/__init__.py +0 -1
  32. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/LICENSE +0 -0
  33. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/MANIFEST.in +0 -0
  34. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/Makefile +0 -0
  35. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/README.md +0 -0
  36. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0001-hardening-cli.md +0 -0
  37. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0002-db-migrations.md +0 -0
  38. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0003-workflow-runner.md +0 -0
  39. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0004-dashboard-renderer.md +0 -0
  40. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0005-agent-integration.md +0 -0
  41. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0006-codex-plugin.md +0 -0
  42. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0007-mcp-server.md +0 -0
  43. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0008-loop-lifecycle.md +0 -0
  44. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0009-defect-lifecycle.md +0 -0
  45. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0010-reporting-evidence.md +0 -0
  46. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0011-validation-invariants.md +0 -0
  47. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0012-audit-log-integrity.md +0 -0
  48. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0013-validation-diagnostics.md +0 -0
  49. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0014-escalation-lifecycle.md +0 -0
  50. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0015-decision-lifecycle.md +0 -0
  51. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0016-escalation-decision-linkage.md +0 -0
  52. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0017-next-action-guided-loop.md +0 -0
  53. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0018-readme-golden-path.md +0 -0
  54. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0019-recovery-playbook.md +0 -0
  55. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0020-example-project-refresh.md +0 -0
  56. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0021-agent-adapter-contract.md +0 -0
  57. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0022-agent-output-validation.md +0 -0
  58. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0023-codex-exec-adapter-hardening.md +0 -0
  59. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0024-claude-manual-adapter-hardening.md +0 -0
  60. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0025-generic-shell-adapter.md +0 -0
  61. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0026-agent-job-evidence-ingestion.md +0 -0
  62. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0027-dashboard-data-contract.md +0 -0
  63. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0028-dashboard-evidence-navigation.md +0 -0
  64. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0029-dashboard-risk-and-blockers.md +0 -0
  65. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0030-distribution-readiness.md +0 -0
  66. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0031-workflow-proposal-mode.md +0 -0
  67. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0032-workflow-proposal-review.md +0 -0
  68. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0033-workflow-verifier.md +0 -0
  69. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0034-limited-execution-sandbox.md +0 -0
  70. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0035-automatic-workflow-executor.md +0 -0
  71. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0036-executor-dogfood-workflow.md +0 -0
  72. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0037-executor-retry-resume.md +0 -0
  73. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0038-story-test-lifecycle.md +0 -0
  74. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0039-workflow-yaml-rule-expressions.md +0 -0
  75. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0040-test-case-evidence-validation.md +0 -0
  76. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0041-feature-inspection-commands.md +0 -0
  77. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0042-report-coverage-context.md +0 -0
  78. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0043-feature-report.md +0 -0
  79. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0044-complete-csv-export.md +0 -0
  80. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0045-filtered-job-inspection.md +0 -0
  81. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0046-feature-status-lifecycle.md +0 -0
  82. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0047-feature-coverage-next-action.md +0 -0
  83. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0048-migration-status-command.md +0 -0
  84. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0049-render-json-artifact-paths.md +0 -0
  85. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0050-codex-plugin-package-inventory.md +0 -0
  86. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0051-mcp-render-artifact-paths.md +0 -0
  87. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0052-lifecycle-failure-job-cleanup.md +0 -0
  88. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0053-prompt-job-json-handoff.md +0 -0
  89. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0054-human-queue-linkage-cli.md +0 -0
  90. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0055-workflow-proposal-list-filter.md +0 -0
  91. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0056-sandbox-noop-execution-guard.md +0 -0
  92. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0057-executor-no-executable-step-guard.md +0 -0
  93. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0058-dogfood-usability-hardening.md +0 -0
  94. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0059-checkpoint-review-guidance.md +0 -0
  95. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0060-pypi-trusted-publishing.md +0 -0
  96. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0061-context-pack-v1.md +0 -0
  97. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0062-task-backlog-entity.md +0 -0
  98. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0063-structured-verification-rubric.md +0 -0
  99. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0064-task-loop-integration.md +0 -0
  100. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0065-dashboard-human-decisions.md +0 -0
  101. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0066-agent-registry-lease.md +0 -0
  102. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0067-context-pack-improvements.md +0 -0
  103. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0068-trust-hardening.md +0 -0
  104. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0069-explainable-code-context-v0.md +0 -0
  105. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0070-human-decision-cockpit.md +0 -0
  106. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0071-dogfood-impact-precision.md +0 -0
  107. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0072-sensitive-omission.md +0 -0
  108. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0073-code-context-module-split.md +0 -0
  109. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0074-search-snapshot-consistency.md +0 -0
  110. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0075-diff-source-modes.md +0 -0
  111. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0076-schema-version-integrity.md +0 -0
  112. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0077-index-output-budget-and-impact-noise.md +0 -0
  113. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0078-context-pack-code-context-bridge.md +0 -0
  114. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0079-receipt-human-summary.md +0 -0
  115. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0080-retrieval-eval-gate.md +0 -0
  116. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0081-diff-modes-completion.md +0 -0
  117. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0082-receipt-relevance-and-age.md +0 -0
  118. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0083-required-section-invariant.md +0 -0
  119. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0084-source-commands-honesty.md +0 -0
  120. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0085-distribution-source-completeness.md +0 -0
  121. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0086-command-surface-alignment.md +0 -0
  122. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0087-verification-suggestion-ids.md +0 -0
  123. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0088-verification-feedback.md +0 -0
  124. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0089-dogfood-fixture-propose.md +0 -0
  125. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0090-eval-baseline-record-compare.md +0 -0
  126. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0091-refresh-command-scope-fidelity.md +0 -0
  127. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0092-idempotent-status-transitions.md +0 -0
  128. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0093-evidence-add-command.md +0 -0
  129. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0094-job-completion-evidence.md +0 -0
  130. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0095-supporting-evidence-health.md +0 -0
  131. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0096-evidence-add-path-guards.md +0 -0
  132. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0097-evidence-durability-design.md +0 -0
  133. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0098-field-feedback-next-weight-and-run-report-scope.md +0 -0
  134. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0099-evidence-copy-mode.md +0 -0
  135. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0100-evidence-task-linking.md +0 -0
  136. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0101-evidence-id-allocation-race.md +0 -0
  137. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0102-source-drift-health-warning.md +0 -0
  138. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0103-security-policy-v02x.md +0 -0
  139. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0104-python-ci-matrix.md +0 -0
  140. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0105-evidence-copy-observability.md +0 -0
  141. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0106-release-checklist.md +0 -0
  142. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/agent-tasks/0107-agent-tasks-backlog-index.md +0 -0
  143. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/adoption-guide.md +0 -0
  144. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/adr/0001-hybrid-state.md +0 -0
  145. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/adr/0002-cli-is-the-runtime.md +0 -0
  146. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/adr/0003-static-workflows-before-dynamic-workflows.md +0 -0
  147. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/agent-adapter-contract.md +0 -0
  148. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/agent-output-template.md +0 -0
  149. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/agent-roles.md +0 -0
  150. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/architecture.md +0 -0
  151. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/dashboard-data-contract.md +0 -0
  152. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/dashboard-design.md +0 -0
  153. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/data-model.md +0 -0
  154. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/distribution.md +0 -0
  155. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/evidence-durability-design.md +0 -0
  156. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/evidence-entry-paths-design.md +0 -0
  157. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/feedback/2026-07-06-ax1-moc1-agent-feedback.md +0 -0
  158. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/golden-path.md +0 -0
  159. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/implementation-plan.md +0 -0
  160. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/master-trace-handoff.md +0 -0
  161. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/plh_v0_1_11_review_agenda.md +0 -0
  162. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/plh_v0_1_12_review_agenda.md +0 -0
  163. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/pypi-publishing.md +0 -0
  164. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/recovery-playbook.md +0 -0
  165. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/release-checklist.md +0 -0
  166. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/safety-permissions.md +0 -0
  167. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/v0.2.0-plan.md +0 -0
  168. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/verification-feedback-design.md +0 -0
  169. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/verification-feedback.md +0 -0
  170. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/verification-rubric.md +0 -0
  171. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/docs/workflow-contract.md +0 -0
  172. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/scripts/run_advisory_retrieval_eval.py +0 -0
  173. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/scripts/verify_sdist_contracts.py +0 -0
  174. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/setup.cfg +0 -0
  175. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/__main__.py +0 -0
  176. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/agents.py +0 -0
  177. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/checkpoints.py +0 -0
  178. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/__init__.py +0 -0
  179. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/diff.py +0 -0
  180. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/eval.py +0 -0
  181. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/scan.py +0 -0
  182. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/search.py +0 -0
  183. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/store.py +0 -0
  184. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/summary.py +0 -0
  185. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/symbols.py +0 -0
  186. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_context/test_hints.py +0 -0
  187. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/code_index.py +0 -0
  188. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/commands.py +0 -0
  189. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/db/migrations/001_initial.sql +0 -0
  190. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/db/migrations/002_tasks.sql +0 -0
  191. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/db/migrations/003_agent_registry.sql +0 -0
  192. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/db/migrations/004_code_index.sql +0 -0
  193. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/db/migrations/005_verification_feedback.sql +0 -0
  194. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/db/migrations/006_evidence_task_link.sql +0 -0
  195. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/db/schema.sql +0 -0
  196. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/decisions.py +0 -0
  197. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/dispatch.py +0 -0
  198. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/errors.py +0 -0
  199. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/escalations.py +0 -0
  200. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/events.py +0 -0
  201. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/exporters.py +0 -0
  202. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/guards.py +0 -0
  203. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/ids.py +0 -0
  204. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/init_project.py +0 -0
  205. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/lifecycle.py +0 -0
  206. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/links.py +0 -0
  207. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/locales.py +0 -0
  208. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/mcp_server.py +0 -0
  209. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/migrations.py +0 -0
  210. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/paths.py +0 -0
  211. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/receipt_show.py +0 -0
  212. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/registry.py +0 -0
  213. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/renderer.py +0 -0
  214. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/reports.py +0 -0
  215. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/resources.py +0 -0
  216. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/rubric.py +0 -0
  217. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/stories.py +0 -0
  218. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/tasks.py +0 -0
  219. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/dashboard/dashboard.html +0 -0
  220. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/project/AGENTS.block.md +0 -0
  221. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/project/CLAUDE.block.md +0 -0
  222. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/project/gitignore.fragment +0 -0
  223. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/project/pcl.yaml +0 -0
  224. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/skills/project-control-loop/SKILL.md +0 -0
  225. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/workflows/defect_repair.yaml +0 -0
  226. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/workflows/executor_smoke.yaml +0 -0
  227. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/workflows/feature_coverage.yaml +0 -0
  228. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/templates/workflows/regression_loop.yaml +0 -0
  229. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/timeutil.py +0 -0
  230. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/token_estimation.py +0 -0
  231. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/update_check.py +0 -0
  232. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/verification_feedback.py +0 -0
  233. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/verifications.py +0 -0
  234. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/workflow_executor.py +0 -0
  235. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/workflow_proposal_validation.py +0 -0
  236. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/workflow_proposals.py +0 -0
  237. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/workflow_sandbox.py +0 -0
  238. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/workflow_verifier.py +0 -0
  239. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/workflow_yaml.py +0 -0
  240. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/pcl/workflows.py +0 -0
  241. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/project_loop_harness.egg-info/dependency_links.txt +0 -0
  242. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/project_loop_harness.egg-info/entry_points.txt +0 -0
  243. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/project_loop_harness.egg-info/requires.txt +0 -0
  244. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/src/project_loop_harness.egg-info/top_level.txt +0 -0
  245. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/fixtures/code_context_summary_v0.json +0 -0
  246. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/fixtures/context_receipt_v0.json +0 -0
  247. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/fixtures/context_receipt_v0_legacy_string_suggestions.json +0 -0
  248. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/fixtures/retrieval_adversarial_v0.json +0 -0
  249. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/fixtures/retrieval_real_history_v0.json +0 -0
  250. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/fixtures/retrieval_v0.json +0 -0
  251. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_advisory_retrieval_eval_script.py +0 -0
  252. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_agent_adapter_contract.py +0 -0
  253. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_agent_output_validation.py +0 -0
  254. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_agents.py +0 -0
  255. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_audit_log_integrity.py +0 -0
  256. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_checkpoints.py +0 -0
  257. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_claude_manual_adapter.py +0 -0
  258. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_code_context_summary.py +0 -0
  259. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_codex_exec_adapter.py +0 -0
  260. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_codex_plugin.py +0 -0
  261. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_dashboard.py +0 -0
  262. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_dashboard_data_contract.py +0 -0
  263. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_decisions.py +0 -0
  264. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_defects.py +0 -0
  265. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_dispatch.py +0 -0
  266. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_distribution.py +0 -0
  267. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_escalations.py +0 -0
  268. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_examples.py +0 -0
  269. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_features.py +0 -0
  270. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_generic_shell_adapter.py +0 -0
  271. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_golden_path.py +0 -0
  272. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_lifecycle.py +0 -0
  273. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_mcp_server.py +0 -0
  274. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_next_actions.py +0 -0
  275. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_pypi_publishing.py +0 -0
  276. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_receipt_show.py +0 -0
  277. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_recovery_playbook.py +0 -0
  278. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_registry.py +0 -0
  279. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_reports.py +0 -0
  280. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_rubric.py +0 -0
  281. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_stories.py +0 -0
  282. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_tasks.py +0 -0
  283. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_update_check.py +0 -0
  284. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_validation_diagnostics.py +0 -0
  285. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_verification_feedback.py +0 -0
  286. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_workflow_executor.py +0 -0
  287. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_workflow_proposals.py +0 -0
  288. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_workflow_sandbox.py +0 -0
  289. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_workflow_verifier.py +0 -0
  290. {project_loop_harness-0.2.4 → project_loop_harness-0.3.0}/tests/test_workflows.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: project-loop-harness
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
4
  Summary: Local control plane for agentic project development loops
5
5
  Author: Project Loop Harness Contributors
6
6
  License: MIT
@@ -0,0 +1,152 @@
1
+ # 0108: Target-bound code context receipts
2
+
3
+ Milestone: v0.3.0 Target-Bound Context
4
+ Priority: P1
5
+ Area: code-context/context-pack
6
+ Origin: docs/growth-plan-v0.2.4-v0.5.md v0.3.0; docs/project-loop-harness-v0.2.3-third-party-review.md P2-3
7
+ Depends on: 0113 (evidence_links table, migration 007) — merge first.
8
+
9
+ > **Revision 2026-07-08 (坂本承認):** the original no-migration invariant is
10
+ > **retracted**. Target binding is now persisted as a queryable `evidence_links`
11
+ > row (`link_role="code_context"`, from 0113) **and** embedded in the receipt
12
+ > artifact; receipt selection is a SQL query, not an artifact scan. This unblocks
13
+ > `pcl context check` (v0.3.1) and v0.4 `bound_receipt_coverage` without a second
14
+ > migration later.
15
+
16
+ ## Problem
17
+
18
+ `pcl context pack --include-code-context` currently reads the latest
19
+ `context_receipt` evidence row. The pack tells the reader that this is
20
+ `scope: "unscoped_latest"` with `binding_strength: "none"`, which is honest,
21
+ but it still risks handing a worker a receipt from an unrelated task or job.
22
+
23
+ The existing docs reserve `scope: "target_bound"` and
24
+ `binding_strength: "caller_asserted"`, but there is no command path that
25
+ creates or requires such a receipt. v0.3.0 turns that reserved contract into a
26
+ narrow, explicit handoff workflow, backed by queryable link state.
27
+
28
+ ## Scope
29
+
30
+ 1. Extend `pcl impact --diff` with explicit target flags:
31
+ - `--for-task T-XXXX`
32
+ - `--for-job J-XXXX`
33
+ Exactly zero or one target flag is allowed. Existing diff mode flags
34
+ (`--base`, `--staged`, `--unstaged`, `--include-untracked`,
35
+ `--all-changes`, and provided diff input) keep their current semantics.
36
+ 2. Validate the named target before writing a receipt. Missing or malformed
37
+ target IDs must fail with a typed error and must not create evidence or an
38
+ `evidence_links` row.
39
+ 3. When a target flag is present, record the binding in **two** places, in the
40
+ same transaction that writes the receipt evidence:
41
+ - An `evidence_links` row (0113 helper): `(evidence_id=<receipt>,
42
+ target_type, target_id, link_role="code_context", created_at)`, where
43
+ `target_type` is `task` or `agent_job`.
44
+ - Target binding metadata inside the `impact/v0` response and the
45
+ `context-receipt/v0` artifact so the receipt is self-describing:
46
+ ```json
47
+ {
48
+ "target_binding": {
49
+ "target_type": "task",
50
+ "target_id": "T-0001",
51
+ "binding_strength": "caller_asserted",
52
+ "source": "impact_flag"
53
+ }
54
+ }
55
+ ```
56
+ For job targets, use `target_type: "agent_job"`. The link row and the
57
+ artifact `target_binding` must agree.
58
+ 4. Update context-pack receipt selection when `--include-code-context` is used.
59
+ Selection is a **query on `evidence_links`** (0113 helper), not an artifact
60
+ scan:
61
+ - For a task pack, prefer the newest receipt evidence with a matching
62
+ `evidence_links` row `(target_type="task", target_id=<task>,
63
+ link_role="code_context")`.
64
+ - For a job pack, prefer the newest matching
65
+ `(target_type="agent_job", target_id=<job>, link_role="code_context")`.
66
+ - If no matching bound receipt exists, preserve the current unscoped latest
67
+ fallback unless the caller requires a bound receipt.
68
+ 5. Add `pcl context pack --require-bound-receipt`, valid only with
69
+ `--include-code-context`. When no matching bound receipt exists, fail with a
70
+ typed error `context_pack_bound_receipt_required` and include a
71
+ target-specific refresh suggestion:
72
+ - `pcl impact --diff --for-task T-XXXX --json`
73
+ - `pcl impact --diff --for-job J-XXXX --json`
74
+ 6. Update `code_context.relevance` in the embedded summary:
75
+ - Matching bound receipt: `scope: "target_bound"`,
76
+ `binding_strength: "caller_asserted"`, plus `target_type` and
77
+ `target_id`.
78
+ - Unbound fallback: keep `scope: "unscoped_latest"` and
79
+ `binding_strength: "none"` with an explicit warning.
80
+ - Missing receipt: keep `scope: "missing_receipt"` and
81
+ `binding_strength: "none"`.
82
+ 7. Update docs and CLI help for `docs/code-context.md`,
83
+ `docs/context-pack.md`, and relevant tests.
84
+
85
+ ## Invariants (what to protect, on the normal paths)
86
+
87
+ - Binding is recorded in lockstep: when a target flag is given, the receipt
88
+ evidence row, its `evidence_links` `code_context` row, and the artifact
89
+ `target_binding` are written in one transaction and must agree. Never write
90
+ the link row without the receipt, or an artifact `target_binding` without the
91
+ link row.
92
+ - Binding is a **caller assertion**, not PLH proof that the receipt is
93
+ semantically relevant. Use claims-not-facts vocabulary; do not add fields such
94
+ as `safe_to_continue`, `verified_relevant`, or `agent_read`.
95
+ - Extend `impact/v0`, `context-receipt/v0`, and `context-pack/v1` **additively**
96
+ via the `code-context-summary/v0` insulation layer (0078). The pack embeds the
97
+ summary and `receipt_ref` (evidence_id / receipt_path) only — never the full
98
+ receipt body or copied evidence contents.
99
+ - `pcl context pack` remains read-only: it must not run `pcl index build`,
100
+ `pcl impact`, Git commands, tests, or any artifact-generating command. It
101
+ reads `evidence_links` and evidence rows only.
102
+ - `source_commands` remain read-only re-fetch commands. Artifact-generating
103
+ commands (`pcl impact …`) appear only under `suggested_refresh_commands`.
104
+ - Existing unscoped latest behavior remains available when
105
+ `--require-bound-receipt` is absent.
106
+ - Deterministic generated artifacts stay deterministic; timestamped facts remain
107
+ in receipt/evidence payloads where timestamps already exist.
108
+
109
+ ## Non-scope
110
+
111
+ - Semantic or embedding-based relevance proof.
112
+ - Automatic target inference from changed files, branches, or task text.
113
+ - `pcl context pack --receipt ...` manual receipt selection.
114
+ - `pcl receipt list` / `pcl evidence link` CLI verbs.
115
+ - Dashboard redesign or MCP surface changes.
116
+ - Hosted code analysis, cloud sync, telemetry, or external LLM calls.
117
+ - `pcl context check` preflight (deferred to v0.3.1).
118
+
119
+ ## Acceptance
120
+
121
+ - `pcl impact --diff --for-task T-0001 --json` writes a receipt with
122
+ `target_binding.target_type == "task"` and `target_id == "T-0001"`, and an
123
+ `evidence_links` row `(target_type="task", target_id="T-0001",
124
+ link_role="code_context")`.
125
+ - `pcl impact --diff --for-job J-0001 --json` writes a receipt with
126
+ `target_binding.target_type == "agent_job"` and `target_id == "J-0001"`, and
127
+ the matching `code_context` link row.
128
+ - Invalid target IDs and mutually exclusive target flags fail with typed errors
129
+ before any evidence or link row is created.
130
+ - `pcl context pack --task T-0001 --include-code-context --json` chooses the
131
+ newest matching task-bound receipt over a newer unbound receipt, via the
132
+ `evidence_links` query.
133
+ - `pcl context pack --job J-0001 --include-code-context --json` chooses the
134
+ newest matching job-bound receipt over a newer unbound receipt.
135
+ - Without a matching bound receipt and without `--require-bound-receipt`,
136
+ context pack still succeeds with the existing unscoped latest warning and a
137
+ target-specific suggested refresh command.
138
+ - With `--require-bound-receipt` and no matching bound receipt, context pack
139
+ fails with `context_pack_bound_receipt_required` and does not silently fall
140
+ back to unscoped latest.
141
+ - `source_commands` for code-context packs still contain only read-only
142
+ commands; `pcl impact` appears only under `suggested_refresh_commands`.
143
+ - Full `pytest` green.
144
+ - Live smoke in a scratch project:
145
+ 1. `pcl init`
146
+ 2. create a goal and task
147
+ 3. `pcl index build --json`
148
+ 4. make a small tracked change
149
+ 5. `pcl impact --diff --for-task T-0001 --json`
150
+ 6. `pcl context pack --task T-0001 --include-code-context --require-bound-receipt --json`
151
+ 7. `pcl validate --strict --json`
152
+ 8. `pcl render --json`
@@ -0,0 +1,118 @@
1
+ # 0113: Generic evidence links table (migration 007)
2
+
3
+ Milestone: v0.3.0 Target-Bound Context
4
+ Priority: P1
5
+ Area: schema/evidence
6
+ Origin: docs/growth-plan-v0.2.4-v0.5.md v0.3.0; third-party review 議題1 — migration
7
+ approved and 0108 no-migration invariant retracted (Sakamoto approved 2026-07-08).
8
+
9
+ ## Problem
10
+
11
+ Evidence-to-target linkage is currently a single `evidence.linked_task_id`
12
+ column (migration 006), which can only express "supporting evidence for a
13
+ task". v0.3.0 introduces a second link role — a code-context receipt bound
14
+ to a task or job (0108) — and v0.3.2 will add master-trace / intent-index
15
+ roles. A single typed column cannot express a role, and adding one column per
16
+ target type (`linked_job_id`, `linked_goal_id`, and so on) sprawls.
17
+
18
+ Introduce a generic, queryable `evidence_links` table so target-bound receipt
19
+ selection (0108), `pcl context check` (v0.3.1), and v0.4 coverage KPIs become
20
+ SQL queries rather than artifact scans. This is a control-plane primitive, not
21
+ a per-feature column.
22
+
23
+ ## Scope
24
+
25
+ 1. Add migration `007_evidence_links.sql`:
26
+ ```sql
27
+ PRAGMA foreign_keys = ON;
28
+
29
+ CREATE TABLE IF NOT EXISTS evidence_links (
30
+ evidence_id TEXT NOT NULL REFERENCES evidence(id),
31
+ target_type TEXT NOT NULL,
32
+ target_id TEXT NOT NULL,
33
+ link_role TEXT NOT NULL,
34
+ created_at TEXT NOT NULL,
35
+ PRIMARY KEY (evidence_id, target_type, target_id, link_role)
36
+ );
37
+
38
+ CREATE INDEX IF NOT EXISTS idx_evidence_links_target
39
+ ON evidence_links(target_type, target_id, link_role, created_at);
40
+
41
+ -- Backfill existing task-linked evidence as role 'supporting'.
42
+ INSERT OR IGNORE INTO evidence_links(evidence_id, target_type, target_id, link_role, created_at)
43
+ SELECT id, 'task', linked_task_id, 'supporting', created_at
44
+ FROM evidence
45
+ WHERE linked_task_id IS NOT NULL;
46
+ ```
47
+ Vocabulary in use now: `target_type` is `task` or `agent_job`;
48
+ `link_role` is `supporting` or `code_context`. Reserve (do not emit yet)
49
+ `goal` / `workflow_run` / `decision` / `escalation` and
50
+ `master_trace` / `intent_index` / `worker_output`.
51
+ 2. Write path: `pcl evidence add --task T-XXXX` (evidence.py) keeps setting the
52
+ `evidence.linked_task_id` column (0.x compat) and also inserts an
53
+ `evidence_links` row `(evidence_id, 'task', task_id, 'supporting', now)` in
54
+ the same transaction, before the existing `append_event`.
55
+ 3. Read path: `context.py._linked_task_evidence` selects from `evidence_links`
56
+ where `target_type='task' AND link_role='supporting'`, joined to `evidence`
57
+ for the display columns, ordered `created_at, evidence_id`. When the
58
+ `evidence_links` table is absent (pre-migration DB opened by a newer binary
59
+ mid-upgrade), fall back to the current `linked_task_id` column query. Output
60
+ shape, ordering, and member/stored-path resolution are unchanged.
61
+ 4. Strict validation (`validators.py`): add a dangling-link check modeled on the
62
+ verification `receipt_evidence_id` check (validators.py:596) — every
63
+ `evidence_links.evidence_id` must resolve to an existing evidence row (the
64
+ existing `PRAGMA foreign_key_check` already covers this; keep an explicit,
65
+ message-consistent check too), and for known target types the `target_id`
66
+ must exist (`task` maps to `tasks`, `agent_job` maps to `agent_jobs`).
67
+ Unknown `target_type` values are tolerated with no error (forward
68
+ compatibility).
69
+ 5. Provide two small internal helpers for 0108 to reuse (no new CLI surface):
70
+ insert a link row, and select the newest `evidence_id` for a given
71
+ `(target_type, target_id, link_role)`.
72
+
73
+ ## Invariants (what to protect, on the normal paths)
74
+
75
+ - The canonical write path for a task-linked ad-hoc evidence is, in one
76
+ transaction: the `evidence` row plus the `linked_task_id` column plus the
77
+ `evidence_links` row plus the `adhoc_evidence_recorded` event. Do not drop the
78
+ `linked_task_id` column write (compat). Do not write an `evidence_links` row
79
+ without its mirroring `evidence` row.
80
+ - The migration backfill is idempotent (`INSERT OR IGNORE`) and additive: it
81
+ must not update or delete any `evidence` row, and re-running `pcl migrate`
82
+ must be a no-op.
83
+ - `evidence_links` is written only through `pcl` (evidence add today, 0108
84
+ tomorrow). No command deletes links in this task; no raw-SQL mutation path.
85
+ - The existing task context-pack `linked_evidence` output — shape, ordering,
86
+ member/stored paths — is unchanged for existing DBs after backfill.
87
+ - Additive only: no existing table or column is dropped or repurposed. Schema
88
+ version advances 6 to 7; `never-downgrade` and DB-ahead typed rejection (0076)
89
+ continue to hold.
90
+
91
+ ## Non-scope
92
+
93
+ - `pcl evidence link` / `unlink` CLI verbs (links are written implicitly by
94
+ `evidence add` and, in 0108, by `impact --for-task/--for-job`).
95
+ - Job / goal / decision linking commands beyond the helper 0108 needs.
96
+ - Dashboard changes. The existing `heading_evidence_links` locale string is an
97
+ unrelated UI heading, not this table.
98
+ - Removing or deprecating `linked_task_id` (deferred past 0.x).
99
+ - Reading `evidence_links` from the code-context receipt selection path (that is
100
+ 0108).
101
+
102
+ ## Acceptance
103
+
104
+ - Fresh `pcl init` gives schema v7, `evidence_links` present,
105
+ `pcl validate --strict --json` green.
106
+ - A v6 to v7 live migration backfills every `linked_task_id` row into
107
+ `evidence_links` as role `supporting`; backfilled row count equals the number
108
+ of non-null `linked_task_id` rows; a second `pcl migrate` changes nothing.
109
+ - `pcl evidence add --task T-0001` writes both the column and the
110
+ `evidence_links` row; the task context pack lists the evidence identically to
111
+ before.
112
+ - A hand-broken dangling link (an `evidence_links` row whose `target_type='task'`
113
+ `target_id` has no matching task) is reported by `validate --strict`; a row
114
+ with an unknown `target_type` is tolerated (no error).
115
+ - An older (v6-aware) `pcl` binary typed-rejects a v7 DB with
116
+ `schema_version_ahead` (0076 behavior preserved).
117
+ - Full `pytest` green; live smoke in a scratch project (`init`, then `evidence
118
+ add --task`, then `validate --strict`, then context pack).
@@ -0,0 +1,78 @@
1
+ # 0114: Source hash drift detection for copied evidence
2
+
3
+ Milestone: v0.3.0 Target-Bound Context
4
+ Priority: P2
5
+ Area: evidence
6
+ Origin: docs/growth-plan-v0.2.4-v0.5.md 論点2; third-party review P1 / 議題2 —
7
+ default-on approved (坂本承認 2026-07-08). Extends 0102.
8
+
9
+ ## Problem
10
+
11
+ `_collect_copied_member_findings` in `src/pcl/evidence.py` (the source-freshness
12
+ block at evidence.py:589-605) detects source drift only via `detail: "missing"`
13
+ and `detail: "size_mismatch"`. A **same-size content change** to the source
14
+ file is undetected: `source_drifted` never fires, so a copied evidence member
15
+ whose origin was silently rewritten to a different-but-equal-length body reads
16
+ as fresh. The recorded member `sha256` (`expected_sha256`) is already a
17
+ parameter of this function (evidence.py:545) but is never compared against the
18
+ current source.
19
+
20
+ 0102 already classifies `source_drifted` as an evidence-health **warning**, so
21
+ closing this gap needs no health-model change — only the missing hash
22
+ comparison.
23
+
24
+ ## Scope
25
+
26
+ 1. In `_collect_copied_member_findings`, extend the `else` branch that currently
27
+ only handles the size check: when the source exists **and**
28
+ `source_stat.st_size == size_bytes`, compute the source file sha256 (reuse
29
+ `_sha256_file`, evidence.py:907) and compare to `expected_sha256`.
30
+ - Mismatch → append `{"code": "source_drifted", "path": member_path,
31
+ "detail": "hash_mismatch"}`.
32
+ - `OSError` while reading the source → treat as unreadable and reuse the
33
+ existing `detail: "missing"` finding (do not crash, do not add a new code).
34
+ 2. Default-on, no `--deep` flag. The hash is computed **only** in the same-size
35
+ branch, so `missing` and `size_mismatch` stay the cheap fast paths. The
36
+ `copy_max_member_bytes` cap (10MB, 0097) bounds per-member cost.
37
+ 3. Confirm the `validators.py` `source_drifted` rendering branch (the
38
+ `elif code == "source_drifted":` branch, ~line 977) renders the new
39
+ `hash_mismatch` detail consistently through the shared
40
+ `assess_adhoc_evidence` path (0095 pattern) — health stays `warning`.
41
+
42
+ ## Invariants (what to protect, on the normal paths)
43
+
44
+ - Read-only assessment: no finding rewrites or removes copied artifacts under
45
+ `.project-loop/evidence/adhoc-files/` or any source file.
46
+ - Findings shape is additive-only: `source_drifted` gains one new `detail`
47
+ value, `hash_mismatch`. Existing `missing` / `size_mismatch` details, their
48
+ `path` field, and ordering are unchanged.
49
+ - Copied-artifact health stays semantically **separate** from source freshness
50
+ in wording (0102 invariant): `copy_hash_mismatch` = the copied artifact broke;
51
+ `source_drifted/hash_mismatch` = the origin changed since the copy. Do not
52
+ merge or cross-reference the two codes.
53
+ - Health stays the three-level `ok | warning | error`; no `artifact_health` /
54
+ `source_health` split (still deferred until dogfood `source_drift_rate` data).
55
+
56
+ ## Non-scope
57
+
58
+ - A `--deep` / lightweight-vs-deep mode split (unnecessary: the size gate plus
59
+ the 10MB member cap already bound cost).
60
+ - Hashing sources of **reference** (non-copied) members — reference members are
61
+ already hash-checked against the source directly by `_assess_reference_member`.
62
+ - `artifact_health` / `source_health` field separation.
63
+
64
+ ## Acceptance
65
+
66
+ - Test: copied artifact intact + source rewritten to different content of the
67
+ **same byte length** → `health: "warning"` with a `source_drifted` finding,
68
+ `detail: "hash_mismatch"`.
69
+ - Test: copied artifact intact + source intact → `health: "ok"` (no regression).
70
+ - Test: `copy_hash_mismatch` (artifact corrupted) + `source_drifted/hash_mismatch`
71
+ co-occur → still `warning`, both findings present, no double-count crash.
72
+ - `pcl validate --strict --json` treats `source_drifted/hash_mismatch` as a
73
+ warning that remains a warning under strict (extend
74
+ `_strict_warning_remains_warning` coverage) and stays green overall.
75
+ - Live smoke: in a scratch project, `evidence add --copy` a file, edit the
76
+ source to same-length different content, `pcl validate --strict --json` →
77
+ evidence health `warning`, detail `hash_mismatch`, strict `ok: true`.
78
+ - Full `pytest` green; release note entry describing the tightened semantics.
@@ -0,0 +1,72 @@
1
+ # 0115: Context pack target-bound contract fixtures
2
+
3
+ Milestone: v0.3.0 Target-Bound Context
4
+ Priority: P2
5
+ Area: context-pack/tests
6
+ Origin: docs/growth-plan-v0.2.4-v0.5.md v0.3.0; third-party review 0111 —
7
+ required in v0.3.0 (坂本承認 2026-07-08). Depends on 0108 and 0113.
8
+
9
+ ## Problem
10
+
11
+ 0108 changes the `context-pack/v1` code-context contract: `code_context.relevance`
12
+ gains `scope: "target_bound"` / `binding_strength: "caller_asserted"` with
13
+ `target_type` / `target_id`, a `receipt_ref`, a `--require-bound-receipt` typed
14
+ error, and target-specific `suggested_refresh_commands`. PLH has shipped three
15
+ contract regressions caught only in review (0087 git-status key loss, 0089
16
+ audit-mirror break, 0090 receipt-content storage). Freeze the v0.3.0 handoff
17
+ contract with deterministic fixture-based tests so future changes are provably
18
+ additive and any silent shape change fails a test.
19
+
20
+ ## Scope
21
+
22
+ Add fixture-backed tests covering six code-context selection states. Each
23
+ fixture asserts `included_sections`, the required / non-droppable safety
24
+ sections, `source_paths`, `suggested_refresh_commands`, and
25
+ `code_context.relevance`:
26
+
27
+ 1. **no receipt** — `scope: "missing_receipt"`, `binding_strength: "none"`.
28
+ 2. **unscoped latest only** — a receipt with no `target_binding`;
29
+ `scope: "unscoped_latest"`, `binding_strength: "none"`, with the existing
30
+ unscoped warning and a target-specific suggested refresh command.
31
+ 3. **matching task-bound receipt** — `scope: "target_bound"`,
32
+ `binding_strength: "caller_asserted"`, `target_type: "task"`, `target_id`
33
+ set; chosen over a newer unbound receipt.
34
+ 4. **matching job-bound receipt** — same as (3) with `target_type: "agent_job"`.
35
+ 5. **stale bound receipt** — a matching bound receipt old enough that the 0082
36
+ `age_warning` fires; relevance stays `target_bound` and the age warning is
37
+ present (staleness is a surfaced fact, not a downgrade).
38
+ 6. **require-bound missing** — `--require-bound-receipt` with no matching bound
39
+ receipt → typed error `context_pack_bound_receipt_required` with the
40
+ target-specific refresh suggestion; assert there is **no** silent fallback to
41
+ unscoped latest.
42
+
43
+ ## Invariants (what to protect, on the normal paths)
44
+
45
+ - Fixtures are byte-deterministic: inject `now` at the CLI boundary the way
46
+ existing pack tests do; no wall-clock reads inside generated artifacts.
47
+ - Budget truncation never drops required safety sections: the
48
+ `code_context_safety` pin (priority 10000, 0078/0083) survives a deliberately
49
+ tight budget — at least one fixture asserts this.
50
+ - Contract assertions are additive-only in spirit: adding a new field is
51
+ allowed; changing or removing an asserted field, shape, or ordering must fail
52
+ a fixture. Do not weaken an assertion to make a change pass.
53
+ - Fixtures must not inline receipt bodies or copied evidence file contents
54
+ (0090 boundary): assert `receipt_ref` carries `evidence_id` / `receipt_path`
55
+ only.
56
+
57
+ ## Non-scope
58
+
59
+ - Any new runtime behavior — this is a pure test / fixture task. If a fixture
60
+ reveals a 0108 defect, fix it in 0108, not here.
61
+ - Dashboard, MCP, or CLI-surface changes.
62
+ - Golden-file snapshotting of the entire pack (assert the contract-bearing
63
+ fields, not incidental whitespace).
64
+
65
+ ## Acceptance
66
+
67
+ - Six fixtures committed and green.
68
+ - A deliberate contract break (e.g., dropping `binding_strength` from
69
+ `relevance`, or letting `--require-bound-receipt` fall back silently) makes at
70
+ least one fixture fail with a clear message.
71
+ - The tight-budget fixture proves the safety section is never truncated away.
72
+ - Full `pytest` green.
@@ -20,13 +20,20 @@ implement from the spec file, not from prompt summaries.
20
20
  | 0105 | Evidence copy observability | v0.2.4 Trust Patch | P2 | done |
21
21
  | 0106 | Release checklist contract | v0.2.4 Trust Patch | P2 | done (`docs/release-checklist.md`) |
22
22
  | 0107 | agent-tasks backlog index | v0.2.4 Trust Patch | P3 | done (this file) |
23
+ | 0113 | Generic evidence_links table (migration 007) | v0.3.0 Target-Bound Context | P1 | spec ready |
24
+ | 0108 | Target-bound code context receipts (sits on 0113) | v0.3.0 Target-Bound Context | P1 | spec ready |
25
+ | 0114 | Source hash drift detection (default-on) | v0.3.0 Target-Bound Context | P2 | spec ready |
26
+ | 0115 | Context pack target-bound contract fixtures | v0.3.0 Target-Bound Context | P2 | spec ready |
27
+
28
+ v0.3.0 dispatch order: **0113 + 0114 in parallel** (independent; different
29
+ `evidence.py` surfaces) → **0108** (needs 0113 merged) → **0115** (freezes the
30
+ 0108 contract).
23
31
 
24
32
  ## Planned next (see growth plan for scope)
25
33
 
26
34
  | Milestone | Theme |
27
35
  |---|---|
28
- | v0.3.0 | Target-bound code context receipts (`impact --for-task/--for-job`, `--require-bound-receipt`) |
29
- | v0.3.1 | Operator experience: `pcl finish` (F7), human-gate ja copy (F5), feature_coverage no-op (F4) |
36
+ | v0.3.1 | Operator experience: `pcl finish` (F7), human-gate ja copy (F5), feature_coverage no-op (F4), `pcl context check` preflight |
30
37
  | v0.3.2 | Master trace / intent-index v0 contract formalization |
31
38
  | v0.4.0 | Dogfood operations + cost KPI measurement |
32
39
  | v0.5.0 | Adoption: README split, contract stability policy |
@@ -39,6 +39,8 @@ pcl impact --diff --staged --json
39
39
  pcl impact --diff --unstaged --json
40
40
  pcl impact --diff --include-untracked --json
41
41
  pcl impact --diff --all-changes --json
42
+ pcl impact --diff --for-task T-0001 --json
43
+ pcl impact --diff --for-job J-0001 --json
42
44
  git diff --no-ext-diff --no-textconv --name-status main -- | pcl impact --diff - --json
43
45
  ```
44
46
 
@@ -349,6 +351,12 @@ under `.project-loop/evidence/context-receipts/`.
349
351
  "omitted": [],
350
352
  "sensitive_omitted_count": 1,
351
353
  "staleness_warnings": [],
354
+ "target_binding": {
355
+ "target_type": "task",
356
+ "target_id": "T-0001",
357
+ "binding_strength": "caller_asserted",
358
+ "source": "impact_flag"
359
+ },
352
360
  "receipt_path": ".project-loop/evidence/context-receipts/e-0001-impact-v0.json",
353
361
  "evidence_id": "E-0001"
354
362
  }
@@ -409,6 +417,24 @@ operations for the selected mode, such as staging changes for `--staged`, using
409
417
  `--include-untracked` when untracked files are present, comparing against a
410
418
  default branch, or checking a provided diff.
411
419
 
420
+ `--for-task T-XXXX` and `--for-job J-XXXX` bind a written context receipt to an
421
+ existing task or agent job as a caller assertion. Exactly zero or one target
422
+ flag is allowed. PLH validates the target before writing any receipt evidence.
423
+ Malformed, missing, or mutually exclusive target flags return typed errors and
424
+ do not create evidence rows, receipt artifacts, or `evidence_links` rows.
425
+
426
+ When a target flag is present and the diff is non-empty, PLH records the
427
+ binding in both durable query state and the self-describing receipt artifact:
428
+
429
+ - `evidence_links(evidence_id, target_type, target_id, link_role="code_context")`
430
+ - `target_binding` in the `impact/v0` response and the `context-receipt/v0`
431
+ artifact
432
+
433
+ Task bindings use `target_type: "task"`. Job bindings use
434
+ `target_type: "agent_job"`. The binding strength is always
435
+ `caller_asserted`, with `source: "impact_flag"`. This is a caller label, not
436
+ PLH proof that the receipt is semantically relevant to the target.
437
+
412
438
  The receipt contract is `context-receipt/v0`. Its core fields are:
413
439
 
414
440
  - `diff_source`: the same source label returned by `impact/v0`, with `base_ref`
@@ -426,6 +452,8 @@ The receipt contract is `context-receipt/v0`. Its core fields are:
426
452
  the working tree.
427
453
  - `untracked_included_count`: present only when the diff source explicitly
428
454
  includes untracked files.
455
+ - `target_binding`: present only for receipts written with `--for-task` or
456
+ `--for-job`; it records the caller-asserted target label.
429
457
 
430
458
  Receipts are evidence artifacts. They record PLH output and reasons; they do
431
459
  not make claims about agent cognition. Verification suggestion objects carry
@@ -519,12 +547,16 @@ the receipt, so the refresh remains generic.
519
547
 
520
548
  ## Context Pack Bridge
521
549
 
522
- `pcl context pack --include-code-context` links the latest context receipt into
523
- normal task and job handoffs without inlining the receipt body.
550
+ `pcl context pack --include-code-context` links a context receipt into normal
551
+ task and job handoffs without inlining the receipt body.
524
552
 
525
- The context pack resolves the newest evidence row with type `context_receipt`,
526
- loads its JSON artifact, and converts it through a stable
527
- `code-context-summary/v0` isolation layer. The summary is embedded under
553
+ For task and job packs, PLH first queries `evidence_links` for the newest
554
+ matching row with `link_role: "code_context"` and the pack target
555
+ (`target_type: "task"` or `"agent_job"`). When a matching bound receipt exists,
556
+ that receipt is preferred over a newer unbound receipt. If no matching bound
557
+ receipt exists, PLH keeps the unscoped-latest fallback unless the caller used
558
+ `--require-bound-receipt`. The selected receipt artifact is converted through a
559
+ stable `code-context-summary/v0` isolation layer. The summary is embedded under
528
560
  `context_pack.code_context`; the original receipt remains referenced by
529
561
  `receipt_ref.evidence_id`, `receipt_ref.receipt_path`, and the pack's
530
562
  `source_paths`.
@@ -564,7 +596,13 @@ listing.
564
596
 
565
597
  If no receipt exists, the command still returns a valid context pack with empty
566
598
  receipt refs, a message, and next actions: `pcl index build --json` followed by
567
- `pcl impact --diff --json`.
599
+ a target-specific impact command such as
600
+ `pcl impact --diff --for-task T-0001 --json`.
601
+
602
+ `--require-bound-receipt` is valid only with `--include-code-context`. When no
603
+ matching bound receipt exists, context pack fails with typed error
604
+ `context_pack_bound_receipt_required` and suggests a target-specific refresh
605
+ command. It does not fall back to the unscoped latest receipt in that mode.
568
606
 
569
607
  The bridge does not add schema, rebuild the index, run impact automatically,
570
608
  make continuation claims, or expose a `safe_to_continue` field.
@@ -13,6 +13,7 @@ pcl context pack --job J-0001
13
13
  pcl context pack --job J-0001 --role verifier --max-tokens 12000 --json
14
14
  pcl context pack --task T-0001 --json
15
15
  pcl context pack --task T-0001 --include-code-context --json
16
+ pcl context pack --task T-0001 --include-code-context --require-bound-receipt --json
16
17
  ```
17
18
 
18
19
  Exactly one of `--job` or `--task` is required.
@@ -75,12 +76,29 @@ treating model output as source of truth.
75
76
 
76
77
  `--include-code-context` is opt-in. Without the flag, context packs do not look
77
78
  for code-context receipts and keep the same v1 payload shape. With the flag,
78
- the pack resolves the latest `context_receipt` evidence row, loads that receipt
79
- artifact, and embeds only a stable `code-context-summary/v0` under
80
- `context_pack.code_context`. The receipt body is never inlined; it is referenced
81
- through `code_context.receipt_ref.evidence_id`,
79
+ the pack first queries `evidence_links` for the newest receipt bound to the
80
+ requested target with `link_role: "code_context"`:
81
+
82
+ - task packs query `target_type: "task"` and the task id;
83
+ - job packs query `target_type: "agent_job"` and the job id.
84
+
85
+ When a matching bound receipt exists, it is preferred over a newer unbound
86
+ receipt. If no matching bound receipt exists, the pack preserves the current
87
+ unscoped-latest fallback unless `--require-bound-receipt` is set. The selected
88
+ receipt artifact is loaded and embedded only as a stable
89
+ `code-context-summary/v0` under `context_pack.code_context`. The receipt body is
90
+ never inlined; it is referenced through
91
+ `code_context.receipt_ref.evidence_id`,
82
92
  `code_context.receipt_ref.receipt_path`, and `source_paths`.
83
93
 
94
+ `--require-bound-receipt` is valid only with `--include-code-context`. When no
95
+ matching bound receipt exists, JSON mode returns `ok:false` with
96
+ `error.code: "context_pack_bound_receipt_required"` and details that include a
97
+ target-specific refresh command such as
98
+ `pcl impact --diff --for-task T-0001 --json` or
99
+ `pcl impact --diff --for-job J-0001 --json`. In this mode PLH does not silently
100
+ fall back to the unscoped latest receipt.
101
+
84
102
  `source_commands` are read-only re-fetch commands. They are commands a reader
85
103
  can run to reproduce the inputs this pack was built from, and they must not
86
104
  create evidence rows, receipt artifacts, reports, exports, or other project
@@ -91,8 +109,10 @@ When `--include-code-context` is requested, the pack also includes a top-level
91
109
  `suggested_refresh_commands` field. These commands are artifact-regenerating
92
110
  suggestions for refreshing the underlying code-context evidence; they may
93
111
  create new evidence or artifacts. Stale or missing code context suggests
94
- `pcl index build --json` followed by `pcl impact --diff --json`; fresh code
95
- context suggests an impact refresh command.
112
+ `pcl index build --json` followed by a target-specific impact command; fresh
113
+ code context suggests a target-specific impact refresh command. These commands
114
+ preserve replayable diff scope where possible and add `--for-task` or
115
+ `--for-job` for the pack target.
96
116
 
97
117
  The embedded `code_context.refresh_replay` object explains how closely those
98
118
  refresh commands preserve the previous receipt scope:
@@ -127,19 +147,21 @@ keeps the command first and may append the ID at the end.
127
147
 
128
148
  `relevance` is stamped by the context-pack builder because it knows the pack
129
149
  target and the receipt selection method. It is not produced by the pure receipt
130
- summarizer. In v0.1.12, the only shipping selection scopes are:
150
+ summarizer. The shipping selection scopes are:
151
+
152
+ - `scope: "target_bound"`: a context receipt was selected through a matching
153
+ `evidence_links` row for this pack target.
131
154
 
132
155
  - `scope: "unscoped_latest"`: the most recent context receipt was selected by
133
- recency and was not created for the pack target.
156
+ recency because no matching bound receipt was available. The summary includes
157
+ an explicit warning.
134
158
  - `scope: "missing_receipt"`: no context receipt was available.
135
159
 
136
- The only shipping binding strength is `binding_strength: "none"`, meaning no
137
- caller or PLH mechanism asserted a target linkage. Future vocabulary reserves
138
- `scope: "target_bound"` and `binding_strength: "caller_asserted"` for a
139
- possible caller-labeled flow. A caller-asserted binding would be a caller label,
140
- not a PLH-verified semantic relation between the receipt and the target. This
141
- version does not implement `--for-task`, `--for-job`, or
142
- `--require-bound-receipt` flags.
160
+ Binding strength is `binding_strength: "caller_asserted"` only for
161
+ `target_bound` receipts created with `pcl impact --diff --for-task` or
162
+ `--for-job`. This is a caller label, not a PLH-verified semantic relation
163
+ between the receipt and the target. Unscoped fallback and missing-receipt states
164
+ use `binding_strength: "none"`.
143
165
 
144
166
  `receipt_age` records freshness facts for the embedded receipt:
145
167
  `{"created_at": "...", "age_seconds": 123}`. Age is computed against a single
@@ -158,8 +180,8 @@ the context pack.
158
180
 
159
181
  When no receipt exists, `--include-code-context` still succeeds and returns a
160
182
  `code_context` summary with `status: "missing_receipt"`, empty receipt refs, a
161
- message, and next actions: `pcl index build --json` and
162
- `pcl impact --diff --json`. The same commands are exposed in
183
+ message, and next actions: `pcl index build --json` and a target-specific
184
+ impact refresh command. The same commands are exposed in
163
185
  `context_pack.suggested_refresh_commands`; they are not placed in
164
186
  `source_commands`. The summary still includes `relevance` with
165
187
  `scope: "missing_receipt"` and `binding_strength: "none"`. Receipt-derived
@@ -276,7 +298,7 @@ The selected profile name is returned as `role_profile`.
276
298
  - It does not read or parse `.project-loop/dashboard/dashboard.html`.
277
299
  - It never executes `pcl impact` during pack generation.
278
300
  - It does not run `pcl index build` or `pcl impact`; `--include-code-context`
279
- reads the latest existing receipt evidence only.
301
+ reads `evidence_links`, evidence rows, and existing receipt artifacts only.
280
302
  - It does not inline the full context receipt body.
281
303
 
282
304
  Agents should use `pcl` JSON commands, reports, evidence paths, or