oqllm-api 0.2.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 (204) hide show
  1. oqllm_api-0.2.0/.aider.conf.yml +22 -0
  2. oqllm_api-0.2.0/.cursor/rules/new-project-standard.mdc +36 -0
  3. oqllm_api-0.2.0/.env.example +37 -0
  4. oqllm_api-0.2.0/.gitattributes +3 -0
  5. oqllm_api-0.2.0/.githooks/commit-msg +38 -0
  6. oqllm_api-0.2.0/.githooks/pre-commit +222 -0
  7. oqllm_api-0.2.0/.githooks/pre-push +76 -0
  8. oqllm_api-0.2.0/.github/copilot-instructions.md +36 -0
  9. oqllm_api-0.2.0/.github/workflows/new-project-branch-hygiene.yml +27 -0
  10. oqllm_api-0.2.0/.github/workflows/new-project-governance.yml +266 -0
  11. oqllm_api-0.2.0/.gitignore +23 -0
  12. oqllm_api-0.2.0/.governance/AGENT_DECISIONS.md +116 -0
  13. oqllm_api-0.2.0/.governance/adoption-bindings.json +10 -0
  14. oqllm_api-0.2.0/.governance/adoption-bindings.schema.json +29 -0
  15. oqllm_api-0.2.0/.governance/agent-hosts.json +137 -0
  16. oqllm_api-0.2.0/.governance/agent-hosts.schema.json +179 -0
  17. oqllm_api-0.2.0/.governance/agent_host_check.py +762 -0
  18. oqllm_api-0.2.0/.governance/approval-evidence.schema.json +89 -0
  19. oqllm_api-0.2.0/.governance/bootstrap_packaging_scope.py +267 -0
  20. oqllm_api-0.2.0/.governance/branch-intent-reconciliation.schema.json +544 -0
  21. oqllm_api-0.2.0/.governance/branch_intent_reconciliation.py +219 -0
  22. oqllm_api-0.2.0/.governance/branch_lifecycle_check.py +256 -0
  23. oqllm_api-0.2.0/.governance/change-evaluation.schema.json +357 -0
  24. oqllm_api-0.2.0/.governance/change-lease.schema.json +90 -0
  25. oqllm_api-0.2.0/.governance/change_lease_check.py +536 -0
  26. oqllm_api-0.2.0/.governance/check_required_checks.py +396 -0
  27. oqllm_api-0.2.0/.governance/continuity_namespace.py +175 -0
  28. oqllm_api-0.2.0/.governance/controller_store_compaction.py +614 -0
  29. oqllm_api-0.2.0/.governance/decision-record.schema.json +95 -0
  30. oqllm_api-0.2.0/.governance/decision_record.py +507 -0
  31. oqllm_api-0.2.0/.governance/diagnostics.json +550 -0
  32. oqllm_api-0.2.0/.governance/diagnostics.schema.json +33 -0
  33. oqllm_api-0.2.0/.governance/docs/BRANCH_INTENT_RECONCILIATION.md +105 -0
  34. oqllm_api-0.2.0/.governance/docs/LOCAL_CI_PUBLICATION.md +31 -0
  35. oqllm_api-0.2.0/.governance/docs/SNAPSHOT_MIGRATION.md +162 -0
  36. oqllm_api-0.2.0/.governance/docs/information/continuity-namespaces.md +92 -0
  37. oqllm_api-0.2.0/.governance/docs.json +7 -0
  38. oqllm_api-0.2.0/.governance/error/GOV-AGENT-HOST.md +80 -0
  39. oqllm_api-0.2.0/.governance/error/GOV-APPROVAL.md +101 -0
  40. oqllm_api-0.2.0/.governance/error/GOV-ARCHITECTURE-001.md +68 -0
  41. oqllm_api-0.2.0/.governance/error/GOV-CHANGE-LEASE.md +93 -0
  42. oqllm_api-0.2.0/.governance/error/GOV-HOST-MERGE.md +43 -0
  43. oqllm_api-0.2.0/.governance/error/GOV-IDLE-TAKEOVER.md +192 -0
  44. oqllm_api-0.2.0/.governance/error/GOV-INTENT.md +80 -0
  45. oqllm_api-0.2.0/.governance/error/GOV-PACKAGING.md +73 -0
  46. oqllm_api-0.2.0/.governance/error/GOV-PHYS.md +47 -0
  47. oqllm_api-0.2.0/.governance/error/GOV-PUSH.md +42 -0
  48. oqllm_api-0.2.0/.governance/error/GOV-REMEDIATION-INTENT.md +57 -0
  49. oqllm_api-0.2.0/.governance/error/GOV-SNAPSHOT-MIGRATION.md +45 -0
  50. oqllm_api-0.2.0/.governance/error/GOV-STANDARD-UPDATE.md +45 -0
  51. oqllm_api-0.2.0/.governance/error/GOV-TICKET-001.md +42 -0
  52. oqllm_api-0.2.0/.governance/error/GOV-TICKET-ACTIVITY.md +53 -0
  53. oqllm_api-0.2.0/.governance/error/GOV-TICKET-ALLOCATION.md +90 -0
  54. oqllm_api-0.2.0/.governance/error/GOV-VERSION.md +54 -0
  55. oqllm_api-0.2.0/.governance/error/GOV-WORK-CONTINUITY.md +74 -0
  56. oqllm_api-0.2.0/.governance/error/GOV-WORK-START.md +259 -0
  57. oqllm_api-0.2.0/.governance/error/GOV-WORKSPACE-LIFECYCLE.md +102 -0
  58. oqllm_api-0.2.0/.governance/error/GOV-WORKTREE-OVERLAP.md +82 -0
  59. oqllm_api-0.2.0/.governance/error/README.md +24 -0
  60. oqllm_api-0.2.0/.governance/generate_required_checks.py +567 -0
  61. oqllm_api-0.2.0/.governance/governance_check.py +5702 -0
  62. oqllm_api-0.2.0/.governance/idle_takeover.py +880 -0
  63. oqllm_api-0.2.0/.governance/intent.schema.json +384 -0
  64. oqllm_api-0.2.0/.governance/legacy_terminal_retirement.py +196 -0
  65. oqllm_api-0.2.0/.governance/local-ci-publication.json +6 -0
  66. oqllm_api-0.2.0/.governance/lock.schema.json +31 -0
  67. oqllm_api-0.2.0/.governance/managed-copies.json +6 -0
  68. oqllm_api-0.2.0/.governance/manifest.base.json +169 -0
  69. oqllm_api-0.2.0/.governance/manifest.json +295 -0
  70. oqllm_api-0.2.0/.governance/manifest.lock.json +140 -0
  71. oqllm_api-0.2.0/.governance/manifest.schema.json +284 -0
  72. oqllm_api-0.2.0/.governance/owner_handoff.py +496 -0
  73. oqllm_api-0.2.0/.governance/package-manifest.json +815 -0
  74. oqllm_api-0.2.0/.governance/physical-contracts.schema.json +33 -0
  75. oqllm_api-0.2.0/.governance/policy-dsl.lock.json +17 -0
  76. oqllm_api-0.2.0/.governance/policy_dsl_check.py +1201 -0
  77. oqllm_api-0.2.0/.governance/precommit_standard_update.py +141 -0
  78. oqllm_api-0.2.0/.governance/prune_merged_worktrees.py +848 -0
  79. oqllm_api-0.2.0/.governance/remediation-intent.schema.json +458 -0
  80. oqllm_api-0.2.0/.governance/remediation-intent.template.dsl.json +144 -0
  81. oqllm_api-0.2.0/.governance/remediation_intent.py +2000 -0
  82. oqllm_api-0.2.0/.governance/repository_policy.py +470 -0
  83. oqllm_api-0.2.0/.governance/required-checks.json +15 -0
  84. oqllm_api-0.2.0/.governance/required-checks.schema.json +154 -0
  85. oqllm_api-0.2.0/.governance/reusable-workflows.schema.json +25 -0
  86. oqllm_api-0.2.0/.governance/seed_baseline.py +273 -0
  87. oqllm_api-0.2.0/.governance/snapshot-migration.schema.json +139 -0
  88. oqllm_api-0.2.0/.governance/snapshot_allocation.py +343 -0
  89. oqllm_api-0.2.0/.governance/snapshot_migration.py +282 -0
  90. oqllm_api-0.2.0/.governance/stack-profiles.json +14 -0
  91. oqllm_api-0.2.0/.governance/standard-adoption-plan.schema.json +623 -0
  92. oqllm_api-0.2.0/.governance/standard-adoption.json +13 -0
  93. oqllm_api-0.2.0/.governance/standard-adoption.schema.json +42 -0
  94. oqllm_api-0.2.0/.governance/standard-packs.json +307 -0
  95. oqllm_api-0.2.0/.governance/standard-propagation-request.schema.json +70 -0
  96. oqllm_api-0.2.0/.governance/standard-requirements.json +44 -0
  97. oqllm_api-0.2.0/.governance/standard_pack_check.py +327 -0
  98. oqllm_api-0.2.0/.governance/templates/conftest-worktree-bootstrap.py +52 -0
  99. oqllm_api-0.2.0/.governance/terminal-receipt-registry.schema.json +28 -0
  100. oqllm_api-0.2.0/.governance/terminal_lease_release.py +583 -0
  101. oqllm_api-0.2.0/.governance/ticket-activity-override.schema.json +13 -0
  102. oqllm_api-0.2.0/.governance/ticket-activity.json +20 -0
  103. oqllm_api-0.2.0/.governance/ticket-activity.schema.json +41 -0
  104. oqllm_api-0.2.0/.governance/ticket-allocation-receipt.schema.json +23 -0
  105. oqllm_api-0.2.0/.governance/ticket-allocation-request.schema.json +27 -0
  106. oqllm_api-0.2.0/.governance/ticket-allocation.json +5 -0
  107. oqllm_api-0.2.0/.governance/ticket-allocation.schema.json +37 -0
  108. oqllm_api-0.2.0/.governance/ticket_activity.py +887 -0
  109. oqllm_api-0.2.0/.governance/ticket_allocation.py +249 -0
  110. oqllm_api-0.2.0/.governance/ticket_index_merge_driver.py +178 -0
  111. oqllm_api-0.2.0/.governance/ticket_input.py +262 -0
  112. oqllm_api-0.2.0/.governance/ticket_recovery.py +261 -0
  113. oqllm_api-0.2.0/.governance/ticket_restoration.py +350 -0
  114. oqllm_api-0.2.0/.governance/ticket_storage.py +394 -0
  115. oqllm_api-0.2.0/.governance/work-classification.dsl.json +120 -0
  116. oqllm_api-0.2.0/.governance/work-classification.schema.json +180 -0
  117. oqllm_api-0.2.0/.governance/work-continuity.schema.json +320 -0
  118. oqllm_api-0.2.0/.governance/work-start-report.schema.json +429 -0
  119. oqllm_api-0.2.0/.governance/work_continuity.py +1442 -0
  120. oqllm_api-0.2.0/.governance/work_start_check.py +1714 -0
  121. oqllm_api-0.2.0/.governance/workspace_lifecycle_check.py +735 -0
  122. oqllm_api-0.2.0/.governance/worktree_guard.py +288 -0
  123. oqllm_api-0.2.0/.governance/worktree_overlap_check.py +1242 -0
  124. oqllm_api-0.2.0/.governance/worktree_path_check.py +583 -0
  125. oqllm_api-0.2.0/.governance/worktrees.lock.json +27 -0
  126. oqllm_api-0.2.0/.governance/worktrees.schema.json +193 -0
  127. oqllm_api-0.2.0/.planfile/.store.lock +0 -0
  128. oqllm_api-0.2.0/.planfile/config.yaml +19 -0
  129. oqllm_api-0.2.0/.planfile/config.yaml.fast.json +1 -0
  130. oqllm_api-0.2.0/.planfile/events/.logs.dsl.date +1 -0
  131. oqllm_api-0.2.0/.planfile/events/.logs.dsl.v1 +1 -0
  132. oqllm_api-0.2.0/.planfile/events/logs.dsl.txt +3 -0
  133. oqllm_api-0.2.0/.planfile/events/operations.jsonl +3 -0
  134. oqllm_api-0.2.0/.planfile/index/allocator-journal.json +1 -0
  135. oqllm_api-0.2.0/.planfile/sprints/backlog.yaml +70 -0
  136. oqllm_api-0.2.0/.planfile/sprints/backlog.yaml.fast.json +1 -0
  137. oqllm_api-0.2.0/.planfile/sprints/current.yaml +51 -0
  138. oqllm_api-0.2.0/.planfile/sprints/current.yaml.fast.json +1 -0
  139. oqllm_api-0.2.0/.planfile/sprints/index/allocator-dedupe/79e624f0391b168a698c08dfcbaa4ff6bca9c7d6e158706e6d0c6367428333b3.json +1 -0
  140. oqllm_api-0.2.0/.planfile/sprints/index/allocator-dedupe/f9e9b0a9924165357e281bf2c584e447b2a70fe355f38d60e2b39f69fdcd58f3.json +1 -0
  141. oqllm_api-0.2.0/.planfile/sprints/index/allocator-sprints/2615f50b927357ad31004241c80e171f909c059aa0c1c4faa5453ec9d8feeb90.json +1 -0
  142. oqllm_api-0.2.0/.planfile/sprints/index/allocator-sprints/7f86b9a25c4560cac3c6347729cbf567672c52c95122a26234877249dba83f10.json +1 -0
  143. oqllm_api-0.2.0/.subactor/.gitignore +7 -0
  144. oqllm_api-0.2.0/.subactor/manifest.json +26 -0
  145. oqllm_api-0.2.0/.worktrees/ticket-001--heyasa-autonomy-registry-schemas/.env.example +30 -0
  146. oqllm_api-0.2.0/.worktrees/ticket-003--assign-schemas-openapi-adapters-workstreams/.env.example +37 -0
  147. oqllm_api-0.2.0/.worktrees/ticket-004--heyasa-esp32-note-and-hid-poa-procedures/.env.example +37 -0
  148. oqllm_api-0.2.0/.worktrees/ticket-005--add-stt-tts-vision-analysis-and-multimodal-chat-to-openapi-and-api-adapters/.env.example +37 -0
  149. oqllm_api-0.2.0/AGENTS.md +341 -0
  150. oqllm_api-0.2.0/CHANGELOG.md +5 -0
  151. oqllm_api-0.2.0/CLAUDE.md +40 -0
  152. oqllm_api-0.2.0/GEMINI.md +40 -0
  153. oqllm_api-0.2.0/LICENSE +109 -0
  154. oqllm_api-0.2.0/LICENSE.md +109 -0
  155. oqllm_api-0.2.0/PKG-INFO +165 -0
  156. oqllm_api-0.2.0/README.md +38 -0
  157. oqllm_api-0.2.0/TODO.md +3 -0
  158. oqllm_api-0.2.0/VERSION +1 -0
  159. oqllm_api-0.2.0/adapters/__init__.py +0 -0
  160. oqllm_api-0.2.0/adapters/asgi_python/__init__.py +0 -0
  161. oqllm_api-0.2.0/adapters/asgi_python/app.py +1154 -0
  162. oqllm_api-0.2.0/adapters/plesk_php/auth.php +942 -0
  163. oqllm_api-0.2.0/adapters/plesk_php/decide.php +303 -0
  164. oqllm_api-0.2.0/adapters/plesk_php/health.php +11 -0
  165. oqllm_api-0.2.0/adapters/plesk_php/index.php +24 -0
  166. oqllm_api-0.2.0/adapters/plesk_php/mesh.php +201 -0
  167. oqllm_api-0.2.0/adapters/plesk_php/models.php +11 -0
  168. oqllm_api-0.2.0/adapters/plesk_php/poa.php +619 -0
  169. oqllm_api-0.2.0/adapters/plesk_php/speech.php +350 -0
  170. oqllm_api-0.2.0/adapters/plesk_php/vision.php +379 -0
  171. oqllm_api-0.2.0/auth.py +968 -0
  172. oqllm_api-0.2.0/docs/README.md +7 -0
  173. oqllm_api-0.2.0/docs/index.html +166 -0
  174. oqllm_api-0.2.0/errors/README.md +5 -0
  175. oqllm_api-0.2.0/openapi/openapi.json +1149 -0
  176. oqllm_api-0.2.0/openapi/openapi.yaml +1379 -0
  177. oqllm_api-0.2.0/portal/index.html +987 -0
  178. oqllm_api-0.2.0/project/TICKETS.md +13 -0
  179. oqllm_api-0.2.0/project/governance-check.bat +15 -0
  180. oqllm_api-0.2.0/project/governance-check.sh +21 -0
  181. oqllm_api-0.2.0/project/new-ticket.sh +1369 -0
  182. oqllm_api-0.2.0/project/readme.sh +141 -0
  183. oqllm_api-0.2.0/project/ticket-001/README.md +46 -0
  184. oqllm_api-0.2.0/project/ticket-001/intent.json +258 -0
  185. oqllm_api-0.2.0/project/ticket-002/README.md +40 -0
  186. oqllm_api-0.2.0/project/ticket-002/intent.json +105 -0
  187. oqllm_api-0.2.0/project/ticket-003/README.md +21 -0
  188. oqllm_api-0.2.0/project/ticket-003/intent.json +24 -0
  189. oqllm_api-0.2.0/project/ticket-004/README.md +21 -0
  190. oqllm_api-0.2.0/project/ticket-004/intent.json +25 -0
  191. oqllm_api-0.2.0/project/ticket-005/README.md +36 -0
  192. oqllm_api-0.2.0/project/ticket-005/intent.json +31 -0
  193. oqllm_api-0.2.0/project.bat +35 -0
  194. oqllm_api-0.2.0/project.sh +38 -0
  195. oqllm_api-0.2.0/pyproject.toml +39 -0
  196. oqllm_api-0.2.0/schemas/registry.json +514 -0
  197. oqllm_api-0.2.0/scripts/deploy_plesk_all.py +277 -0
  198. oqllm_api-0.2.0/scripts/install-agent-hosts.sh +420 -0
  199. oqllm_api-0.2.0/scripts/runtime.sh +862 -0
  200. oqllm_api-0.2.0/scripts/standardize_all_oqllm.py +131 -0
  201. oqllm_api-0.2.0/tests/test_api.py +814 -0
  202. oqllm_api-0.2.0/tests/test_plesk_php_security.py +316 -0
  203. oqllm_api-0.2.0/wellmanifest_governance.py +175 -0
  204. oqllm_api-0.2.0/worktree-guard.yaml +65 -0
@@ -0,0 +1,22 @@
1
+ # <!-- wellmanifest:source-links:v1 -->
2
+ # Managed standard sources: local .governance/manifest.json,
3
+ # .governance/manifest.lock.json and .governance/package-manifest.json are
4
+ # authoritative. Remote links are navigation only and are never fetched at runtime.
5
+ # Canonical instructions: https://github.com/wellmanifest/new-project/blob/main/template/files/AGENTS.template.md
6
+ # Host contract: https://github.com/wellmanifest/new-project/blob/main/governance/agent-hosts.json
7
+ # Immutable adoption/updater: https://github.com/wellmanifest/new-project/blob/main/scripts/create_adoption_lock.py
8
+ # <!-- end wellmanifest:source-links:v1 -->
9
+ # wellmanifest/new-project — fail-closed contract for aider.
10
+ # aider loads these files into every session, so the same rules apply here as
11
+ # in Cursor, Claude Code or Gemini. The pre-commit hook enforces them.
12
+ read:
13
+ - AGENTS.md
14
+ - CLAUDE.md
15
+
16
+ # Never let the tool create commits the governance hook has not seen.
17
+ auto-commits: false
18
+ attribute-commit-message-author: true
19
+
20
+ # Bounded session controls: respect the ticket's maxActiveMinutes, create a
21
+ # checkpoint before a context or tool boundary, and leave a handoff then stop
22
+ # after a deterministic failure instead of retrying indefinitely.
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: wellmanifest/new-project fail-closed ticket contract for every Cursor session
3
+ alwaysApply: true
4
+ ---
5
+
6
+ <!-- wellmanifest:source-links:v1 -->
7
+ ## Managed standard sources
8
+
9
+ Local adoption files are authoritative. Remote links are navigation only and
10
+ must not be fetched or executed at runtime.
11
+
12
+ - Local adoption manifest: [.governance/manifest.json](.governance/manifest.json)
13
+ - Local adoption lock: [.governance/manifest.lock.json](.governance/manifest.lock.json)
14
+ - Local package map: [.governance/package-manifest.json](.governance/package-manifest.json)
15
+ - Canonical instructions: [AGENTS template](https://github.com/wellmanifest/new-project/blob/main/template/files/AGENTS.template.md)
16
+ - Host contract: [agent-hosts.json](https://github.com/wellmanifest/new-project/blob/main/governance/agent-hosts.json)
17
+ - Immutable adoption/updater: [create_adoption_lock.py](https://github.com/wellmanifest/new-project/blob/main/scripts/create_adoption_lock.py)
18
+
19
+ <!-- end wellmanifest:source-links:v1 -->
20
+
21
+ # new-project standard (host-agnostic)
22
+
23
+ Before writing code in this repository:
24
+
25
+ 1. Read `AGENTS.md` and the active ticket. Reuse an `IN_PROGRESS` ticket only when workstream and scope match.
26
+ 2. Otherwise run `./project/new-ticket.sh --title "..." --agent "..." --workstream "..."`.
27
+ 3. Work in a dedicated worktree/branch whose name contains `ticket-NNN`. Do not commit on `main` or a dirty primary checkout.
28
+ 4. Stay inside `intent.json` `allowedPaths`. Commercial SSOT / offer / brand facades need the integration workstream.
29
+ 5. Run `./scripts/install-agent-hosts.sh` once per clone so `.githooks/pre-commit` is active.
30
+ 6. Run `./project/governance-check.sh` before claiming done.
31
+
32
+ The pre-commit hook rejects commits that are not bound to an `IN_PROGRESS` ticket. Do not invent ticket numbers. Do not ask the human to approve a merge; invoke validator-agent when publication needs trusted approval.
33
+
34
+ Bounded session controls: respect the ticket's `maxActiveMinutes`, create a
35
+ `checkpoint` before a context or tool boundary, and leave a `handoff` then
36
+ `stop` after a deterministic failure instead of retrying indefinitely.
@@ -0,0 +1,37 @@
1
+ # ==============================================================================
2
+ # oqllm.com Environment Configuration (.env)
3
+ # ==============================================================================
4
+
5
+ # Application Environment (production | development)
6
+ APP_ENV=production
7
+ DEMO_MODE=false
8
+
9
+ # SMTP Mail Server Configuration
10
+ # Adres email nadawcy kodów weryfikacyjnych:
11
+ SMTP_FROM_EMAIL=code@oqllm.com
12
+ SMTP_FROM_NAME="oqllm.com Authentication"
13
+
14
+ # Serwer pocztowy (lokalny Postfix na Plesk lub zewnętrzny)
15
+ # Na serwerze Plesk standardowo: 127.0.0.1 na porcie 25
16
+ SMTP_HOST=127.0.0.1
17
+ SMTP_PORT=25
18
+ SMTP_ENCRYPTION=none
19
+
20
+ # Użytkownik i hasło skrzynki pocztowej:
21
+ SMTP_USER=code@oqllm.com
22
+ # >>> TUTAJ WPISZ / ZMIEŃ HASŁO DO SKRZYNKI POCZTOWEJ code@oqllm.com <<<
23
+ SMTP_PASSWORD=
24
+
25
+ # Alternatywne bezpośrednie połączenie SSL z portem 465 (np. zdalnie lub z zewnątrz):
26
+ # SMTP_HOST=prototypowanie.pl
27
+ # SMTP_PORT=465
28
+ # SMTP_ENCRYPTION=ssl
29
+ # SMTP_USER=code@oqllm.com
30
+ # SMTP_PASSWORD=TWOJE_HASLO_TUTAJ
31
+
32
+ # Typed decisions (POST /v1/decide) are relayed to exactly one SubLLM / oqllm-proxy
33
+ # upstream and are refused with 503 while this is empty. Allowed: https://host[/path],
34
+ # or http://127.0.0.1:PORT for a local tunnel endpoint. Default path: /v1/decide
35
+ OQLLM_DECIDE_UPSTREAM_URL=
36
+ # Bearer token presented to that upstream (the caller's API key is never forwarded):
37
+ OQLLM_DECIDE_UPSTREAM_TOKEN=
@@ -0,0 +1,3 @@
1
+ # Wellmanifest new-project standard git attributes
2
+ project/TICKETS.md merge=wellmanifest-ticket-index
3
+ TODO.md merge=wellmanifest-ticket-index
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+ # Git invokes this after the message is available and before creating a commit.
3
+ # Staged scope and active-ticket checks remain in the pre-commit hook.
4
+ set -euo pipefail
5
+
6
+ root="$(git rev-parse --show-toplevel)"
7
+ if [[ -n "${NEW_PROJECT_SEED_REQUEST:-}" ]]; then
8
+ [[ $# == 1 ]] || exit 1
9
+ python3 -B "$root/.governance/seed_baseline.py" hook-check --root "$root" \
10
+ --request "$NEW_PROJECT_SEED_REQUEST" --message-file "$1"
11
+ exit $?
12
+ fi
13
+ policy_runner="$root/.governance/repository_policy.py"
14
+ [[ -f "$policy_runner" ]] || policy_runner="$root/scripts/repository_policy.py"
15
+ if [[ -f "$policy_runner" ]]; then
16
+ profile="$(PYTHONDONTWRITEBYTECODE=1 python3 "$policy_runner" --root "$root" --profile 2>/dev/null || true)"
17
+ case "$profile" in
18
+ local-audit|main-only-planfile|main-only-files) exit 0 ;;
19
+ esac
20
+ fi
21
+
22
+ branch="$(git symbolic-ref --short HEAD 2>/dev/null || true)"
23
+ if [[ ! "$branch" =~ ticket[-/]([0-9]{3,}) ]]; then
24
+ echo "GOV-AGENT-HOST-001: commit subject cannot bind branch '$branch' to ticket-NNN." >&2
25
+ exit 1
26
+ fi
27
+ ticket="ticket-${BASH_REMATCH[1]}"
28
+ if [[ $# != 1 || ! -f "$1" ]]; then
29
+ echo "GOV-AGENT-HOST-001: commit message file is unavailable." >&2
30
+ exit 1
31
+ fi
32
+ subject=""
33
+ IFS= read -r subject < "$1" || true
34
+ if ! printf '%s\n' "$subject" | grep -Eq -- "(^|[^[:alnum:]_-])${ticket}([^[:alnum:]_-]|$)"; then
35
+ echo "GOV-AGENT-HOST-001: commit subject must include the branch ticket '$ticket'." >&2
36
+ echo " Example: fix(component): repair behavior ($ticket)" >&2
37
+ exit 1
38
+ fi
@@ -0,0 +1,222 @@
1
+ #!/usr/bin/env bash
2
+ # Managed adopter hook: bind implementation to an active ticket. The payload
3
+ # is separate from the hub's live hook so later runtime composition does not
4
+ # mutate the standard source's own enforcement while it is executing.
5
+
6
+ set -euo pipefail
7
+
8
+ root="$(git rev-parse --show-toplevel)"
9
+ branch="$(git symbolic-ref --short HEAD 2>/dev/null || true)"
10
+
11
+ # A seed request can authorize only the allocator's exact prepared root commit.
12
+ # Existing history, product files and an unprepared request fail closed here.
13
+ if [[ -n "${NEW_PROJECT_SEED_REQUEST:-}" ]]; then
14
+ python3 -B "$root/.governance/seed_baseline.py" hook-check --root "$root" \
15
+ --request "$NEW_PROJECT_SEED_REQUEST"
16
+ exit $?
17
+ fi
18
+
19
+ # Run before every profile/status success path. Identity is supplied by the
20
+ # session launcher; the hook must never infer it from the lease holder.
21
+ if [[ "$branch" =~ (^|/)ticket[-/][0-9]{3,} ]]; then
22
+ writer_runner="$root/.governance/change_lease_check.py"
23
+ [[ -f "$writer_runner" ]] || writer_runner="$root/scripts/change_lease_check.py"
24
+ if [[ ! -f "$writer_runner" ]]; then
25
+ echo "GOV-CHANGE-LEASE-001: writer-lease checker is missing; restore the managed installation." >&2
26
+ exit 1
27
+ fi
28
+ python3 -B "$writer_runner" writer-check --root "$root" --operation commit --ref "refs/heads/$branch"
29
+ fi
30
+
31
+ run_worktree_guard() {
32
+ local runner="$root/.governance/worktree_guard.py"
33
+ if [[ -f "$runner" ]]; then
34
+ python3 "$runner" --root "$root" --once
35
+ return
36
+ fi
37
+
38
+ echo "worktree-guard: the managed pre-commit hook cannot find worktree_guard.py." >&2
39
+ echo " Restore the managed package or reinstall the repository guard:" >&2
40
+ echo " ./scripts/install-worktree-guard.sh --target $root --wire-hook" >&2
41
+ return 1
42
+ }
43
+
44
+ run_local_standard_pin_check() {
45
+ local runner="$root/.governance/work_continuity.py"
46
+ if [[ ! -f "$runner" ]]; then
47
+ # A host-files-only bootstrap predates full standard adoption and has no
48
+ # local pin to check. Once either pin file exists, the runtime is required.
49
+ if [[ ! -e "$root/.subactor/manifest.json" && ! -e "$root/.governance/manifest.lock.json" ]]; then
50
+ return 0
51
+ fi
52
+ echo "GOV-CONTINUITY-001: the managed pre-commit hook cannot validate the local standard pin." >&2
53
+ echo " Restore the managed package with the explicit standard updater; the hook never fetches." >&2
54
+ return 1
55
+ fi
56
+
57
+ # Commits read only staged local manifests and managed digests. Resolve a
58
+ # newer release explicitly in its adoption ticket, outside this boundary.
59
+ python3 "$runner" verify-pin --root "$root" --staged >/dev/null
60
+ }
61
+
62
+ run_commit_guards() {
63
+ run_local_standard_pin_check
64
+ run_worktree_guard
65
+ }
66
+
67
+ policy_runner="$root/.governance/repository_policy.py"
68
+ if [[ -f "$policy_runner" ]]; then
69
+ repository_profile="$(PYTHONDONTWRITEBYTECODE=1 python3 "$policy_runner" --root "$root" --profile 2>/dev/null || true)"
70
+ if [[ "$repository_profile" == "local-audit" ]]; then
71
+ PYTHONDONTWRITEBYTECODE=1 python3 "$policy_runner" --root "$root" --staged >/dev/null || true
72
+ exit 0
73
+ fi
74
+ if [[ "$repository_profile" == "main-only-planfile" || "$repository_profile" == "main-only-files" ]]; then
75
+ if [[ -z "$branch" || "$branch" == "HEAD" ]]; then
76
+ echo "GOV-AGENT-HOST-001: detached HEAD is not allowed by the main-only delivery profile." >&2
77
+ exit 1
78
+ fi
79
+ if ! PYTHONDONTWRITEBYTECODE=1 python3 "$policy_runner" --root "$root" --staged; then
80
+ echo "GOV-AGENT-HOST-002: staged change rejected by the repository delivery profile." >&2
81
+ exit 1
82
+ fi
83
+ run_commit_guards
84
+ exit 0
85
+ fi
86
+ fi
87
+
88
+ if [[ -z "$branch" || "$branch" == "HEAD" ]]; then
89
+ echo "GOV-AGENT-HOST-001: detached HEAD is not bound to ticket-NNN." >&2
90
+ exit 1
91
+ fi
92
+
93
+ if [[ ! "$branch" =~ (^|/)ticket[-/]([0-9]{3,}) ]]; then
94
+ echo "GOV-AGENT-HOST-001: branch '$branch' is not bound to ticket-NNN." >&2
95
+ echo " Allocate with ./project/new-ticket.sh and commit on a ticket branch." >&2
96
+ exit 1
97
+ fi
98
+
99
+ ticket="ticket-${BASH_REMATCH[2]}"
100
+ readme_rel="project/$ticket/README.md"
101
+
102
+ ticket_storage="$(git config --local --get new-project.ticketStorage 2>/dev/null || true)"
103
+ if [[ "${ticket_storage:-files}" == sqlite ]]; then
104
+ reader="$root/.governance/ticket_input.py"
105
+ [[ -f "$reader" ]] || reader="$root/scripts/ticket_input.py"
106
+ if ! staged_readme="$(PYTHONDONTWRITEBYTECODE=1 python3 "$reader" read --root "$root" --ticket "$ticket" --file README.md)"; then
107
+ echo "GOV-AGENT-HOST-002: active SQLite ticket content is unavailable." >&2
108
+ exit 1
109
+ fi
110
+ elif [[ "${ticket_storage:-files}" == files ]]; then
111
+ if ! staged_readme="$(git show ":$readme_rel" 2>/dev/null)"; then
112
+ echo "GOV-AGENT-HOST-002: $root/$readme_rel is missing from the staged snapshot." >&2
113
+ echo " Allocate with ./project/new-ticket.sh; do not invent a ticket number." >&2
114
+ exit 1
115
+ fi
116
+ else
117
+ echo "GOV-AGENT-HOST-002: unknown ticket storage mode." >&2
118
+ exit 1
119
+ fi
120
+
121
+ # A carrier-only follow-up commit (for example the delivery contract that the
122
+ # gate asks for after the material change) is admitted only when the ticket
123
+ # branch already delivers a material change relative to its target branch.
124
+ # A branch without one still needs a material first commit; CI re-checks the
125
+ # whole range (GOV-MATERIAL-001).
126
+ branch_has_material_delivery() {
127
+ local target base path
128
+ target="$(PYTHONDONTWRITEBYTECODE=1 python3 - "$root/project/$ticket/intent.json" 2>/dev/null <<'PYTARGET'
129
+ import json
130
+ import sys
131
+ try:
132
+ delivery = json.load(open(sys.argv[1], encoding="utf-8")).get("delivery")
133
+ value = delivery.get("targetBranch") if isinstance(delivery, dict) else None
134
+ except (OSError, ValueError, AttributeError):
135
+ value = None
136
+ ok = isinstance(value, str) and value and not any(c.isspace() for c in value) and ".." not in value
137
+ print(value if ok else "main")
138
+ PYTARGET
139
+ )" || return 1
140
+ base="$(git merge-base HEAD "refs/remotes/origin/$target" 2>/dev/null)" || return 1
141
+ [[ -n "$base" ]] || return 1
142
+ while IFS= read -r -d '' path; do
143
+ case "$path" in
144
+ project/ticket-*/*|TODO.md|project/TICKETS.md|config/artifact-registry.json) ;;
145
+ *) return 0 ;;
146
+ esac
147
+ done < <(git diff --no-renames --name-only -z "$base" HEAD --)
148
+ return 1
149
+ }
150
+
151
+ governance_only_transition() {
152
+ # SQLite transitions never require a Git carrier commit.
153
+ [[ "${ticket_storage:-files}" == files ]] || return 1
154
+ if git diff --cached --quiet -- "$readme_rel"; then
155
+ return 1
156
+ fi
157
+ if ! git diff --cached --quiet --diff-filter=DRC --; then
158
+ return 1
159
+ fi
160
+
161
+ while IFS= read -r -d '' path; do
162
+ case "$path" in
163
+ "project/$ticket/"*|TODO.md|project/TICKETS.md|config/artifact-registry.json) ;;
164
+ *) return 1 ;;
165
+ esac
166
+ done < <(git diff --cached --name-only -z --diff-filter=AM --)
167
+ }
168
+
169
+ if grep -Eiq '^-[[:space:]]+\*\*Status\*\*:[[:space:]]*IN_PROGRESS([[:space:]]|$)' <<<"$staged_readme"; then
170
+ head_readme="$(git show "HEAD:$readme_rel" 2>/dev/null || true)"
171
+ if grep -Eiq '^-[[:space:]]+\*\*Status\*\*:[[:space:]]*(BACKLOG|PLAN|BLOCKED)([[:space:]]|$)' <<<"$head_readme" \
172
+ && governance_only_transition; then
173
+ run_commit_guards
174
+ exit 0
175
+ fi
176
+
177
+ # NUL-framed rename records carry both paths. Moving a material file into
178
+ # tracking storage still changes the material source at its previous path.
179
+ material=false
180
+ while IFS= read -r -d '' change; do
181
+ IFS= read -r -d '' path || break
182
+ change_paths=("$path")
183
+ if [[ "$change" == R* ]]; then
184
+ IFS= read -r -d '' path || break
185
+ change_paths+=("$path")
186
+ fi
187
+ for path in "${change_paths[@]}"; do
188
+ case "$path" in
189
+ project/ticket-*/*|TODO.md|project/TICKETS.md|config/artifact-registry.json) ;;
190
+ *) material=true; break ;;
191
+ esac
192
+ done
193
+ if [[ "$material" == true ]]; then break; fi
194
+ done < <(git diff --cached --name-status -z --diff-filter=AMR --)
195
+ if [[ "$material" != true ]] && ! branch_has_material_delivery; then
196
+ echo "GOV-AGENT-HOST-007: staged change contains only ticket tracking carriers." >&2
197
+ echo " Add a material deliverable, or emit an external no-change receipt without committing." >&2
198
+ exit 1
199
+ fi
200
+ run_commit_guards
201
+ exit 0
202
+ fi
203
+
204
+ if grep -Eiq '^-[[:space:]]+\*\*Status\*\*:[[:space:]]*(BACKLOG|PLAN|BLOCKED)([[:space:]]|$)' <<<"$staged_readme"; then
205
+ if governance_only_transition; then
206
+ run_commit_guards
207
+ exit 0
208
+ fi
209
+ echo "GOV-AGENT-HOST-003: $ticket non-active transition is not governance-only." >&2
210
+ echo " Stage the ticket README and only bounded governance evidence; keep implementation on IN_PROGRESS." >&2
211
+ exit 1
212
+ fi
213
+
214
+ if grep -Eiq '^-[[:space:]]+\*\*Status\*\*:[[:space:]]*(DONE|CANCELLED)([[:space:]]|$)' <<<"$staged_readme"; then
215
+ echo "GOV-AGENT-HOST-003: repository terminal closure commits are forbidden." >&2
216
+ echo " The protected delivery controller must emit the external terminal receipt without a repository write." >&2
217
+ exit 1
218
+ fi
219
+
220
+ echo "GOV-AGENT-HOST-003: $ticket is neither IN_PROGRESS nor a valid staged non-active transition." >&2
221
+ echo " Use BACKLOG, PLAN or BLOCKED only for bounded governance evidence; terminal state belongs to the protected external receipt." >&2
222
+ exit 1
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env bash
2
+ # Git invokes this before a push. Delivery reaches the declared target branch only
3
+ # through a reviewed pull request merged by the validator; a direct push skips
4
+ # review, required checks and CI (GOV-PUSH-001). Repositories whose delivery
5
+ # profile is main-only or local-audit commit on the target branch by design.
6
+ set -euo pipefail
7
+
8
+ root="$(git rev-parse --show-toplevel)"
9
+ allow_target=false
10
+ policy_runner="$root/.governance/repository_policy.py"
11
+ [[ -f "$policy_runner" ]] || policy_runner="$root/scripts/repository_policy.py"
12
+ if [[ -f "$policy_runner" ]]; then
13
+ profile="$(PYTHONDONTWRITEBYTECODE=1 python3 "$policy_runner" --root "$root" --profile 2>/dev/null || true)"
14
+ case "$profile" in
15
+ local-audit|main-only-planfile|main-only-files) allow_target=true ;;
16
+ esac
17
+ fi
18
+
19
+ if ! targets="$(PYTHONDONTWRITEBYTECODE=1 python3 - "$root" <<'PY'
20
+ import json, sys
21
+ from pathlib import Path
22
+ root = Path(sys.argv[1])
23
+ try:
24
+ for rel in (".governance/manifest.json", ".governance/manifest.base.json", "governance/manifest.hub.json"):
25
+ path = root / rel
26
+ if not path.exists():
27
+ continue
28
+ manifest = json.loads(path.read_text(encoding="utf-8"))
29
+ if not isinstance(manifest, dict):
30
+ raise ValueError("manifest must be an object")
31
+ delivery = manifest.get("delivery", {})
32
+ if not isinstance(delivery, dict):
33
+ raise ValueError("delivery must be an object")
34
+ if "targetBranches" not in delivery:
35
+ continue
36
+ branches = delivery["targetBranches"]
37
+ if not isinstance(branches, list) or not branches or not all(isinstance(b, str) and b and not any(c.isspace() for c in b) for b in branches):
38
+ raise ValueError("target branches must be a nonempty list of branch names")
39
+ print("\n".join(branches))
40
+ break
41
+ else:
42
+ print("main")
43
+ except (OSError, UnicodeError, ValueError):
44
+ print("GOV-PUSH-001: invalid or unreadable target-branch policy; restore the declared manifest before pushing.", file=sys.stderr)
45
+ sys.exit(1)
46
+ PY
47
+ )"; then
48
+ exit 1
49
+ fi
50
+
51
+ refused=0
52
+ while read -r local_ref local_sha remote_ref remote_sha; do
53
+ [[ -n "${remote_ref:-}" ]] || continue
54
+ for ref in "$local_ref" "$remote_ref"; do
55
+ if [[ "$ref" =~ ^refs/heads/(.*/)?ticket[-/][0-9]{3,} ]]; then
56
+ writer_runner="$root/.governance/change_lease_check.py"
57
+ [[ -f "$writer_runner" ]] || writer_runner="$root/scripts/change_lease_check.py"
58
+ if [[ ! -f "$writer_runner" ]]; then
59
+ echo "GOV-CHANGE-LEASE-001: writer-lease checker is missing; restore the managed installation." >&2
60
+ refused=1
61
+ elif ! python3 -B "$writer_runner" writer-check --root "$root" --operation push --ref "$ref"; then
62
+ refused=1
63
+ fi
64
+ fi
65
+ done
66
+ [[ "$allow_target" == true ]] && continue
67
+ while IFS= read -r target; do
68
+ if [[ "$remote_ref" == "refs/heads/$target" ]]; then
69
+ echo "GOV-PUSH-001: direct push to '$target' refused ($local_ref -> $remote_ref)." >&2
70
+ echo " Push the ticket branch and open a pull request; the validator merges it." >&2
71
+ refused=1
72
+ fi
73
+ done <<< "$targets"
74
+ done
75
+
76
+ exit "$refused"
@@ -0,0 +1,36 @@
1
+ # GitHub Copilot instructions
2
+
3
+ <!-- wellmanifest:source-links:v1 -->
4
+ ## Managed standard sources
5
+
6
+ The local adoption manifest, lock and package are authoritative. Remote links
7
+ are navigation only and must not be fetched or executed at runtime.
8
+
9
+ - Local adoption manifest: [.governance/manifest.json](.governance/manifest.json)
10
+ - Local adoption lock: [.governance/manifest.lock.json](.governance/manifest.lock.json)
11
+ - Local package map: [.governance/package-manifest.json](.governance/package-manifest.json)
12
+ - Canonical instructions: [AGENTS template](https://github.com/wellmanifest/new-project/blob/main/template/files/AGENTS.template.md)
13
+ - Host contract: [agent-hosts.json](https://github.com/wellmanifest/new-project/blob/main/governance/agent-hosts.json)
14
+ - Immutable adoption/updater: [create_adoption_lock.py](https://github.com/wellmanifest/new-project/blob/main/scripts/create_adoption_lock.py)
15
+
16
+ <!-- end wellmanifest:source-links:v1 -->
17
+
18
+ This repository follows the `wellmanifest/new-project` policy-as-code standard.
19
+ Same fail-closed contract as `AGENTS.md`, `CLAUDE.md`, `GEMINI.md` and the Cursor
20
+ rule. Copilot Chat and the Copilot coding agent load this file automatically.
21
+
22
+ 1. Read `AGENTS.md` before proposing any change.
23
+ 2. Allocate tickets only through `./project/new-ticket.sh`. Never copy a
24
+ `project/ticket-NNN` directory and never invent a ticket number.
25
+ 3. Work on a branch or worktree whose name contains `ticket-NNN`. Never write on
26
+ `main` or a dirty primary checkout.
27
+ 4. Stay inside that ticket's `intent.json` `allowedPaths`.
28
+ 5. Run `./scripts/install-agent-hosts.sh` once per clone so `.githooks/pre-commit`
29
+ is active, then `./project/governance-check.sh` before claiming done.
30
+
31
+ Suggestions that skip these steps are rejected by the pre-commit hook and by the
32
+ `governance / enforce` CI job. Markdown is not a substitute for either.
33
+
34
+ Bounded session controls: respect the ticket's `maxActiveMinutes`, create a
35
+ `checkpoint` before a context or tool boundary, and leave a `handoff` then
36
+ `stop` after a deterministic failure instead of retrying indefinitely.
@@ -0,0 +1,27 @@
1
+ name: new-project-branch-hygiene
2
+
3
+ # GitHub's delete_branch_on_merge setting handles successfully merged branches.
4
+ # Closing an unmerged pull request does not authorize discarding its work.
5
+ # Explicit discard requires a separate owner decision and intent reconciliation.
6
+ on:
7
+ pull_request:
8
+ types: [closed]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ preserve-unmerged-head:
15
+ if: github.event.pull_request.merged == false
16
+ runs-on: ${{ vars.NEW_PROJECT_RUNNER_LABEL || 'ubuntu-latest' }}
17
+ steps:
18
+ - name: Report preserved pull request branch
19
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
20
+ with:
21
+ script: |
22
+ const ref = context.payload.pull_request.head.ref;
23
+ core.notice(
24
+ `Preserved ${JSON.stringify(ref)}. Closing a pull request does not ` +
25
+ 'authorize branch deletion. Reconcile remaining intent and obtain ' +
26
+ 'an explicit owner discard decision before a separate deletion.',
27
+ );