second-source 0.5.1__tar.gz → 0.6.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 (173) hide show
  1. second_source-0.6.0/.github/workflows/second-source.yml +48 -0
  2. {second_source-0.5.1 → second_source-0.6.0}/CHANGELOG.md +40 -1
  3. {second_source-0.5.1 → second_source-0.6.0}/CONTRIBUTING.md +11 -0
  4. second_source-0.6.0/PKG-INFO +165 -0
  5. second_source-0.6.0/README.md +136 -0
  6. {second_source-0.5.1 → second_source-0.6.0}/action.yml +17 -0
  7. {second_source-0.5.1 → second_source-0.6.0}/docs/ARCHITECTURE.md +18 -20
  8. second_source-0.6.0/docs/README.md +33 -0
  9. second_source-0.6.0/docs/accuracy.md +66 -0
  10. second_source-0.6.0/docs/action.md +223 -0
  11. second_source-0.6.0/docs/assets/icon.png +0 -0
  12. second_source-0.6.0/docs/assets/icon.svg +6 -0
  13. second_source-0.6.0/docs/assets/logo-dark.png +0 -0
  14. second_source-0.6.0/docs/assets/logo-dark.svg +8 -0
  15. second_source-0.6.0/docs/assets/logo-light.png +0 -0
  16. second_source-0.6.0/docs/assets/logo-light.svg +8 -0
  17. {second_source-0.5.1 → second_source-0.6.0}/docs/benchmark-data/run2/README.md +2 -2
  18. {second_source-0.5.1 → second_source-0.6.0}/docs/benchmark.md +7 -31
  19. second_source-0.6.0/docs/claims.md +128 -0
  20. second_source-0.6.0/docs/cli.md +79 -0
  21. second_source-0.6.0/docs/faq.md +57 -0
  22. second_source-0.6.0/docs/how-it-works.md +85 -0
  23. {second_source-0.5.1 → second_source-0.6.0}/docs/packs/coding.md +2 -2
  24. second_source-0.6.0/docs/quickstart.md +63 -0
  25. second_source-0.6.0/docs/security-model.md +78 -0
  26. {second_source-0.5.1 → second_source-0.6.0}/docs/sources/github.md +1 -1
  27. second_source-0.6.0/docs/troubleshooting.md +68 -0
  28. {second_source-0.5.1 → second_source-0.6.0}/pyproject.toml +1 -1
  29. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/__init__.py +1 -1
  30. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/inputs.py +33 -0
  31. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/main.py +47 -8
  32. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/publish.py +35 -12
  33. second_source-0.6.0/src/second_source/action/record.py +278 -0
  34. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/setup.py +17 -1
  35. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/sweep.py +1 -1
  36. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/wait.py +1 -1
  37. second_source-0.6.0/src/second_source/benchmark/fresh.py +142 -0
  38. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/cli/bench.py +52 -1
  39. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/cli/main.py +2 -2
  40. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/ci_result.yaml +17 -4
  41. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/matching_jobs_caution.yaml +2 -2
  42. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/extract.py +44 -3
  43. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/pipeline.py +5 -0
  44. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/report/render.py +72 -7
  45. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/sources/github/client.py +8 -2
  46. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/sources/github/mappers.py +40 -5
  47. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/sources/github/source.py +7 -3
  48. {second_source-0.5.1 → second_source-0.6.0}/tests/action/test_inputs.py +23 -0
  49. {second_source-0.5.1 → second_source-0.6.0}/tests/action/test_main.py +76 -1
  50. {second_source-0.5.1 → second_source-0.6.0}/tests/action/test_publish.py +4 -2
  51. second_source-0.6.0/tests/action/test_record.py +229 -0
  52. {second_source-0.5.1 → second_source-0.6.0}/tests/action/test_setup.py +6 -1
  53. second_source-0.6.0/tests/benchmark/test_fresh.py +71 -0
  54. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_checks.py +40 -0
  55. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_extract.py +81 -0
  56. {second_source-0.5.1 → second_source-0.6.0}/tests/report/test_render.py +79 -0
  57. {second_source-0.5.1 → second_source-0.6.0}/tests/sources/github/test_client.py +2 -0
  58. {second_source-0.5.1 → second_source-0.6.0}/tests/sources/github/test_mappers.py +18 -1
  59. {second_source-0.5.1 → second_source-0.6.0}/uv.lock +1 -1
  60. second_source-0.5.1/PKG-INFO +0 -311
  61. second_source-0.5.1/README.md +0 -282
  62. second_source-0.5.1/docs/action.md +0 -148
  63. {second_source-0.5.1 → second_source-0.6.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  64. {second_source-0.5.1 → second_source-0.6.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  65. {second_source-0.5.1 → second_source-0.6.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  66. {second_source-0.5.1 → second_source-0.6.0}/.github/ISSUE_TEMPLATE/wrong_verdict.yml +0 -0
  67. {second_source-0.5.1 → second_source-0.6.0}/.github/pull_request_template.md +0 -0
  68. {second_source-0.5.1 → second_source-0.6.0}/.github/workflows/ci.yml +0 -0
  69. {second_source-0.5.1 → second_source-0.6.0}/.github/workflows/release.yml +0 -0
  70. {second_source-0.5.1 → second_source-0.6.0}/.gitignore +0 -0
  71. {second_source-0.5.1 → second_source-0.6.0}/.python-version +0 -0
  72. {second_source-0.5.1 → second_source-0.6.0}/CODE_OF_CONDUCT.md +0 -0
  73. {second_source-0.5.1 → second_source-0.6.0}/LICENSE +0 -0
  74. {second_source-0.5.1 → second_source-0.6.0}/NOTICE +0 -0
  75. {second_source-0.5.1 → second_source-0.6.0}/SECURITY.md +0 -0
  76. {second_source-0.5.1 → second_source-0.6.0}/docs/benchmark-data/run2/summary.json +0 -0
  77. {second_source-0.5.1 → second_source-0.6.0}/docs/benchmark-data/run2/summary.md +0 -0
  78. {second_source-0.5.1 → second_source-0.6.0}/scripts/check.sh +0 -0
  79. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/__init__.py +0 -0
  80. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/commands.py +0 -0
  81. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/action/event.py +0 -0
  82. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/__init__.py +0 -0
  83. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/aidev.py +0 -0
  84. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/aidev_local.py +0 -0
  85. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/golden.py +0 -0
  86. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/redact.py +0 -0
  87. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/rescore.py +0 -0
  88. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/runner.py +0 -0
  89. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/sample.py +0 -0
  90. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/benchmark/stats.py +0 -0
  91. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/cli/__init__.py +0 -0
  92. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/__init__.py +0 -0
  93. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/aggregate.py +0 -0
  94. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/checks.py +0 -0
  95. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/engine.py +0 -0
  96. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/evidence.py +0 -0
  97. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/expr.py +0 -0
  98. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/hashing.py +0 -0
  99. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/model.py +0 -0
  100. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/core/pack.py +0 -0
  101. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/__init__.py +0 -0
  102. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/__init__.py +0 -0
  103. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/ci_config_caution.yaml +0 -0
  104. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/ci_weakening_caution.yaml +0 -0
  105. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/deployed.yaml +0 -0
  106. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/docs_updated.yaml +0 -0
  107. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/fixes_issue.yaml +0 -0
  108. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/fixes_issue_durable.yaml +0 -0
  109. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/integrity_guard.yaml +0 -0
  110. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/integrity_inspection.yaml +0 -0
  111. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/lint_caution.yaml +0 -0
  112. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/not_reverted.yaml +0 -0
  113. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/tests_added.yaml +0 -0
  114. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/tests_added_guard.yaml +0 -0
  115. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/checks/tests_removed_caution.yaml +0 -0
  116. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/detection.py +0 -0
  117. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/diff_facts.py +0 -0
  118. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/functions.py +0 -0
  119. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/pack.yaml +0 -0
  120. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/packs/coding/trusted_rules.yaml +0 -0
  121. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/report/__init__.py +0 -0
  122. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/sources/__init__.py +0 -0
  123. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/sources/github/__init__.py +0 -0
  124. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/sources/github/auth.py +0 -0
  125. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/sources/github/cache.py +0 -0
  126. {second_source-0.5.1 → second_source-0.6.0}/src/second_source/sources/github/urls.py +0 -0
  127. {second_source-0.5.1 → second_source-0.6.0}/tests/action/test_commands.py +0 -0
  128. {second_source-0.5.1 → second_source-0.6.0}/tests/action/test_event.py +0 -0
  129. {second_source-0.5.1 → second_source-0.6.0}/tests/action/test_sweep.py +0 -0
  130. {second_source-0.5.1 → second_source-0.6.0}/tests/action/test_wait.py +0 -0
  131. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/conftest.py +0 -0
  132. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_aidev.py +0 -0
  133. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_aidev_local.py +0 -0
  134. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_bench_cli.py +0 -0
  135. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_golden.py +0 -0
  136. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_redact.py +0 -0
  137. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_rescore.py +0 -0
  138. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_runner.py +0 -0
  139. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_sample.py +0 -0
  140. {second_source-0.5.1 → second_source-0.6.0}/tests/benchmark/test_stats.py +0 -0
  141. {second_source-0.5.1 → second_source-0.6.0}/tests/cli/test_main.py +0 -0
  142. {second_source-0.5.1 → second_source-0.6.0}/tests/conftest.py +0 -0
  143. {second_source-0.5.1 → second_source-0.6.0}/tests/core/test_aggregate.py +0 -0
  144. {second_source-0.5.1 → second_source-0.6.0}/tests/core/test_checks.py +0 -0
  145. {second_source-0.5.1 → second_source-0.6.0}/tests/core/test_engine.py +0 -0
  146. {second_source-0.5.1 → second_source-0.6.0}/tests/core/test_evidence.py +0 -0
  147. {second_source-0.5.1 → second_source-0.6.0}/tests/core/test_expr.py +0 -0
  148. {second_source-0.5.1 → second_source-0.6.0}/tests/core/test_hashing.py +0 -0
  149. {second_source-0.5.1 → second_source-0.6.0}/tests/core/test_model.py +0 -0
  150. {second_source-0.5.1 → second_source-0.6.0}/tests/core/test_pack.py +0 -0
  151. {second_source-0.5.1 → second_source-0.6.0}/tests/fixtures/customer_support_demo/checks/refund_issued.yaml +0 -0
  152. {second_source-0.5.1 → second_source-0.6.0}/tests/fixtures/customer_support_demo/checks/refund_stays_issued.yaml +0 -0
  153. {second_source-0.5.1 → second_source-0.6.0}/tests/fixtures/customer_support_demo/pack.yaml +0 -0
  154. {second_source-0.5.1 → second_source-0.6.0}/tests/fixtures/test_customer_support_suite.py +0 -0
  155. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/golden/claims.yaml +0 -0
  156. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/golden/real/GUIDE.md +0 -0
  157. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/golden/real/README.md +0 -0
  158. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/golden/real/cases.jsonl +0 -0
  159. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_adversarial_text.py +0 -0
  160. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_cardinal_rule.py +0 -0
  161. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_contradiction_oracles.py +0 -0
  162. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_contradiction_paths.py +0 -0
  163. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_detection.py +0 -0
  164. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_diff_facts.py +0 -0
  165. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_functions.py +0 -0
  166. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_golden.py +0 -0
  167. {second_source-0.5.1 → second_source-0.6.0}/tests/packs/coding/test_golden_real.py +0 -0
  168. {second_source-0.5.1 → second_source-0.6.0}/tests/sources/github/test_auth.py +0 -0
  169. {second_source-0.5.1 → second_source-0.6.0}/tests/sources/github/test_cache.py +0 -0
  170. {second_source-0.5.1 → second_source-0.6.0}/tests/sources/github/test_source.py +0 -0
  171. {second_source-0.5.1 → second_source-0.6.0}/tests/sources/github/test_urls.py +0 -0
  172. {second_source-0.5.1 → second_source-0.6.0}/tests/test_action_yml.py +0 -0
  173. {second_source-0.5.1 → second_source-0.6.0}/tests/test_pipeline.py +0 -0
@@ -0,0 +1,48 @@
1
+ # Second Source: checks the claims coding agents make in their pull requests.
2
+ # Generated by `second-source init`. Docs: https://github.com/Rarebuffalo/second-source
3
+ #
4
+ # Safe with pull_request_target: Second Source reads the PR through the API only and never
5
+ # checks out or runs its code. Do not add an actions/checkout step to this workflow.
6
+ name: Second Source
7
+
8
+ on:
9
+ pull_request_target:
10
+ types: [opened, edited, synchronize, reopened, ready_for_review, closed]
11
+ # Re-check when CI finishes, so verdicts no longer wait on it.
12
+ workflow_run:
13
+ workflows: ["CI"]
14
+ types: [completed]
15
+ issue_comment:
16
+ types: [created]
17
+ schedule:
18
+ - cron: "17 6 * * *" # daily: durability (reverts, reopened issues) and pending claims
19
+ workflow_dispatch:
20
+
21
+ permissions:
22
+ checks: write
23
+ contents: read
24
+ pull-requests: write # to label a disputed PR (GitHub requires it for PR labels)
25
+ issues: write
26
+ actions: read
27
+
28
+ concurrency:
29
+ group: second-source-${{ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/second-source dispute') && github.run_id) || github.event.issue.number || github.event.pull_request.number || github.event.workflow_run.pull_requests[0].number || github.run_id }}
30
+ cancel-in-progress: false
31
+
32
+ jobs:
33
+ # The job id is its check-run name; checks ignore "second-source" as CI evidence.
34
+ second-source:
35
+ # Comments only matter when they hold a /second-source command on a pull request.
36
+ if: >-
37
+ github.event_name != 'issue_comment' ||
38
+ (github.event.issue.pull_request && contains(github.event.comment.body, '/second-source'))
39
+ runs-on: ubuntu-latest
40
+ timeout-minutes: 75
41
+ steps:
42
+ # Dogfooding: this repository runs the Action from main, so unreleased changes are
43
+ # exercised here first. Other repositories should use the moving tag, @v0.
44
+ - uses: Rarebuffalo/second-source@main
45
+ with:
46
+ # CI's one job, "check", runs lint, the format check and the tests.
47
+ test-jobs: check
48
+ lint-jobs: check
@@ -8,6 +8,45 @@ writes for you.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.6.0] - 2026-11-29
12
+
13
+ Upgrading: workflows on `@v0` get this release on their next run. Agent pull requests with a
14
+ settled claim then get the record comment (new comments only on PRs open or closed in the last
15
+ 7 days, at most 20 a run); set `comment: false` to keep the old behaviour. Workflows pinned to
16
+ a commit SHA keep 0.5.1 until the pin is changed.
17
+
18
+ ### Added
19
+ - The record comment: one comment per agent PR, edited in place, keeps the verdicts and a
20
+ compact copy of their evidence after GitHub deletes the check run (at most 90 days on public
21
+ repositories). Uses the existing `issues: write`; switch off with `comment: false`.
22
+ - `test-jobs`, `build-jobs` and `lint-jobs` Action inputs: declare CI jobs whose names do not
23
+ say "test", "build" or "lint" (shell wildcards, at most 20 patterns). A pattern also
24
+ covers a matrix job: `check` matches "check (3.12)".
25
+ - A new unverifiable reason, "no CI job matched this claim, and another CI job failed"; the
26
+ row names the failed jobs. Never a contradiction.
27
+ - `second-source bench discover`: samples fresh public agent PRs from GitHub search for
28
+ benchmark run 3, so they are checked while GitHub still has their CI runs.
29
+ - `second-source check` prints "Evidence at a glance", and its JSON has
30
+ `evidence_at_a_glance`, as the Action's check did.
31
+
32
+ ### Changed
33
+ - Instructions and requirements are not claims: "Ensure all tests pass before merging",
34
+ "Expected: all tests pass", "Tests must pass".
35
+ - Identical claims are shown once, with how often they were made; the check title counts every
36
+ claim shown, as the table does.
37
+ - CI job names are shown as code: a fork controls them.
38
+ - A commit status of `error` (CI could not run) no longer counts as a failed job.
39
+ - `coding.ci_result` 2.0.0: re-scored benchmark runs do not compare it with 1.x verdicts.
40
+
41
+ - The documentation was rewritten: a README with a logo, a quickstart, references for the
42
+ Action and the CLI, how it works, accuracy, the security model, troubleshooting and an FAQ.
43
+
44
+ ### Fixed
45
+ - A check run only on the files the change touched ("lint passed on the touched files") is a
46
+ claim about part of the checks: a CI failure makes it unverifiable, not contradicted.
47
+ - `second-source init` no longer lists a workflow that runs only on tag pushes as CI.
48
+ - Long runs of Unicode spaces no longer make claim extraction slow.
49
+
11
50
  ## [0.5.1] - 2026-11-27
12
51
 
13
52
  ### Changed
@@ -32,7 +71,7 @@ The first public release: a beta. Interfaces may change before 1.0.
32
71
  - GitHub Action: one check run per PR, updated as CI finishes; daily durability sweep;
33
72
  `/second-source recheck` and `/second-source dispute` commands. Advice by default: never
34
73
  fails a check unless `fail-on-contradiction` is set.
35
- - Benchmark run 2 findings (docs/benchmark.md, section 11).
74
+ - Benchmark run 2 findings (docs/benchmark.md, "Run 2 findings").
36
75
 
37
76
  - Every check ends with "Evidence at a glance" (CI on the head commit, what the change touched,
38
77
  merge and revert state), also on PRs that make no claims; reasons are shown in words.
@@ -60,6 +60,17 @@ Checks are YAML files with CEL expressions in `src/second_source/packs/coding/ch
60
60
  an existing one, add scenario tests in `tests/packs/coding/test_checks.py`, and remember the
61
61
  rule: missing or stale evidence gives `UNVERIFIABLE`, never `CONTRADICTED`.
62
62
 
63
+ ## Writing documentation
64
+
65
+ User documentation lives in `docs/` (indexed in `docs/README.md`); the README stays short and
66
+ links there. When you change behaviour, update the page that describes it in the same commit.
67
+
68
+ - Name: "Second Source" for the project, `second-source` for the package and the command.
69
+ - Say what something does, plainly, and link to evidence for any claim about accuracy.
70
+ - Sentence-case headings, bold only for a list item's lead, no emoji in headings.
71
+ - Keep one source for reference material: inputs are described in `docs/action.md`, reasons in
72
+ `docs/claims.md`; other pages link to them.
73
+
63
74
  ## Releasing (maintainers)
64
75
 
65
76
  `second-source init` writes the Action's moving major tag (`@v0` while 0.x), so every release
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.5
2
+ Name: second-source
3
+ Version: 0.6.0
4
+ Summary: Independent verification of AI agents' claims against the systems they act on.
5
+ Project-URL: Homepage, https://github.com/Rarebuffalo/second-source
6
+ Project-URL: Issues, https://github.com/Rarebuffalo/second-source/issues
7
+ Project-URL: Documentation, https://github.com/Rarebuffalo/second-source/tree/main/docs
8
+ Author: Second Source contributors
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ Keywords: ai-agents,ci,coding-agents,evaluation,llm,pull-requests,verification
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Classifier: Topic :: Software Development :: Testing
22
+ Requires-Python: >=3.12
23
+ Requires-Dist: cel-python>=0.2
24
+ Requires-Dist: httpx>=0.27
25
+ Requires-Dist: pyyaml>=6.0
26
+ Provides-Extra: local
27
+ Requires-Dist: pyarrow>=15; extra == 'local'
28
+ Description-Content-Type: text/markdown
29
+
30
+ <picture>
31
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/logo-dark.png">
32
+ <img src="docs/assets/logo-light.png" width="340" alt="Second Source">
33
+ </picture>
34
+ <br/><br/>
35
+
36
+ [![PyPI](https://img.shields.io/pypi/v/second-source)](https://pypi.org/project/second-source/)
37
+ [![CI](https://github.com/Rarebuffalo/second-source/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Rarebuffalo/second-source/actions/workflows/ci.yml)
38
+ [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Second%20Source%20Claim%20Check-2ea44f?logo=github)](https://github.com/marketplace/actions/second-source-claim-check)
39
+ [![License](https://img.shields.io/github/license/Rarebuffalo/second-source)](LICENSE)
40
+
41
+ Second Source checks the claims that AI coding agents make in pull requests against GitHub's
42
+ own record. When an agent writes "all tests pass" or "Fixes #123", Second Source looks at the
43
+ CI jobs on that commit, the files the PR changed, the issue's state and the branch's history,
44
+ and reports which claims hold up. It is deterministic: rules decide every verdict, and no
45
+ language model reads the PR.
46
+
47
+ It runs as a GitHub Action on every agent pull request, or as a command-line tool on any public
48
+ PR. It supports Claude Code, Codex, Copilot, Cursor, Devin and Jules.
49
+
50
+ ```text
51
+ $ uvx second-source check https://github.com/Rarebuffalo/second-source-sandbox/pull/9
52
+
53
+ Second Source · Rarebuffalo/second-source-sandbox#9 · https://github.com/Rarebuffalo/second-source-sandbox/pull/9
54
+ Agent: claude_code (detected by body_marker: Generated with [Claude Code])
55
+ Claims: 1 contradicted
56
+
57
+ ✘ contradicted Tests pass
58
+ said in body: "All tests pass."
59
+ why: a matching CI job failed
60
+ - coding.ci_result: 0 of 1 matching CI jobs passed
61
+
62
+ Evidence at a glance (from GitHub, whatever was claimed):
63
+ - CI on the head commit: 1 passed, 1 failed (test)
64
+ - Change: 2 file(s) changed; test files changed
65
+ - Not merged
66
+
67
+ GitHub API requests: 7
68
+ ```
69
+
70
+ > [!NOTE]
71
+ > Second Source is in beta (0.6). Verdicts are advice by default and never block a merge.
72
+ > Interfaces may change before 1.0.
73
+
74
+ ## Quickstart
75
+
76
+ Check a single pull request from the command line, with
77
+ [uv](https://docs.astral.sh/uv/) installed:
78
+
79
+ ```bash
80
+ uvx second-source check https://github.com/OWNER/REPO/pull/123
81
+ ```
82
+
83
+ To check every agent pull request, add the Action to a repository. From the repository's root:
84
+
85
+ ```bash
86
+ uvx second-source init
87
+ ```
88
+
89
+ This writes `.github/workflows/second-source.yml`, with your CI workflows already listed so
90
+ verdicts update when CI finishes. Commit it, and the next agent pull request gets a
91
+ "Second Source" check. The [GitHub Action reference](docs/action.md) shows the workflow in full
92
+ and explains each input and permission.
93
+
94
+ ## What it checks
95
+
96
+ | Claim | Checked against |
97
+ |---|---|
98
+ | Tests pass, build succeeds, lint passes | CI jobs on the commit the claim refers to |
99
+ | Tests added, docs updated | The files the pull request changed |
100
+ | Fixes an issue | The issue was closed by the merge, and stays closed for 30 days |
101
+ | Deployed | GitHub deployment records for the commit |
102
+ | The merge holds (every merged PR) | No revert of the merge within 30 days |
103
+
104
+ Each claim is verified, contradicted, pending or unverifiable. Every check also ends with the
105
+ evidence itself (CI on the head commit, what the change touched, merge and revert state), so it
106
+ is useful on pull requests that make no claims. See [Claims and verdicts](docs/claims.md).
107
+
108
+ ## Properties
109
+
110
+ - **Missing evidence is never a contradiction.** A claim is contradicted only when GitHub's
111
+ record clearly disagrees with it, for example when the test job failed on that commit. When
112
+ evidence is missing, expired or ambiguous, the verdict is unverifiable.
113
+ - **Deterministic.** Claims are found with rules whose precision is measured on a labelled set
114
+ of real agent pull requests, and checks are small YAML files with [CEL](https://cel.dev)
115
+ expressions. The same evidence always gives the same verdict.
116
+ - **Checked while the evidence exists.** Since October 2026, GitHub deletes check runs, workflow
117
+ runs and commit statuses after 90 days by default (at most 90 on public repositories, 400 on
118
+ private ones; [GitHub changelog](https://github.blog/changelog/2026-10-01-actions-retention-now-covers-checks-runs-and-statuses/)),
119
+ so a claim that is not checked when the pull request is made often cannot be checked later. The Action checks at that
120
+ moment and keeps watching merged claims for reverts and reopened issues.
121
+ - **Hard to game.** A verification is withdrawn when the same pull request skips tests, weakens
122
+ how CI runs them or lowers a coverage gate.
123
+ - **Safe on `pull_request_target`.** The Action never checks out or runs pull request code,
124
+ treats all PR text as untrusted, and needs no secrets. See the
125
+ [security model](docs/security-model.md).
126
+
127
+ ## How it works
128
+
129
+ ```text
130
+ pull request ─> detect agent ─> extract claims ─> fetch the evidence those claims need
131
+ ─> run checks (YAML + CEL) ─> verdicts ─> check run, CLI report or JSON
132
+ ```
133
+
134
+ The engine knows nothing about code: claims, evidence and checks are generic, and a coding pack
135
+ supplies the coding-specific rules. [How it works](docs/how-it-works.md) explains each step.
136
+
137
+ ## Accuracy
138
+
139
+ Claim extraction is measured on 402 real agent pull requests from the
140
+ [AIDev](https://huggingface.co/datasets/hao-li/AIDev) dataset, half of them held out. On the
141
+ held-out half, precision is 1.00 for issue references and lint claims and 0.88 for "tests pass"
142
+ claims. In a benchmark of 1,175 merged agent pull requests, 2 of the 385 that could still be
143
+ checked had a claim that GitHub's record contradicts; most older "tests pass" claims could no
144
+ longer be checked because GitHub had deleted the CI runs. [Accuracy](docs/accuracy.md) covers
145
+ the method, its limits and the open data.
146
+
147
+ ## Documentation
148
+
149
+ - New to Second Source: [Quickstart](docs/quickstart.md), then the [FAQ](docs/faq.md)
150
+ - Using the Action: [GitHub Action reference](docs/action.md) and
151
+ [Troubleshooting](docs/troubleshooting.md)
152
+ - Using the CLI: [CLI reference](docs/cli.md)
153
+ - Reading results: [Claims and verdicts](docs/claims.md)
154
+ - Security reviewers: [Security model](docs/security-model.md) and [SECURITY.md](SECURITY.md)
155
+ - Researchers: [Accuracy](docs/accuracy.md) and the [benchmark method](docs/benchmark.md)
156
+ - Contributors: [CONTRIBUTING.md](CONTRIBUTING.md) and the [architecture](docs/ARCHITECTURE.md)
157
+
158
+ The full index is in [docs/](docs/README.md); release notes are in [CHANGELOG.md](CHANGELOG.md).
159
+
160
+ ## License
161
+
162
+ Second Source is licensed under [Apache-2.0](LICENSE). The golden set and the benchmark use the
163
+ AIDev dataset by Hao Li et al. ([hao-li/AIDev](https://huggingface.co/datasets/hao-li/AIDev)),
164
+ licensed CC-BY-4.0; the PR texts in the golden set remain under that licence (see
165
+ [NOTICE](NOTICE)).
@@ -0,0 +1,136 @@
1
+ <picture>
2
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/logo-dark.png">
3
+ <img src="docs/assets/logo-light.png" width="340" alt="Second Source">
4
+ </picture>
5
+ <br/><br/>
6
+
7
+ [![PyPI](https://img.shields.io/pypi/v/second-source)](https://pypi.org/project/second-source/)
8
+ [![CI](https://github.com/Rarebuffalo/second-source/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Rarebuffalo/second-source/actions/workflows/ci.yml)
9
+ [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Second%20Source%20Claim%20Check-2ea44f?logo=github)](https://github.com/marketplace/actions/second-source-claim-check)
10
+ [![License](https://img.shields.io/github/license/Rarebuffalo/second-source)](LICENSE)
11
+
12
+ Second Source checks the claims that AI coding agents make in pull requests against GitHub's
13
+ own record. When an agent writes "all tests pass" or "Fixes #123", Second Source looks at the
14
+ CI jobs on that commit, the files the PR changed, the issue's state and the branch's history,
15
+ and reports which claims hold up. It is deterministic: rules decide every verdict, and no
16
+ language model reads the PR.
17
+
18
+ It runs as a GitHub Action on every agent pull request, or as a command-line tool on any public
19
+ PR. It supports Claude Code, Codex, Copilot, Cursor, Devin and Jules.
20
+
21
+ ```text
22
+ $ uvx second-source check https://github.com/Rarebuffalo/second-source-sandbox/pull/9
23
+
24
+ Second Source · Rarebuffalo/second-source-sandbox#9 · https://github.com/Rarebuffalo/second-source-sandbox/pull/9
25
+ Agent: claude_code (detected by body_marker: Generated with [Claude Code])
26
+ Claims: 1 contradicted
27
+
28
+ ✘ contradicted Tests pass
29
+ said in body: "All tests pass."
30
+ why: a matching CI job failed
31
+ - coding.ci_result: 0 of 1 matching CI jobs passed
32
+
33
+ Evidence at a glance (from GitHub, whatever was claimed):
34
+ - CI on the head commit: 1 passed, 1 failed (test)
35
+ - Change: 2 file(s) changed; test files changed
36
+ - Not merged
37
+
38
+ GitHub API requests: 7
39
+ ```
40
+
41
+ > [!NOTE]
42
+ > Second Source is in beta (0.6). Verdicts are advice by default and never block a merge.
43
+ > Interfaces may change before 1.0.
44
+
45
+ ## Quickstart
46
+
47
+ Check a single pull request from the command line, with
48
+ [uv](https://docs.astral.sh/uv/) installed:
49
+
50
+ ```bash
51
+ uvx second-source check https://github.com/OWNER/REPO/pull/123
52
+ ```
53
+
54
+ To check every agent pull request, add the Action to a repository. From the repository's root:
55
+
56
+ ```bash
57
+ uvx second-source init
58
+ ```
59
+
60
+ This writes `.github/workflows/second-source.yml`, with your CI workflows already listed so
61
+ verdicts update when CI finishes. Commit it, and the next agent pull request gets a
62
+ "Second Source" check. The [GitHub Action reference](docs/action.md) shows the workflow in full
63
+ and explains each input and permission.
64
+
65
+ ## What it checks
66
+
67
+ | Claim | Checked against |
68
+ |---|---|
69
+ | Tests pass, build succeeds, lint passes | CI jobs on the commit the claim refers to |
70
+ | Tests added, docs updated | The files the pull request changed |
71
+ | Fixes an issue | The issue was closed by the merge, and stays closed for 30 days |
72
+ | Deployed | GitHub deployment records for the commit |
73
+ | The merge holds (every merged PR) | No revert of the merge within 30 days |
74
+
75
+ Each claim is verified, contradicted, pending or unverifiable. Every check also ends with the
76
+ evidence itself (CI on the head commit, what the change touched, merge and revert state), so it
77
+ is useful on pull requests that make no claims. See [Claims and verdicts](docs/claims.md).
78
+
79
+ ## Properties
80
+
81
+ - **Missing evidence is never a contradiction.** A claim is contradicted only when GitHub's
82
+ record clearly disagrees with it, for example when the test job failed on that commit. When
83
+ evidence is missing, expired or ambiguous, the verdict is unverifiable.
84
+ - **Deterministic.** Claims are found with rules whose precision is measured on a labelled set
85
+ of real agent pull requests, and checks are small YAML files with [CEL](https://cel.dev)
86
+ expressions. The same evidence always gives the same verdict.
87
+ - **Checked while the evidence exists.** Since October 2026, GitHub deletes check runs, workflow
88
+ runs and commit statuses after 90 days by default (at most 90 on public repositories, 400 on
89
+ private ones; [GitHub changelog](https://github.blog/changelog/2026-10-01-actions-retention-now-covers-checks-runs-and-statuses/)),
90
+ so a claim that is not checked when the pull request is made often cannot be checked later. The Action checks at that
91
+ moment and keeps watching merged claims for reverts and reopened issues.
92
+ - **Hard to game.** A verification is withdrawn when the same pull request skips tests, weakens
93
+ how CI runs them or lowers a coverage gate.
94
+ - **Safe on `pull_request_target`.** The Action never checks out or runs pull request code,
95
+ treats all PR text as untrusted, and needs no secrets. See the
96
+ [security model](docs/security-model.md).
97
+
98
+ ## How it works
99
+
100
+ ```text
101
+ pull request ─> detect agent ─> extract claims ─> fetch the evidence those claims need
102
+ ─> run checks (YAML + CEL) ─> verdicts ─> check run, CLI report or JSON
103
+ ```
104
+
105
+ The engine knows nothing about code: claims, evidence and checks are generic, and a coding pack
106
+ supplies the coding-specific rules. [How it works](docs/how-it-works.md) explains each step.
107
+
108
+ ## Accuracy
109
+
110
+ Claim extraction is measured on 402 real agent pull requests from the
111
+ [AIDev](https://huggingface.co/datasets/hao-li/AIDev) dataset, half of them held out. On the
112
+ held-out half, precision is 1.00 for issue references and lint claims and 0.88 for "tests pass"
113
+ claims. In a benchmark of 1,175 merged agent pull requests, 2 of the 385 that could still be
114
+ checked had a claim that GitHub's record contradicts; most older "tests pass" claims could no
115
+ longer be checked because GitHub had deleted the CI runs. [Accuracy](docs/accuracy.md) covers
116
+ the method, its limits and the open data.
117
+
118
+ ## Documentation
119
+
120
+ - New to Second Source: [Quickstart](docs/quickstart.md), then the [FAQ](docs/faq.md)
121
+ - Using the Action: [GitHub Action reference](docs/action.md) and
122
+ [Troubleshooting](docs/troubleshooting.md)
123
+ - Using the CLI: [CLI reference](docs/cli.md)
124
+ - Reading results: [Claims and verdicts](docs/claims.md)
125
+ - Security reviewers: [Security model](docs/security-model.md) and [SECURITY.md](SECURITY.md)
126
+ - Researchers: [Accuracy](docs/accuracy.md) and the [benchmark method](docs/benchmark.md)
127
+ - Contributors: [CONTRIBUTING.md](CONTRIBUTING.md) and the [architecture](docs/ARCHITECTURE.md)
128
+
129
+ The full index is in [docs/](docs/README.md); release notes are in [CHANGELOG.md](CHANGELOG.md).
130
+
131
+ ## License
132
+
133
+ Second Source is licensed under [Apache-2.0](LICENSE). The golden set and the benchmark use the
134
+ AIDev dataset by Hao Li et al. ([hao-li/AIDev](https://huggingface.co/datasets/hao-li/AIDev)),
135
+ licensed CC-BY-4.0; the PR texts in the golden set remain under that licence (see
136
+ [NOTICE](NOTICE)).
@@ -27,9 +27,21 @@ inputs:
27
27
  fail-on-contradiction:
28
28
  description: Make the check fail when a claim is contradicted (by default it is advice and never blocks a merge).
29
29
  default: "false"
30
+ comment:
31
+ description: Keep the verdicts and their evidence in one comment on each agent PR, edited in place, so they outlive GitHub's deletion of check runs (at most 90 days on public repositories). Set to "false" to switch it off.
32
+ default: "true"
30
33
  ignore-claims:
31
34
  description: Claim types to switch off, comma-separated (TESTS_PASS, BUILD_OK, LINT_OK, TESTS_ADDED, DOCS_UPDATED, FIXES_ISSUE, DEPLOYED). They are neither checked nor shown.
32
35
  default: ""
36
+ test-jobs:
37
+ description: CI job names that run your tests, comma-separated; shell wildcards allowed (for example "ci, gate*"). Adds to the names Second Source recognises on its own.
38
+ default: ""
39
+ build-jobs:
40
+ description: CI job names that build your project, comma-separated; wildcards allowed.
41
+ default: ""
42
+ lint-jobs:
43
+ description: CI job names that lint or type-check, comma-separated; wildcards allowed.
44
+ default: ""
33
45
  sweep-days:
34
46
  description: How far back (in days) the scheduled sweep re-checks agent pull requests.
35
47
  default: "30"
@@ -73,6 +85,11 @@ runs:
73
85
  INPUT_FAIL_ON_CONTRADICTION: ${{ inputs.fail-on-contradiction }}
74
86
  INPUT_SWEEP_DAYS: ${{ inputs.sweep-days }}
75
87
  INPUT_IGNORE_CLAIMS: ${{ inputs.ignore-claims }}
88
+ INPUT_COMMENT: ${{ inputs.comment }}
89
+ SECOND_SOURCE_DEFAULT_TOKEN: ${{ inputs.github-token == github.token }}
90
+ INPUT_TEST_JOBS: ${{ inputs.test-jobs }}
91
+ INPUT_BUILD_JOBS: ${{ inputs.build-jobs }}
92
+ INPUT_LINT_JOBS: ${{ inputs.lint-jobs }}
76
93
  run: >-
77
94
  uv run --no-sync --frozen --project "$GITHUB_ACTION_PATH"
78
95
  python -m second_source.cli.main action
@@ -1,8 +1,7 @@
1
1
  # Second Source architecture
2
2
 
3
- This document is for contributors. It describes how the code is organised, the contracts
4
- between its parts, and the order in which it is being built. Sections marked *(planned)*
5
- describe parts that do not exist yet.
3
+ This document is for contributors. It describes how the code is organised and the contracts
4
+ between its parts. For what the product does, start with [How it works](how-it-works.md).
6
5
 
7
6
  ## 1. What we are building
8
7
 
@@ -18,7 +17,7 @@ There are three ways to use it, and all of them share one engine:
18
17
  | Surface | Who it is for | How it runs | Cost |
19
18
  |---|---|---|---|
20
19
  | CLI: `second-source check <PR URL>` | Anyone who wants to try it in 10 seconds | Locally via `uvx` / `pipx` | Free |
21
- | GitHub Action *(planned)* | Repositories that want every agent PR checked | In the repo's own GitHub Actions | Free on public repos |
20
+ | GitHub Action | Repositories that want every agent PR checked | In the repo's own GitHub Actions | Free on public repos |
22
21
  | Benchmark (Agent Claim Truth): `second-source bench` | Everyone comparing agents | Batch pipeline; results to be published as a static site and dataset | Free |
23
22
 
24
23
  ## 2. Design principles
@@ -220,7 +219,7 @@ A pack is a directory containing:
220
219
  |---|---|
221
220
  | Core check evaluation | `UNVERIFIABLE(ENGINE_ERROR)`; continue with other checks |
222
221
  | Source (network, API) | Retries with backoff, then marks affected evidence types as stale |
223
- | Action *(planned)* | Never fails the user's workflow because of our bugs. Posts a neutral check saying "could not verify" |
222
+ | Action | Never fails the user's workflow because of our bugs. Posts a neutral check saying "could not verify" |
224
223
  | CLI | Clear message and a non-zero exit code. `--json` gives machine-readable errors |
225
224
 
226
225
  ## 8. Testing
@@ -243,20 +242,19 @@ A pack is a directory containing:
243
242
  `v1`; `second-source init` writes the one matching its own version) and each pack.
244
243
  - Every change is a small, focused commit; `scripts/check.sh` must pass before each one.
245
244
 
246
- ## 10. Build plan
245
+ ## 10. GitHub Action
247
246
 
248
- Each step is committed as its own commit, one file per commit where possible.
249
-
250
- | Milestone | Status | Steps |
251
- |---|---|---|
252
- | M0 Core engine | done | model → hashing → evidence → expr → checks → aggregate → engine → pack loader → tests (unit, non-coding fixtures, replay) → CI workflow |
253
- | M1 Coding pack | done | agent detection rules → claim grammar → referenced-commit resolution → checks (tests pass, build/lint, tests added, fixes issue, docs updated, deployed) → durability checks → golden set |
254
- | M2 GitHub source + CLI | done | API client (auth chain, ETag cache, rate limits) → mappers → `second-source check <PR URL>` → Markdown/JSON reports → recorded fixtures |
255
- | M3 Benchmark | in progress | AIDev sampling (dataset viewer API, see docs/benchmark.md) → batch runner with cache → statistics (Wilson intervals) → result files |
256
- | M4 Action | built; release pending | `action.yml` → entrypoint (event parsing, wait-for-CI, check run + job summary) → daily durability mode → dispute command → one-click setup link |
257
- | M5 Launch | planned | static site → dataset release → README, GIF and docs → open-source hygiene files → Marketplace listing |
258
-
259
- ## 11. Open decisions
247
+ ```
248
+ src/second_source/action/
249
+ inputs.py read and validate the Action's inputs from the environment
250
+ event.py GitHub event payload -> mode (check, sweep, command, skip) and target PRs
251
+ wait.py poll until CI settles or the wait budget ends (injectable clock and sleep)
252
+ publish.py check run create/update, conclusion mapping, job summary
253
+ commands.py parse /second-source commands, permission check, dispute
254
+ sweep.py find recent agent PRs for the daily run
255
+ setup.py `second-source init`: the recommended workflow
256
+ main.py `second-source action` entrypoint tying the above together
257
+ action.yml the composite action
258
+ ```
260
259
 
261
- - Docker vs composite Action (start with composite plus `uv` for speed; measure).
262
- - Whether the benchmark site lives in this repo or a separate one.
260
+ Behaviour visible to users is documented in the [GitHub Action reference](action.md).
@@ -0,0 +1,33 @@
1
+ # Second Source documentation
2
+
3
+ ## Get started
4
+
5
+ - [Quickstart](quickstart.md): add the Action to a repository, or check one pull request from
6
+ the command line.
7
+ - [FAQ](faq.md): short answers to common questions.
8
+
9
+ ## Use
10
+
11
+ - [GitHub Action reference](action.md): the workflow, inputs, permissions, events, the check
12
+ run, commands, pinning, cost and limits.
13
+ - [CLI reference](cli.md): `second-source check`, `init` and `bench`, options, exit codes and
14
+ JSON output.
15
+ - [Claims and verdicts](claims.md): what is checked, the four verdicts, integrity guards and
16
+ every reason a report can give.
17
+ - [Troubleshooting](troubleshooting.md): a check that waits, shows no claims, or looks wrong.
18
+
19
+ ## Understand
20
+
21
+ - [How it works](how-it-works.md): from a pull request to a verdict.
22
+ - [Accuracy](accuracy.md): how extraction is measured, the benchmark results and their limits.
23
+ - [Security model](security-model.md): what is trusted, what is not, and why the Action is safe
24
+ on `pull_request_target`.
25
+
26
+ ## Contribute
27
+
28
+ - [CONTRIBUTING.md](../CONTRIBUTING.md): set-up, how changes are made, releasing.
29
+ - [Architecture](ARCHITECTURE.md): layers, contracts and the engine.
30
+ - [Coding pack](packs/coding.md): claim types, extraction rules, the evidence contract and the
31
+ complete list of contradiction paths.
32
+ - [GitHub source](sources/github.md): endpoints, commits, caching and errors.
33
+ - [Benchmark method](benchmark.md) and the [run 2 data](benchmark-data/run2/README.md).
@@ -0,0 +1,66 @@
1
+ # Accuracy
2
+
3
+ Two questions matter: does Second Source find the claims an agent really made (extraction), and
4
+ are its verdicts right (checking)? This page summarises how each is measured and what the
5
+ results are. The full method is in the [benchmark design](benchmark.md).
6
+
7
+ ## Extraction
8
+
9
+ Extraction is measured on a golden set of 402 real agent pull requests from the
10
+ [AIDev](https://huggingface.co/datasets/hao-li/AIDev) dataset, 67 per agent. Every body was
11
+ labelled by two labellers working independently from a written guide; they agreed exactly on
12
+ 96% of pull requests, and disagreements were adjudicated. Both labellers were AI model sessions,
13
+ each given only the guide and the text. Because they are the same kind of model, their agreement
14
+ overstates independence; a human audit of a sample is planned.
15
+
16
+ Half the set is used to develop the rules; the other half is scored only to report. A rule is
17
+ trusted, and its claims marked high confidence, only if it fired at least five times on the
18
+ development half with precision of at least 0.95.
19
+
20
+ High-confidence precision on the held-out half:
21
+
22
+ | Claim | Precision |
23
+ |---|---|
24
+ | Fixes an issue | 1.00 |
25
+ | Lint passes | 1.00 |
26
+ | Tests added | 0.90 |
27
+ | Tests pass | 0.88 |
28
+ | Docs updated | 0.83 |
29
+
30
+ No build-claim rule qualifies yet. Because some types are below 0.95, a contradicted verdict is
31
+ best treated as a strong signal for a person to confirm. The labelling guide, the cases and the
32
+ per-rule numbers are in [tests/packs/coding/golden/real](../tests/packs/coding/golden/real/README.md).
33
+
34
+ ## Checking: benchmark run 2
35
+
36
+ 1,200 merged agent pull requests were drawn from AIDev, 200 per agent, at most 3 per repository;
37
+ 1,175 were still on GitHub. Each was checked against GitHub, and every verdict was then
38
+ recomputed offline on one code version. The contradictions and a sample of verifications were
39
+ audited blind.
40
+
41
+ - Of 385 pull requests with a written claim that could still be checked, 2 had a claim that
42
+ GitHub's record contradicts. Both were "Fixes #N" with the issue still open after the merge.
43
+ - The evidence expires. Every "tests pass" claim that could be verified was under a year old;
44
+ for 42 of the 43 older ones, GitHub had already deleted the CI runs. Since October 2026, GitHub
45
+ deletes check runs and workflow runs after at most 90 days on public repositories ([GitHub changelog](https://github.blog/changelog/2026-10-01-actions-retention-now-covers-checks-runs-and-statuses/)).
46
+ - 7 of 979 checkable merges were found reverted.
47
+
48
+ Read these with their limits. Contradictions are a floor, not a rate: checks contradict only on
49
+ unambiguous evidence, and "tests added" and "docs updated" never contradict. Only merged pull
50
+ requests were sampled, and pull requests within one repository are not independent. The
51
+ aggregate results are published as [open data](benchmark-data/run2/README.md); per-PR verdicts
52
+ are not, because a contradicted row would name the pull request's author.
53
+
54
+ ## Live testing
55
+
56
+ Before release, the Action ran on a sandbox repository with 30 agent pull requests: scripted ones
57
+ with deliberately false or gamed claims, and uncoached ones written by fresh agent sessions.
58
+ Every verdict matched the expected result, including merges, reverts, a revert of a revert and a
59
+ reopened issue.
60
+
61
+ ## Related work
62
+
63
+ [testreceipt](https://github.com/amos689/testreceipt) checks "tests pass" claims against CI on
64
+ AIDev and on 2026 pull requests, and reports CI test failures for 8.7% of 2025 claims and 0.3% of
65
+ 2026 claims, measured while the CI results still existed. Its figures sit alongside ours rather
66
+ than against them; see the [benchmark design](benchmark.md#related-work-and-a-comparable-cell).