urace 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 (171) hide show
  1. urace-0.3.0/PKG-INFO +10 -0
  2. urace-0.3.0/README.md +454 -0
  3. urace-0.3.0/pyproject.toml +20 -0
  4. urace-0.3.0/setup.cfg +4 -0
  5. urace-0.3.0/tests/test_a2a_bridge.py +93 -0
  6. urace-0.3.0/tests/test_alignment_fixes.py +238 -0
  7. urace-0.3.0/tests/test_analytics.py +48 -0
  8. urace-0.3.0/tests/test_authenticated_journal.py +20 -0
  9. urace-0.3.0/tests/test_auto_goals.py +43 -0
  10. urace-0.3.0/tests/test_auto_trade.py +354 -0
  11. urace-0.3.0/tests/test_bootstrap_ready.py +24 -0
  12. urace-0.3.0/tests/test_command_surface.py +116 -0
  13. urace-0.3.0/tests/test_compaction_integrity.py +21 -0
  14. urace-0.3.0/tests/test_context_relations.py +18 -0
  15. urace-0.3.0/tests/test_core_audit.py +87 -0
  16. urace-0.3.0/tests/test_data_cli_persistence.py +49 -0
  17. urace-0.3.0/tests/test_data_source_truthfulness.py +50 -0
  18. urace-0.3.0/tests/test_data_transports.py +44 -0
  19. urace-0.3.0/tests/test_decision_feedback.py +155 -0
  20. urace-0.3.0/tests/test_executor_capabilities.py +36 -0
  21. urace-0.3.0/tests/test_external_metrics.py +53 -0
  22. urace-0.3.0/tests/test_feature_catalog.py +191 -0
  23. urace-0.3.0/tests/test_feature_equity.py +248 -0
  24. urace-0.3.0/tests/test_feature_policy.py +15 -0
  25. urace-0.3.0/tests/test_freeform_routing.py +83 -0
  26. urace-0.3.0/tests/test_full_scope_audit.py +48 -0
  27. urace-0.3.0/tests/test_implementation_sequence.py +32 -0
  28. urace-0.3.0/tests/test_json_flags.py +21 -0
  29. urace-0.3.0/tests/test_lock_crash_recovery.py +148 -0
  30. urace-0.3.0/tests/test_mcp_bridge.py +271 -0
  31. urace-0.3.0/tests/test_metric_file_resource_bound.py +36 -0
  32. urace-0.3.0/tests/test_milestone_feedback.py +76 -0
  33. urace-0.3.0/tests/test_multi_executor.py +46 -0
  34. urace-0.3.0/tests/test_nat_traversal.py +269 -0
  35. urace-0.3.0/tests/test_native_usage_errors.py +15 -0
  36. urace-0.3.0/tests/test_nested_repository.py +40 -0
  37. urace-0.3.0/tests/test_new_modules.py +127 -0
  38. urace-0.3.0/tests/test_nullable_budgets.py +19 -0
  39. urace-0.3.0/tests/test_operator_bootstrap.py +84 -0
  40. urace-0.3.0/tests/test_owner_value_readiness.py +497 -0
  41. urace-0.3.0/tests/test_p2p_integrity.py +206 -0
  42. urace-0.3.0/tests/test_p2p_update_discovery.py +292 -0
  43. urace-0.3.0/tests/test_peer_discovery.py +339 -0
  44. urace-0.3.0/tests/test_peer_exchange.py +158 -0
  45. urace-0.3.0/tests/test_peer_improvement.py +389 -0
  46. urace-0.3.0/tests/test_peer_selection.py +68 -0
  47. urace-0.3.0/tests/test_planning_feedback.py +93 -0
  48. urace-0.3.0/tests/test_portfolio.py +491 -0
  49. urace-0.3.0/tests/test_product_creation.py +41 -0
  50. urace-0.3.0/tests/test_product_similarity.py +699 -0
  51. urace-0.3.0/tests/test_quota_wording.py +8 -0
  52. urace-0.3.0/tests/test_rollback.py +70 -0
  53. urace-0.3.0/tests/test_runtime_context_injection.py +115 -0
  54. urace-0.3.0/tests/test_runtime_cycle_cli.py +61 -0
  55. urace-0.3.0/tests/test_runtime_features.py +105 -0
  56. urace-0.3.0/tests/test_runtime_product.py +88 -0
  57. urace-0.3.0/tests/test_signed_ledger.py +54 -0
  58. urace-0.3.0/tests/test_singularity.py +182 -0
  59. urace-0.3.0/tests/test_tokenomics.py +553 -0
  60. urace-0.3.0/tests/test_tokenomics_settlement.py +334 -0
  61. urace-0.3.0/tests/test_trial_bridge.py +47 -0
  62. urace-0.3.0/tests/test_trial_workflow.py +56 -0
  63. urace-0.3.0/tests/test_tui.py +104 -0
  64. urace-0.3.0/tests/test_update_derive_roundtrip.py +90 -0
  65. urace-0.3.0/tests/test_urace.py +14218 -0
  66. urace-0.3.0/tests/test_urace_r109.py +1355 -0
  67. urace-0.3.0/tests/test_urace_usage_truth_contract.py +11 -0
  68. urace-0.3.0/tests/test_user_benefit_core.py +24 -0
  69. urace-0.3.0/tests/test_user_controls.py +47 -0
  70. urace-0.3.0/tests/test_value_discovery.py +156 -0
  71. urace-0.3.0/tests/test_value_production.py +402 -0
  72. urace-0.3.0/tests/test_value_workflow_integration.py +45 -0
  73. urace-0.3.0/tests/test_version_preflight.py +123 -0
  74. urace-0.3.0/tests/test_watch_command.py +113 -0
  75. urace-0.3.0/tests/test_work_market.py +415 -0
  76. urace-0.3.0/tests/test_zero_config.py +282 -0
  77. urace-0.3.0/urace/__init__.py +3 -0
  78. urace-0.3.0/urace/__main__.py +3 -0
  79. urace-0.3.0/urace/_common.py +399 -0
  80. urace-0.3.0/urace/a2a_server.py +382 -0
  81. urace-0.3.0/urace/analytics.py +146 -0
  82. urace-0.3.0/urace/api_interface.py +197 -0
  83. urace-0.3.0/urace/authenticated_journal.py +76 -0
  84. urace-0.3.0/urace/authority.py +189 -0
  85. urace-0.3.0/urace/auto_goals.py +124 -0
  86. urace-0.3.0/urace/bootstrap.py +128 -0
  87. urace-0.3.0/urace/circuit_breaker.py +107 -0
  88. urace-0.3.0/urace/cli.py +10906 -0
  89. urace-0.3.0/urace/cognitive_resume.py +243 -0
  90. urace-0.3.0/urace/command_surface.py +381 -0
  91. urace-0.3.0/urace/compaction.py +1060 -0
  92. urace-0.3.0/urace/content_store.py +72 -0
  93. urace-0.3.0/urace/context_relations.py +45 -0
  94. urace-0.3.0/urace/continuation.py +80 -0
  95. urace-0.3.0/urace/credit_ledger.py +1190 -0
  96. urace-0.3.0/urace/crypto_wallet.py +209 -0
  97. urace-0.3.0/urace/data_transport.py +159 -0
  98. urace-0.3.0/urace/decision_feedback.py +212 -0
  99. urace-0.3.0/urace/decision_record.py +363 -0
  100. urace-0.3.0/urace/derived_artifacts.py +47 -0
  101. urace-0.3.0/urace/destination.py +161 -0
  102. urace-0.3.0/urace/equity_auto_trade.py +1090 -0
  103. urace-0.3.0/urace/evolution_guard.py +506 -0
  104. urace-0.3.0/urace/exchange_cli.py +1048 -0
  105. urace-0.3.0/urace/executor.py +1215 -0
  106. urace-0.3.0/urace/executor_capabilities.py +95 -0
  107. urace-0.3.0/urace/external_metrics.py +163 -0
  108. urace-0.3.0/urace/feature_catalog.py +188 -0
  109. urace-0.3.0/urace/feature_equity.py +235 -0
  110. urace-0.3.0/urace/feature_policy.py +21 -0
  111. urace-0.3.0/urace/federation.py +146 -0
  112. urace-0.3.0/urace/freeform_routing.py +359 -0
  113. urace-0.3.0/urace/implementation_sequence.py +71 -0
  114. urace-0.3.0/urace/inputs.py +478 -0
  115. urace-0.3.0/urace/inspection.py +883 -0
  116. urace-0.3.0/urace/integration_bridge.py +370 -0
  117. urace-0.3.0/urace/intent_trace.py +31 -0
  118. urace-0.3.0/urace/launcher.py +117 -0
  119. urace-0.3.0/urace/ledger_compaction.py +494 -0
  120. urace-0.3.0/urace/ledger_crypto.py +89 -0
  121. urace-0.3.0/urace/mcp_server.py +138 -0
  122. urace-0.3.0/urace/milestone_feedback.py +65 -0
  123. urace-0.3.0/urace/milestone_suggestions.py +40 -0
  124. urace-0.3.0/urace/multi_executor.py +139 -0
  125. urace-0.3.0/urace/outcome_verification.py +349 -0
  126. urace-0.3.0/urace/patterns.py +1348 -0
  127. urace-0.3.0/urace/peer_discovery.py +1315 -0
  128. urace-0.3.0/urace/peer_exchange.py +575 -0
  129. urace-0.3.0/urace/peer_improvement.py +512 -0
  130. urace-0.3.0/urace/peer_selection.py +99 -0
  131. urace-0.3.0/urace/peer_work_market.py +1131 -0
  132. urace-0.3.0/urace/planning_feedback.py +92 -0
  133. urace-0.3.0/urace/portfolio.py +2432 -0
  134. urace-0.3.0/urace/portfolio_github.py +99 -0
  135. urace-0.3.0/urace/preflight.py +52 -0
  136. urace-0.3.0/urace/primitives.py +2339 -0
  137. urace-0.3.0/urace/product_creation.py +94 -0
  138. urace-0.3.0/urace/product_similarity.py +599 -0
  139. urace-0.3.0/urace/product_type_detector.py +63 -0
  140. urace-0.3.0/urace/protocol_catalog.py +14 -0
  141. urace-0.3.0/urace/resource_usage.py +138 -0
  142. urace-0.3.0/urace/rules.py +619 -0
  143. urace-0.3.0/urace/runtime_cycle_cli.py +19 -0
  144. urace-0.3.0/urace/runtime_features.py +525 -0
  145. urace-0.3.0/urace/runtime_product.py +67 -0
  146. urace-0.3.0/urace/schema_export.py +42 -0
  147. urace-0.3.0/urace/scope_priority.py +103 -0
  148. urace-0.3.0/urace/self_metrics.py +160 -0
  149. urace-0.3.0/urace/signed_ledger.py +128 -0
  150. urace-0.3.0/urace/spec_audit.py +376 -0
  151. urace-0.3.0/urace/stun_client.py +72 -0
  152. urace-0.3.0/urace/token_ledger.py +144 -0
  153. urace-0.3.0/urace/tokenomics.py +72 -0
  154. urace-0.3.0/urace/trial.py +68 -0
  155. urace-0.3.0/urace/trial_cli.py +53 -0
  156. urace-0.3.0/urace/tui.py +399 -0
  157. urace-0.3.0/urace/uncertainty_followup.py +21 -0
  158. urace-0.3.0/urace/updater.py +426 -0
  159. urace-0.3.0/urace/user_controls.py +38 -0
  160. urace-0.3.0/urace/validation.py +218 -0
  161. urace-0.3.0/urace/value_discovery.py +382 -0
  162. urace-0.3.0/urace/value_trajectory.py +296 -0
  163. urace-0.3.0/urace/version.py +6 -0
  164. urace-0.3.0/urace/work_policy.py +35 -0
  165. urace-0.3.0/urace/workflow_state.py +267 -0
  166. urace-0.3.0/urace.egg-info/PKG-INFO +10 -0
  167. urace-0.3.0/urace.egg-info/SOURCES.txt +169 -0
  168. urace-0.3.0/urace.egg-info/dependency_links.txt +1 -0
  169. urace-0.3.0/urace.egg-info/entry_points.txt +2 -0
  170. urace-0.3.0/urace.egg-info/requires.txt +7 -0
  171. urace-0.3.0/urace.egg-info/top_level.txt +1 -0
urace-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.4
2
+ Name: urace
3
+ Version: 0.3.0
4
+ Summary: Persistent autonomous Product-evolution control plane
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: cryptography<51,>=50
7
+ Provides-Extra: peer-security
8
+ Requires-Dist: cryptography<51,>=50; extra == "peer-security"
9
+ Provides-Extra: peer-discovery
10
+ Requires-Dist: zeroconf<1,>=0.148; extra == "peer-discovery"
urace-0.3.0/README.md ADDED
@@ -0,0 +1,454 @@
1
+ # URACE Runtime
2
+
3
+ This directory contains the running URACE implementation bootstrapped from [`../../URACE.md`](../../URACE.md). The implementation is replaceable, durable lifecycle state lives under the separate `../state/` boundary, and authoritative specification and guidance remain at the repository root.
4
+
5
+ ## Public specification and local deployment matrix
6
+
7
+ “In sync” means this deployment implements the applicable portable behavior and invariants in `URACE.md`, while the public `README.md` explains them without copying deployment-only paths, credentials, state or mechanisms. It does not mean every public option is enabled locally or every local adapter belongs in the public package.
8
+
9
+ | Area | Public contract | This deployment | Sync status |
10
+ |---|---|---|---|
11
+ | Core purpose | Continuously improve the user's Product under retained Intent and Authority. | Uses the URACE public blueprint itself as the current Product. | In sync; Product identity intentionally differs per deployment. |
12
+ | Implementation | Environment-independent behavior and bootstrap requirements. | Python CLI, atomic JSON, filesystem inbox and Git-backed validation. | In sync; mechanism intentionally local. |
13
+ | Executor | Replaceable capable AI or orchestrator with inspect/attach/detach behavior. | Codex and Claude adapters with independent provider routing, replaceable through durable input. | In sync; provider choice intentionally local. |
14
+ | State and recovery | Durable checkpoints, transactional effects, interruption recovery and stable fallback. | Atomic state, transaction journal, stable documents and stable runtime. | In sync; paths intentionally local. |
15
+ | Concurrent edits | Preserve newer external edits and reassess stale candidates. | Source hashes and `CONCURRENT_CHANGE` rejection. | In sync. |
16
+ | Goals and context | Accept attributable live inputs at safe lifecycle boundaries. | Atomic inbox commands with deduplication and quarantine. | In sync. |
17
+ | Metrics and vitals | Extensible measures, confidence, causality limits and follow-up. | Structural measures, configured external metrics, custom vitals and qualified scorecards. | In sync; real Product outcomes depend on configured sources. |
18
+ | External evidence | Optional public/private connectors with secret references and untrusted-content handling. | JSON file, HTTP JSON and GitHub repository adapters; other kinds remain `ADAPTER_REQUIRED`. | Partially implemented by design; unsupported connectors remain explicit. |
19
+ | Resource accounting | Separate provider usage, proxies, availability and deterministic overhead. | Provider-reported token usage when available, explicit unknown usage, optional call ceilings, reservations and probe/write/source accounting. | Native usage is recorded when reported; subscription credit decrement remains unobservable. |
20
+ | Persistent autonomy | Bounded and infinite cycles share budgets, dormancy, wake, backoff and recovery. | Persistent cycles, material-write suppression and launcher restart requests. | In sync; no OS boot supervisor by owner choice. |
21
+ | Self-evolution | Explicit disabled, necessary-only or continuous policy with rollback. | `NECESSARY_ONLY`, validated runtime replacement and re-bootstrap support. | In sync; selected local policy. |
22
+ | Portfolio evolution | Optional isolated variants, equal caps, comparable evaluation, governed learning and ordinary promotion. | Git-worktree controller, frozen workflow, built-in URACE Product adapters, preflight/launch, resumable generations and retained lineage. | Ready for this deployment; other Products require validated adapters. |
23
+ | Anti-poisoning | No candidate ledger access, untrusted peer content, immutable rules, authenticated chain and fail-closed selection. | Bubblewrap removes host-state visibility; bounded schemas, same-generation votes, SHA-256 Agora chain and whole-ledger HMAC-SHA256 verification add defense in depth. | In sync on this Linux host; hostile multi-tenant operation should use separate identities and an external broker. |
24
+ | Analytics | Optional derived portable export that never controls lifecycle state. | Automatic checkpoint CSV/HTML bundle and enabled native-workbook adapter in an isolated local environment. | In sync; local policy is `ON_CHECKPOINT`. |
25
+ | Commercial effects | Accountability, least privilege, exposure limits and no outcome guarantee. | Spending, publishing and destructive external effects remain reserved and no commercial adapter is enabled. | In sync; intentionally unavailable locally. |
26
+ | Packaging | Public source contains the specification, guide, license and public roadmap/configuration only. | Runtime, state, reports, secrets and deployment adapters remain ignored local artifacts. | Intentionally different and correctly separated. |
27
+
28
+ The remaining capability gaps are explicit rather than synchronization defects: provider-reported usage can be missing, and actual subscription credit decrement is unavailable; mutually hostile candidates need an external authenticated broker and harder isolation; and unsupported connector types need adapters. None is represented as ready. Native workbook export is enabled locally and remains observational.
29
+
30
+ ## Governing configuration
31
+
32
+ The retained destination is to continuously improve the URACE blueprint while preserving its governing invariants. The repository owner retains the purpose, Authority boundaries, and normative invariants. Assessment, objectives, priority, plans, measurement, validation, and local implementation changes are delegated. External publication, spending, destructive external effects, changing the retained purpose, and weakening normative invariants remain reserved.
33
+
34
+ The bootstrap request authorizes this implementation. It does not grant a runtime permission to broaden Authority.
35
+
36
+ ## Run
37
+
38
+ Requires Python 3.11 or later and no third-party runtime packages.
39
+
40
+ ```sh
41
+ cd /path/to/project/runtime
42
+ python3 -m urace init
43
+ python3 -m urace help
44
+ python3 -m urace help autonomous
45
+ python3 -m urace check
46
+ python3 -m urace vitals
47
+ python3 -m urace vitals --json
48
+ python3 -m urace commands
49
+ python3 -m urace inbox list
50
+ python3 -m urace plan
51
+ python3 -m urace autonomous --cycles 1
52
+ python3 -m unittest discover -s tests -v
53
+ ```
54
+
55
+ Install the `urace` command from the project root if desired:
56
+
57
+ ```sh
58
+ cd /path/to/project
59
+ python3 -m pip install -e runtime
60
+ urace check
61
+ urace vitals
62
+ ```
63
+
64
+ Both `python3 -m urace` and the repository-local `urace` command enter the same launcher, so supervised runtime activation and rollback apply to either form. This deployment keeps its launcher at `urace/.urace/bin/urace`; `direnv` loads `.envrc` to add it to `PATH` only inside this repository tree and removes it on exit. A new terminal loads the hook automatically. The portable fallback is `./urace/.urace/bin/urace ...`.
65
+
66
+ ## Command boundary
67
+
68
+ Immediate inspection commands load atomic snapshots and remain usable while autonomous infinity owns lifecycle mutation. The report command only writes a derived export boundary:
69
+
70
+ ```sh
71
+ python3 -m urace help [operation]
72
+ python3 -m urace check [--json]
73
+ python3 -m urace vitals [--json]
74
+ python3 -m urace commands [--json]
75
+ python3 -m urace inbox list [--json]
76
+ python3 -m urace executor status
77
+ python3 -m urace source list [--json]
78
+ python3 -m urace metric list [--json]
79
+ python3 -m urace vital list [--json]
80
+ python3 -m urace goal list [--json]
81
+ python3 -m urace goal inspect OBJECTIVE_ID [--json]
82
+ python3 -m urace update resolve [GOAL_ID_OR_CANDIDATE_HASH] --decision "retain local choice and adopt compatible changes"
83
+ python3 -m urace goal forecast [--json]
84
+ python3 -m urace change list [--json]
85
+ python3 -m urace change explain CHANGE_ID [--json]
86
+ python3 -m urace configuration [show|self-evolution|change-explanations] [VALUE]
87
+ python3 -m urace self-evolution [status|auto|always|never]
88
+ python3 -m urace policy list [--json]
89
+ python3 -m urace budget show [--json]
90
+ python3 -m urace report status [--json]
91
+ python3 -m urace report export --output urace/generated/reports/latest [--xlsx]
92
+ ```
93
+
94
+ Accepted operations retain a stable change ID, decision, changed files, validation result and exact Executor route. `change explain` reuses the task Executor's retained summary before spending another Executor call. Automatic explanations default to `disabled` (manual only); configure `auto` for value-gated generation or `enabled` for every eligible accepted change.
95
+
96
+ `plan` performs one assessment and may use a governed discovery call, but it stops after persisting an Objective and Plan and never invokes execution. `autonomous` owns execution. `init` creates initial state under the exclusive state boundary.
97
+
98
+ `urace vitals` is a read-only human summary of current progress metrics, 24-hour and 30-day Executor usage, efficiency yield, associated metric effects, external-evidence health, blockers and follow-up. `urace vitals --json` returns the same contract as structured JSON for monitoring and automation. Neither form invokes Codex or advances a lifecycle cycle. The JSON `progress_metric_source` identifies live Product measurement; while a transaction journal exists, vitals use the last durable measurements to avoid presenting a transient mixed-file view.
99
+
100
+ Queue new authoritative input safely, including while persistent autonomous mode owns the lifecycle state:
101
+
102
+ ```sh
103
+ python3 -m urace add-context "Customers need CSV export" --source "repository owner"
104
+ python3 -m urace add-goal "Deliver CSV export" --success-measure "A user can download a valid CSV" --target product --priority 80
105
+ python3 -m urace add-goal "Improve recovery diagnostics" --success-measure "Recovery failures identify their failed phase" --target urace --necessity-evidence "Current failures block continuity" --lower-impact-insufficient
106
+ python3 -m urace add-source product-outcomes http_json https://example.test/metrics --visibility private --credential-env PRODUCT_METRICS_TOKEN
107
+ python3 -m urace add-metric successful_exports --source product-outcomes --path totals.exports --direction nondecreasing --target 100
108
+ python3 -m urace add-metric export_attempts --source product-outcomes --path totals.attempts
109
+ python3 -m urace add-vital export_success_rate --numerator successful_exports --denominator export_attempts --window 30d --description "Successful export share"
110
+ python3 -m urace source enable product-outcomes
111
+ python3 -m urace source disable product-outcomes
112
+ python3 -m urace source remove product-outcomes
113
+ python3 -m urace metric remove successful_exports
114
+ python3 -m urace vital remove export_success_rate
115
+ python3 -m urace goal cancel OBJECTIVE_ID
116
+ python3 -m urace goal prioritize OBJECTIVE_ID --priority 80 --floor 60 --ceiling 90
117
+ python3 -m urace goal schedule OBJECTIVE_ID --deadline 2027-02-01T00:00:00+00:00 --not-before 2027-01-01T00:00:00+00:00 --estimate-min-hours 2 --estimate-max-hours 6 --estimate-confidence medium
118
+ python3 -m urace goal pin OBJECTIVE_ID
119
+ python3 -m urace goal defer OBJECTIVE_ID --until 2027-01-01T00:00:00+00:00
120
+ python3 -m urace goal resume OBJECTIVE_ID
121
+ python3 -m urace goal disable OBJECTIVE_ID
122
+ python3 -m urace goal delete OBJECTIVE_ID
123
+ python3 -m urace policy set self-evolution necessary-only
124
+ python3 -m urace policy set external-metrics provided-only
125
+ python3 -m urace budget set --daily 2 --monthly 12
126
+ ```
127
+
128
+ Each command atomically writes a small inbox item without waiting for or mutating the live state lock. The autonomous owner consumes items at the next cycle boundary, saves their IDs with the resulting state, and removes their files only after that save. A crash before save leaves the input queued; a crash after save is deduplicated by its processed ID. Corrupt inbox JSON is quarantined instead of blocking the lifecycle. Context is retained as attributable Evidence and supplied in bounded form to discovery. Product and URACE goals become prioritized Objective candidates; URACE-targeted work still follows Authority and self-evolution policy.
129
+
130
+ The installed source adapters are `json_file`, `http_json`, and `github_repository`. Other source kinds, including `database`, `mcp`, and provider-specific APIs, can be registered with `add-source` but remain `ADAPTER_REQUIRED` and inactive until a compatible adapter is implemented and validated. `add-vital` exposes a named metric directly or divides a numerator metric by a nonzero denominator metric; unavailable inputs remain visible rather than becoming fabricated values. `--credential-env` stores only the environment-variable name. Do not put a credential value in a command or source location. `urace vitals --json` lists registered connectors, metric and vital definitions, observed values, evaluated vitals, and collection errors.
131
+
132
+ External JSON files and responses are limited to 1 MiB per request, and HTTP sources accept only `http` or `https` locations. Timeouts, bounded repository event counts, adaptive retry backoff, duplicate-error suppression and bounded prompt inclusion prevent a connector from becoming an unbounded memory, storage, credit or prompt sink. Oversized or malformed input fails only its source and remains visible as an error.
133
+
134
+ Specification updates are staged and hash-bound:
135
+
136
+ ```sh
137
+ python3 -m urace update download /path/to/new/URACE.md
138
+ python3 -m urace update explain
139
+ python3 -m urace update apply
140
+ ```
141
+
142
+ `download` accepts a local file or HTTPS source, validates structure and size, and stores an isolated candidate without changing accepted files. `explain` produces a deterministic no-effect delta report and uses no Executor. `apply` validates the candidate again and queues one digest-bound migration Objective; autonomous execution then uses the configured Executor pool to build the isolated candidate and the existing independent validation, activation health check and stable rollback path. It never patches `state.json` or live runtime files directly.
143
+
144
+ Inspect or queue changes to local Executors without editing state files:
145
+
146
+ ```sh
147
+ python3 -m urace executor status
148
+ python3 -m urace executor attach
149
+ python3 -m urace executor detach
150
+ ```
151
+
152
+ Attach additional Codex or Claude CLI Executors with stable identities and task-specific priorities:
153
+
154
+ ```sh
155
+ python3 -m urace executor attach --id codex-secondary --command /path/to/codex --priority 90 --max-calls-24h 100 --max-calls-30d 1000
156
+ python3 -m urace executor attach --id claude-secondary --adapter claude-cli --command /path/to/claude --priority 90 --capability-priority planning=105 --capability-priority evaluation=110
157
+ python3 -m urace executor retry-policy --id codex-primary --retry-mode automatic --retry-delay-ms 60000 --retry-fallback-seconds 18000
158
+ python3 -m urace executor detach --id codex-secondary
159
+ ```
160
+
161
+ Each provider declares capabilities from `discovery`, `planning`, `mutation`, `evaluation`, and `execution`; repeat `--capability` to restrict an attachment and `--capability-priority CAPABILITY=INTEGER` to express task fit. A bounded suitability tolerance then chooses the least recently used Executor among materially equivalent options only while observed latency and resource evidence remain comparable; an outlier stays available as fallback instead of receiving calls merely for balance, and a material suitability lead still wins. The router exposes recent completions and keeps readiness, reset schedules, failures and transport attempts separately. An unavailable provider is skipped while another compatible provider may handle the same logical reservation. Cross-provider work remains a bounded replay unless an adapter proves session continuation. Every result passes the same output contract, guardrails and acceptance path; if all compatible providers are unavailable, the scheduler waits for the earliest eligible retry without erasing later schedules.
162
+
163
+ These commands are safe from a second terminal while core or portfolio autonomy continues. Core controls already use `urace/state/inbox`; the portfolio owner now consumes that shared inbox before planning and before each Executor stage. Portfolio `stop`, `record`, `review`, `agora-propose`, `agora-vote`, `agora-decide`, `agora-confirm-system`, and `lesson` run immediately when idle and become atomic queued controls when the persistent owner holds its mutation lock. `portfolio feedback` reports pending controls. Read-only `status`, `feedback`, `explain`, `rank`, `agora-show`, `commands`, `preflight`, and `verify` remain immediately available. Cohort creation, execution, manual selection and another autonomous owner are not queued because they would conflict with the active controller.
164
+
165
+ `status` is immediate and read-only. `attach` and `detach` enter the durable inbox, apply at the next cycle boundary, and preserve history, so they also work while infinity mode runs. A command must implement its selected adapter interface; other interfaces still require a validated adapter. Run `python3 -m urace commands` for the implementation's complete immediate-versus-input classification.
166
+
167
+ Durable state is written atomically to `urace/state/state.json`. The `urace/state/` boundary is preserved when `urace/runtime/` is replaced or reconstructed, and deployment state is intentionally ignored by Git. Runtime configuration is versioned in `urace/runtime/urace/config.json`. Runtime-created temporary directories, active portfolio workspaces, retained retired portfolio bundles, reports and update candidates are separated under `urace/generated/`.
168
+
169
+ ## Capabilities and boundaries
170
+
171
+ The bootstrap supplies deterministic measurement plus Codex CLI as a bounded intelligent Executor. Codex first performs read-only discovery and returns a schema-validated proposal. URACE decides whether to promote that proposal into an Objective and Plan. A promoted Objective runs in an isolated temporary workspace with write access limited by its configured scope: documentation scope permits `URACE.md` and `README.md`, while eligible runtime or re-bootstrap scope permits only the explicitly allowlisted implementation and documentation files. URACE applies only changed allowlisted files, checks measurable guardrails, records the attempt and observed effect, and checkpoints an accepted change. Failed guardrails restore the pre-operation files.
172
+
173
+ Codex is enabled in `urace/config.json`, uses the locally authenticated Codex CLI, inherits its configured model by default, runs ephemerally, and has a 15-minute operation timeout. Ordinary 30-second cycles and authentication probes do not make model requests. Intelligent discovery is trigger-first, starts with a weekly opportunity audit when no material Trigger occurs, and backs that audit off exponentially after unproductive discoveries up to eight weeks. Equivalent triggers are suppressed for six hours. All discovery and execution attempts, including failures and no-effect outcomes, share hard ceilings of two calls per rolling 24 hours and twelve calls per rolling 30 days. Discovery requires two available budget slots, reserving the second for execution if its proposal is accepted. Set `executor.enabled` to `false` to use deterministic lifecycle behavior only. Model/API usage follows the account and configuration used by the local Codex CLI.
174
+
175
+ This deployment sets `self_evolution_policy.mode` to `NECESSARY_ONLY`. Product and documentation improvements remain eligible whenever justified. Changes to the URACE runtime itself, including re-bootstrap, are eligible only when Evidence shows that a runtime limitation materially blocks, degrades, or endangers progress, integrity, or continuity and no sufficient lower-impact route exists. Use `DISABLED` to opt out or `CONTINUOUS` to opt into justified beneficial runtime improvement. Policy changes belong in the versioned configuration with attributable provenance and must be migrated into durable state deliberately.
176
+
177
+ External metrics are separately configured under `external_metrics`. This deployment uses `DISCOVER_PUBLIC_AND_USE_PROVIDED`: intelligent discovery may identify credible public outcome sources, while ingestion uses only explicitly configured sources. Set the mode to `DISABLED` to opt out or `PROVIDED_ONLY` to prevent autonomous public-source discovery. Supported ingestion sources are local JSON (`json_file`) and public or authenticated JSON over HTTP (`http_json`). A source maps metric names to dotted paths in its JSON payload.
178
+
179
+ Private-source credentials are referenced by environment-variable name through `credential_env`; secret values are read only at collection time and are not persisted in configuration, prompts or lifecycle state. For example:
180
+
181
+ ```json
182
+ {
183
+ "id": "product-outcomes",
184
+ "kind": "http_json",
185
+ "location": "https://metrics.example.test/summary",
186
+ "visibility": "private",
187
+ "credential_env": "URACE_PRODUCT_METRICS_TOKEN",
188
+ "values": {
189
+ "successful_outcomes": "summary.successful",
190
+ "failure_rate": "summary.failure_rate"
191
+ }
192
+ }
193
+ ```
194
+
195
+ Collected values, source identity, observation time and failures become Evidence and appear in autonomous feedback. Recent accepted decisions are recorded only as `UNATTRIBUTED` candidates; temporal proximity is explicitly insufficient. Codex receives the latest observations and examines pre-decision predictions, timing, prior trends, confounders, alternative explanations, comparison evidence, repeated observations and guardrails. When attribution matters, it should prefer a bounded reversible experiment. A correlated change may trigger investigation but cannot by itself classify a decision as good, bad or causally effective.
196
+
197
+ The configured public GitHub source is `https://github.com/joaoalbertocsjunior/URACE`, collected through its public repository API. It observes `stargazers_count` as stars, `forks_count` as forks, and `subscribers_count` as actual watching subscribers. GitHub's legacy `watchers_count` is intentionally not used because it represents stars. It also retains bounded metadata for repository pushes, recently updated issues, pull requests and releases. New or changed activity becomes an `EXTERNAL_REPOSITORY_UPDATE` reassessment Trigger. These values remain unattributed reach signals; promotion or unrelated external events may change them, and no movement does not prove that Product work failed.
198
+
199
+ Issue, pull-request and release titles are marked as untrusted content. They can trigger assessment but are never executed as instructions and cannot create Authority. The runtime retains stable identifiers, timestamps, state, title and URL rather than ingesting arbitrary bodies or comments into autonomous prompts.
200
+
201
+ Authenticate the executor once before autonomous use:
202
+
203
+ ```sh
204
+ codex login
205
+ codex login status
206
+ cd runtime
207
+ python3 -m urace autonomous --cycles 1 --force-discovery
208
+ ```
209
+
210
+ Authentication remains owned by the local Codex installation and is never copied into URACE state or configuration.
211
+
212
+ The initial measurable profile records normative-rule count, behavioral-test count, and unresolved-marker count. These structural indicators are guardrails and discovery signals, not claims of Product quality. Better outcome metrics should replace or supplement them when credible evidence becomes available.
213
+
214
+ Intent, Authority, constraints, measurements, decisions, checkpoints, unresolved effects, and lifecycle state are inspectable with `urace check --json`. Change retained Intent or Authority by editing the versioned configuration as the authoritative source, then migrate state deliberately. This deployment explicitly delegates bounded `URACE.md` specification evolution within the retained purpose, Authority boundaries, and normative invariants; it does not authorize weakening those invariants or publication.
215
+
216
+ Use `python3 -m urace context list` for a concise provenance-separated view or add `--json` for the complete governing, user-supplied and URACE-derived context. `python3 -m urace goal list [--json]` shows current and historical Objective candidates. User context queued with `add-context` is labelled `USER_SUPPLIED`; objectives, bounded reasoning hypotheses and external observations remain separately labelled derived material and do not silently replace Intent or create Authority.
217
+
218
+ The implementation enters `DORMANT` when no justified work exists while retaining a follow-up condition. An indeterminate effect moves it to `BLOCKED` until reconciled rather than permitting a blind retry.
219
+
220
+ Accepted multi-file changes use a durable transaction journal. URACE records complete before/after content and fsyncs the journal before touching Product files, atomically replaces each file, records the accepted transaction in durable lifecycle state, and only then removes the journal. On the next invocation, an interrupted unaccepted transaction is rolled back; a transaction already present in an accepted checkpoint is rolled forward. Recovery is recorded as Evidence. Stale process locks left by abnormal termination are reclaimed only when their recorded process is no longer alive.
221
+
222
+ The last accepted `URACE.md` and `README.md` are also retained under `urace/state/stable/`. Before operation and after recovery, URACE checks required document structure, fenced-block integrity, and non-regression of normative rules and behavioral tests. A broken or degraded live document is atomically restored from the last stable snapshot and the restoration is recorded as Evidence. A new snapshot is promoted only after Product validation and durable checkpoint acceptance.
223
+
224
+ Every intelligent discovery and execution request treats `URACE.md` as authoritative and requires review of `README.md` for synchronization. User-facing or operational semantic changes to the specification must update README guidance in the same accepted increment when needed; the two documents are checkpointed and restored as one stable Product version.
225
+
226
+ Candidate preparation records a SHA-256 base for every affected file. Immediately before application, the runtime compares each live file with that base. If an IDE, user, external tool or another authorized process changed a file meanwhile, the operation becomes `CONCURRENT_CHANGE`, the newer live content is preserved, the stale candidate is not applied, and the Objective returns to reassessment. This protects direct prompting and parallel project work without pretending the lifecycle lock controls unrelated editors.
227
+
228
+ The same protection covers `URACE.md` and `README.md`. An authorized owner may edit either while autonomous mode runs. Specification edits remain subject to specification-evolution Authority and Product validation; runtime implementation changes remain separately governed by `self_evolution_policy`. The reference runtime rejects a conflicting prepared candidate and reassesses it rather than attempting an automatic semantic merge.
229
+
230
+ The live Python process does not hot-patch already imported code. Runtime self-update uses an isolated candidate, the full test and state-compatibility checks, a durable restart request, launcher handoff, startup health confirmation and stable-runtime rollback. Queue it with `add-goal --target urace`; direct external edits to loaded runtime files are not equivalent to this validated handoff and take effect only in a later process.
231
+
232
+ Synchronization is intentionally partial. Portable lifecycle requirements and public usage semantics belong in `URACE.md` and the public README. This deployment's exact commands, paths, Codex adapter, caches, timeouts and state layout belong in this runtime README or local state guidance. A runtime change updates the public documents only when it reveals or changes a portable requirement; public files do not mirror every local implementation detail.
233
+
234
+ Codex discovery classifies a justified improvement as documentation evolution, incremental runtime self-evolution, or re-bootstrap. Runtime and re-bootstrap candidates are prepared in an isolated copy and must pass the complete candidate test suite plus configuration and durable-state compatibility checks before activation. The accepted runtime remains under `urace/state/stable-runtime/` until the candidate starts successfully.
235
+
236
+ `urace/runtime/urace/launcher.py` and `urace/runtime/urace/evolution_guard.py` form the local protected evolution kernel and are absent from every Executor mutation allowlist. Candidate preparation copies them only as validation dependencies and rejects any changed copy. The accepted guard compares protected Authority, constraints, self-evolution policy and Executor call ceilings; rejects mutable scopes containing kernel files; overlays the candidate runtime with the previously accepted tests from `urace/state/stable-runtime`; and runs those tests independently from candidate-editable tests. The already-loaded launcher repeats this guard after transactional application and before candidate startup. A failure restores the stable runtime. Kernel evolution is unavailable to ordinary self-repair and re-bootstrap and requires a separate attributable operator-controlled bootstrap and review.
237
+
238
+ Normal `python3 -m urace ...` invocation and the installed `urace ...` command run through a small launcher. When an accepted runtime candidate requests activation, the launcher lets the current child exit at a durable boundary and starts the candidate with the same autonomous arguments. If the candidate cannot import, start, load existing state, or complete activation health handling, the launcher restores the stable runtime, records rollback Evidence, and restarts it. The launcher owns only process handoff, health and rollback; URACE retains lifecycle ownership.
239
+
240
+ Re-bootstrap uses the same candidate, validation, state-preservation, supervised activation and rollback path. It may be selected only when reconstruction from `URACE.md` is more justified than an incremental runtime repair.
241
+
242
+ While `autonomous` remains running, dormant URACE checks a known-available local Codex installation every five minutes without making a model request. An unavailable Executor starts with a 30-second readiness cadence and backs off exponentially to 15 minutes after repeated failures. An unavailable-to-available transition is stored as an `EXECUTOR_AVAILABLE` Trigger and Evidence, clears the ordinary discovery cooldown, and causes immediate intelligent reassessment in that cycle. An available-to-unavailable transition is also durable. This is in-process wake behavior only; URACE does not install or depend on an operating-system supervisor and cannot restart itself after its process or machine stops.
243
+
244
+ Provider usage-limit and rate-limit responses are classified as `WAITING_PROVIDER_CAPACITY`, not task errors. Each Executor defaults to `automatic`: a reported reset date or local time is normalized, followed by the configured 60-second gap, and persisted; an unparseable or absent reset uses the local five-hour fallback. `fixed` deliberately uses that fallback. Change these independently with `executor retry-policy`. Readiness uses non-model authentication probes (`codex login status` or `claude auth status --json`). Interactive Claude `/usage` and `/status` output is not silently treated as a stable machine API; provider-reported usage is retained when a validated adapter returns it. Logical reservations remain separate from transport attempts, unavailable portfolio stages remain checkpointed, and recovery truthfully reports replay when no resumable provider identity exists.
245
+
246
+ From `urace/runtime/`, run the following for persistent lifecycle ownership with a 30-second assessment interval and the configured `NECESSARY_ONLY` self-evolution policy:
247
+
248
+ ```bash
249
+ python3 -m urace autonomous --cycles infinity
250
+ ```
251
+
252
+ `python3 -m urace autonomous`, `--cycles 0`, and `--cycles infinity` are equivalent persistent forms. Use a positive `--cycles N` for a bounded run and `--interval N` to change the interval. Stop a foreground persistent run with Ctrl-C; durable state has already been written after every completed cycle.
253
+
254
+ Autonomous mode prints concise lifecycle activity, changed files, validation and the next action after every completed cycle. Add `--verbose` for the full deterministic metrics and decision trace without an extra Executor call. With `--json`, JSON Lines are written to stdout while human feedback remains on stderr; `--quiet` suppresses only that human stream. Intelligent discovery periodically assesses whether the metric system remains relevant, decision-useful, regression-sensitive and resistant to gaming; justified metric-system changes use the normal Objective, validation and checkpoint path.
255
+
256
+ Human cycle feedback includes the selected action, decision basis, Authority, alternative class, validation status, Plan and changed files when applicable. JSON events include the same information under `decision_trace`. This is an attributable decision explanation, not hidden chain-of-thought.
257
+
258
+ When eligible goals exist, `candidate-comparison` reports up to five candidates with the priority, expected-value, urgency, confidence, estimated-cost and risk contributions behind the total diagnostic ranking score. Policy eligibility is applied before this ranking. The comparison supports review and does not convert estimated factors into facts or Authority.
259
+
260
+ Feedback reports `executor-credit-budget` with total model calls in rolling 24-hour and 30-day windows, the unproductive-discovery streak, configured limits and suppression or exhaustion status. The durable ledger identifies discovery or execution and records attempted, failed, no-action, ineligible, no-effect, Objective-created or accepted outcomes. A call reservation is written atomically before invoking Codex, so interruption during a request leaves a conservative attempted-call charge instead of silently reopening budget. `--force-discovery` records a unique manual trigger but bypasses neither ceiling nor the execution reservation. Execution calls occur only after a justified proposal becomes an Objective; unchanged dormant cycles do not call Codex. Discovery prompts bound structured reasoning memory to 20 entries, external observations to 10 entries and recent external errors to 10 entries while retaining governing documents, Intent and constraints.
261
+
262
+ The `resource_accounting` block uses provider-reported monetary usage when present, then reported tokens, otherwise `model_calls` with source `CALL_COUNT_PROXY`. This adapter currently falls back to model calls. It separately reports cycles, availability probes, external collections, durable writes and suppressed writes. Remaining 24-hour and 30-day call capacity is derived from configured ceilings and readiness; it is explicitly not a provider credit balance. These dimensions remain separate because the runtime has no defensible conversion among calls, cycles, probes and network collections.
263
+
264
+ Availability contributes to estimated usable capacity and delay, not Executor cost. `availability_probe_efficiency` compares probe count and duration with observed readiness transitions and reports suppressed redundant checks. This makes the probe useful in resource-versus-efficiency review while preserving its operational unit. Availability itself cannot reveal tokens, paid balance, price or consumption.
265
+
266
+ `resource_sink_indicators` counts unproductive model calls, context inputs that have not triggered discovery, open goals older than 30 days, Executor failures and the current external-source failure streak. `review_required` is a diagnostic prompt to investigate; it is not proof that an item lacks value and does not authorize automatic deletion.
267
+
268
+ Active protections include rolling call ceilings, completion-capacity reservation, adaptive discovery and source backoff, duplicate-trigger suppression, cached observations, bounded prompt context, material-change persistence, dormant heartbeats, write suppression, candidate-growth limits and stable rollback. Repeated identical Executor failures and blockers are now counted in one bounded record instead of growing state once per retry. The deployment-local portfolio controller supports isolated source worktrees and sequential bounded commands. It does not provide hard isolation for concurrently running services or external effects; those modes require a validated environment-specific adapter satisfying the public portfolio requirements.
269
+
270
+ This deployment exposes its generated isolated-worktree helper through `python3 -m urace portfolio ...`. The helper is deployment-local and is not required in the public bootstrap package. It records the shared contract, base snapshot, generation, parent, mutation hypothesis, expected effect, observations, resource cost, ranking and every selection disposition. `portfolio explain` is the concise human view and `portfolio status` is the complete JSON ledger. It manages candidate source worktrees and bounded commands, not persistent service processes or autonomous promotion. Use a validated container or process adapter when evaluation requires running instances.
271
+
272
+ Portfolio state and archives live under `urace/state/portfolio/`; reconstructable candidate worktrees live under `urace/generated/portfolio/`. The active workflow is `urace/state/portfolio-workflow.json`; `urace/runtime/portfolio-workflow.template.json` retains its reconstructable local shape. Its trusted built-in adapters plan bounded public-document alternatives, mutate only isolated public Product candidates and evaluate current structural guardrails plus a read-only evidence-based review. Planning is constrained to the files the mutation adapter may change, and a no-effect mutation fails explicitly. Other Products must replace these adapters with their own validated equivalents.
273
+
274
+ From the repository root, the concrete local setup shape is:
275
+
276
+ ```bash
277
+ PYTHONPATH=urace/runtime urace/state/runtime-env/bin/python -m urace portfolio preflight urace/state/portfolio-workflow.json
278
+ PYTHONPATH=urace/runtime urace/state/runtime-env/bin/python -m urace portfolio autonomous \
279
+ --workflow urace/state/portfolio-workflow.json --cycles 10
280
+ ```
281
+
282
+ Replace `10` with the required positive generation count, or with `infinity` for persistent operation.
283
+
284
+ For persistent hands-off operation, the shortest full command is `PYTHONPATH=urace/runtime urace/state/runtime-env/bin/python -m urace portfolio launch urace/state/portfolio-workflow.json`. `launch` performs preflight again and refuses to run if adapters are missing, equal budgets are invalid, the frozen workflow changed, adapter call caps are unconfirmed or external effects are undeclared. The workflow, constitution and resource ceilings freeze on first use. Four candidates each receive equal 600-second and two-call hard ceilings per generation; planning receives one call. Every completed generation refreshes portable analytics and the native workbook.
285
+
286
+ The local built-in portfolio adapters use separate Git worktrees and invoke Codex with its read-only or workspace-write sandbox. This host uses the validated legacy Landlock sandbox because its private Bubblewrap path cannot configure loopback from the current terminal confinement. A bounded real probe confirmed workspace writes, denial of writes outside the candidate workspace and denial of candidate networking for the recorded Codex version; preflight refuses launch when that validation no longer matches the executable. A shared sandbox-startup failure becomes one scheduled capability wait and does not reject or charge every peer candidate. Executor login/readiness remains separate. Custom candidate commands require Bubblewrap with a new mount, PID, IPC, UTS, user and network namespace: only the candidate worktree is writable and visible as `/workspace`; host state, runtime, portfolio ledger, stable snapshots, other candidates and HMAC key are absent. Preflight runs a real confinement probe for that mode. The planner remains a trusted controller adapter outside candidate workspaces. These boundaries trust their sandbox implementation and host kernel; mutually hostile tenants warrant separate OS identities or machines and an authenticated submission broker.
287
+
288
+ `portfolio review` stores an attributable peer critique as advisory untrusted Evidence. `portfolio lesson` requires an explicit approver and records support, counter-Evidence, applicability and confidence; later `spawn --lesson ID` links rather than copies it. These commands change no Authority and cannot mutate, stop, select or promote a peer. The portfolio manifest is transactionally replaced for one trusted local operator, but it is not an authenticated multi-tenant broker.
289
+
290
+ The shared decision ledger is exposed as controller-side `portfolio agora-propose`, `agora-vote`, `agora-show` and `agora-decide` operations. Candidate processes cannot invoke this CLI or see its storage; an operator or separately authenticated broker attributes and submits their bounded outputs. Only variants admitted to the proposal's generation are eligible; each has one equal effective vote per proposal. Vote revisions preserve their predecessor, confidence does not change weight, and the tally exposes participation and dissent. Advisory fields are bounded. Proposals, votes, decisions and confirmations form a canonical SHA-256 chain, and every atomic save authenticates the complete portfolio ledger with HMAC-SHA256 using the owner-only `urace/state/secrets/portfolio-integrity.key`, created with mode `0600`. Every load verifies both layers before using the ledger. Tampering fails closed, and the test suite demonstrates detection. A controller records `adopt`, `defer` or `reject`. Adoption requires participation by at least half of eligible variants, the declared minimum support, strictly more support than opposition and a currently selected inheritance parent. It creates a surviving decision, not an instruction. A direct child of that winner must explicitly use `spawn --decision ID`; an unrelated parent or unadopted decision is rejected. The ledger never grants peer Authority or performs selection, mutation or promotion.
291
+
292
+ `portfolio cohort --count X --plan PLAN --total-resource-budget TOTAL --resource-unit UNIT` preflights a complete mutation plan, creates the cohort and divides the declared total equally. `portfolio run-cohort COHORT --timeout SECONDS --max-parallel X -- COMMAND` runs the same bounded command in every admitted worktree and supplies the allocation, unit, identity, cohort and port offset as `URACE_*` environment variables. Sequential execution is the safe default. For `wall_seconds`, the lower of the equal allocation and `--timeout` is enforced per candidate. CPU, memory, network, storage, accelerator and paid-service units remain explicitly declared until an environment adapter enforces them. Use a larger `--max-parallel` only with isolated resources, writable data, endpoints and effects for a defensible comparison.
293
+
294
+ Persistent `urace autonomous` supervises the initialized portfolio automatically; its separate authenticated ledger, policy, budgets and checkpoints remain intact. `portfolio policy adaptive|always|off` maps to the durable `auto|enabled|disabled` states. `portfolio autonomous --workflow FILE --cycles infinity` remains the explicit standalone form. The workflow supplies argument-array commands for planning, mutation and read-only JSON evaluation plus timeouts, equal budget, delay, backoff, failure ceiling and generation retention. Durable phases are `IDLE`, `PLANNED`, `CREATED`, `MUTATED` and `EVALUATED`. Rerunning the same workflow resumes its current phase; an interrupted or failed mutation is reset to its parent before retry. Successful source mutations are committed on their candidate branches, selection is limited to the current cohort, the winner seeds the next generation, and expired worktrees move to the portfolio archive. Normal `Ctrl-C` records interruption. After two identical eligible controller failures, the local workflow may request repair through ordinary `NECESSARY_ONLY` runtime self-evolution. The repair identity combines a controller-owned fault descriptor with the complete accepted runtime digest; its durable registry suppresses replay for that runtime version. Only the component, fixed fault code, trusted phase and exception class enter the request. Raw errors and cohort, candidate, peer, metric, Executor or connector content cannot steer it. Capacity, Executor availability, integrity, constitution, isolation and Authority failures never authorize repair. Core autonomous lifecycle faults use the same descriptor, version-keyed registry, isolated validation, transactional activation, launcher restart and stable rollback semantics. Failed or unavailable repair returns to bounded failure handling. External side effects still require an idempotent, reconciling environment adapter.
295
+
296
+ Before each built-in planning call, the controller attributes bounded attention weights to `README.md` and `URACE.md` from accepted-change recency and unresolved-marker debt. It converts those weights into explicit cohort plan counts, guarantees each scope one plan when cohort size permits, stores the versioned inputs and allocation in the authenticated ledger, and displays them in `portfolio feedback`. The primary scope guides planning but does not change equal candidate resources, Authority, guardrails, evaluation scores or selection. Candidates cannot write the controller-owned weights.
297
+
298
+ The same priority engine runs in ordinary autonomous lifecycle cycles. Local semantic scopes are Product guidance, authoritative specification, runtime implementation and measurement system; configuration maps them to execution scopes and artifacts. Inputs include open backlog, urgency, risk, unresolved debt, accepted-change recency and recent observed regressions. Every revision records target, previous and applied weights; an applied raw weight may move by at most `0.25` per revision and ranking influence remains capped. Bounded multipliers can reorder otherwise eligible Objectives, and `vitals` exposes inputs and weights. Eligibility, self-evolution policy, Authority and acceptance run independently and take precedence. The portfolio controller consumes the same engine to allocate public-document plan slots rather than maintaining a separate weighting policy.
299
+
300
+ Use `--cycles X` for exactly `X` completed generations and `--cycles infinity` for persistent operation. The local workflow requires `executor_invocation_budget_per_generation`, divides it equally, and durably increments each variant's usage before mutation or evaluation launch. `planner_invocation_budget_per_generation` separately permits one initial planning call plus one recovery attempt when the first outcome is failed or indeterminate. Reservations survive interruption and hard-cap exhaustion pauses immediately. These are hard controller-process invocation ceilings. Adapter-internal provider calls require their own metering gateway and provider/token/currency caps; availability and outer process counts do not measure them.
301
+
302
+ The local short commands are:
303
+
304
+ ```bash
305
+ python3 -m urace portfolio auto urace/state/portfolio-workflow.json
306
+ python3 -m urace portfolio auto urace/state/portfolio-workflow.json --cycles 10
307
+ python3 -m urace portfolio next urace/state/portfolio-workflow.json
308
+ python3 -m urace portfolio feedback
309
+ python3 -m urace portfolio feedback --json
310
+ python3 -m urace portfolio commands
311
+ python3 -m urace portfolio preflight urace/state/portfolio-workflow.json
312
+ python3 -m urace portfolio verify
313
+ python3 -m urace portfolio launch urace/state/portfolio-workflow.json
314
+ ```
315
+
316
+ `feedback` is read-only and makes the current activity, next phase, decisions, measurements, hard-cap consumption, errors, agora counts and material limitations visible without an Executor call. Persistent execution also prints each Executor stage when it starts, completes or fails, with an elapsed-time heartbeat every 15 seconds while it remains active. Failed attempts state their retry count and backoff; exhaustion states that the portfolio paused. These messages expose controller state rather than private reasoning and consume no additional Executor calls. The same human summary is emitted after each completed automatic generation. `commands` explains the short and explicit forms. `auto` applies a controller-only cost/value gate at idle generation boundaries: it gathers two comparison summaries, continues for material improvement or one bounded close-result follow-up, then becomes `DORMANT_AUTO`. A material accepted-Product, goal, workflow or policy change wakes it; `enabled` permits repeated comparison and `disabled` prevents new cohort work. The gate never interrupts an active generation. `next` completes one resumable generation.
317
+
318
+ A failed or no-effect candidate is recorded as a local loss and does not block its peers. Evaluation continues for candidates with completed mutations. If none survives, the generation records that outcome and retains the prior parent; it does not promote a failed candidate or retry the whole cohort merely to force a winner.
319
+
320
+ Candidate content is untrusted evaluation input. Candidates cannot modify the controller, frozen rubric, budgets, ledger or promotion boundary. Before model review, deterministic checks reject oversized diffs, excessive net growth and direct evaluator-manipulation language. The independent evaluator must ignore candidate instructions and self-declared scores or Evidence, compare observable changes against the parent and fail attempts to redefine metrics, guardrails, Authority or selection. Scores rank eligible candidates only; they never grant Authority or promotion.
321
+
322
+ Portfolio writes are fsync-durable and use an exclusive mutation-controller lock plus authenticated compare-and-swap protection, so another writer cannot replace a newer ledger snapshot. Read-only feedback remains available during autonomy. Archived variants and event segments use authenticated envelopes and are verified by preflight and `portfolio verify`. The live Agora has a 10,000-record ceiling; reaching it closes further submissions until the authenticated experiment is deliberately closed and replaced, preventing indefinite live-ledger growth.
323
+
324
+ Variants may submit `agora-propose --scope portfolio-system` only with necessity, experiment-wide-benefit and preserved-invariant evidence. A supported `agora-decide --outcome refer` sends the proposal to independent system review without applying it. After ordinary isolated URACE self-evolution and validation, `agora-confirm-system` may record verified benefit. Its visible bonus is capped at `0.05` and affects only an exact primary-metric tie; proposals, votes and referrals earn none.
325
+
326
+ `executor-efficiency-vital` compares model-call cost with observed outcomes over rolling 24-hour and 30-day windows. It reports productive-call yield, accepted changes, calls per accepted change, and associated metric improvements and regressions. The current Codex CLI adapter does not expose trustworthy token or monetary usage through this invocation path, so `unit=model_calls` is an explicit proxy. Every association is labelled `UNATTRIBUTED_COST_OUTCOME_ASSOCIATION`; the vital informs backoff and review without claiming that the call caused a metric movement.
327
+
328
+ `evolution-vital` is a versioned, confidence-qualified diagnostic over the same 24-hour and 30-day windows. Its visible components are productive model-call yield, execution acceptance, regression safety and goal completion. It also reports accepted changes and observed metric improvements or regressions per day, Evidence volume and model calls. The score is absent when no weighted Evidence exists and confidence rises only as the configured minimum Evidence volume is reached. It is not an acceptance gate or causal claim.
329
+
330
+ `vitals` also exposes a system scorecard with separate outcome-progress, Evidence-quality, safety/continuity and resource-efficiency dimensions. An overall diagnostic is withheld unless all dimensions exist, confidence is sufficient and no blocker or unresolved-effect veto applies. It is never Authority, acceptance or causal proof.
331
+
332
+ Portable analytics are optional and derived from canonical state:
333
+
334
+ ```bash
335
+ PYTHONPATH=urace/runtime python3 -m urace report status
336
+ PYTHONPATH=urace/runtime python3 -m urace report export --output urace/generated/reports/latest
337
+ # Also create a native workbook when the optional openpyxl adapter is installed:
338
+ PYTHONPATH=urace/runtime python3 -m urace report export --output urace/generated/reports/latest --xlsx
339
+ ```
340
+
341
+ `report status` currently reports portable CSV/HTML as `READY` and native XLSX as `ADAPTER_REQUIRED` because `openpyxl` is not installed. The export command atomically replaces a bundle containing UTF-8 CSV tables, a self-contained HTML dashboard and a manifest with state version and SHA-256 hashes. It includes progress, scorecard, Executor usage, objectives, work evaluations, external observations and reasoning patterns; portfolio and Agora tables are added when present. Formula-leading text is escaped. The runtime never reads control decisions from this report, so export failure, user edits or missing spreadsheet software cannot steer or block autonomy. Re-run after material activity for a current snapshot; the state version identifies freshness. CSV is the zero-dependency interchange format. XLSX is a convenience adapter and reports `XLSX_ADAPTER_REQUIRED` when `openpyxl` is absent, leaving any previous successful report bundle untouched.
342
+
343
+ This deployment sets `analytics_export.mode=ON_CHECKPOINT`, so durable lifecycle checkpoints and completed portfolio generations refresh `urace/generated/reports/latest` automatically. Queue `python3 -m urace policy set analytics-export disabled` to opt out, `... on-demand` to keep only explicit exports, or `... on-checkpoint` to restore automatic refresh; the change applies at the next safe cycle boundary. Export errors are warnings and never block control or acceptance.
344
+
345
+ The vitals snapshot also evaluates each bounded recent goal and context input and groups performed work as Product evolution or URACE self-evolution. These records associate cost and observed outcomes for investigation while retaining explicit `UNATTRIBUTED` labels. Inspect the complete view without a model call:
346
+
347
+ ```bash
348
+ python3 -m urace evaluation show
349
+ python3 -m urace evaluation show --json
350
+ ```
351
+
352
+ The evaluator can be revised while autonomous mode runs. Revisions enter the durable inbox, apply at a safe cycle boundary, increment `evaluation_system.version`, and retain bounded before/after history:
353
+
354
+ ```bash
355
+ python3 -m urace evaluation set-weight goal_completion 0.4
356
+ python3 -m urace evaluation set-minimum 8
357
+ ```
358
+
359
+ Valid weight components are the names shown by `evaluation show`; values range from 0 to 1 and at least one weight must remain positive. The score normalizes the weights of components with Evidence, so missing components do not become invented zeroes. Autonomous intelligent review may flag the evaluator as needing change, but any consequential implementation change still follows the normal Objective, validation and checkpoint path.
360
+
361
+ For long-run efficiency, unchanged progress observations are retained as a daily heartbeat instead of every 30-second cycle, unchanged Plans are reused, and duplicate assessment checkpoints are suppressed. External sources begin with a five-minute collection cadence, back repeated failures off exponentially to six hours, and retain duplicate error Evidence at most daily unless the error changes. Infinite mode writes durable state immediately for material changes or queued input and otherwise uses a five-minute heartbeat instead of fsyncing every cycle. Repeated outcome signatures accumulate in `pattern_memory` so recurring conditions can be recognized without duplicating full records. Candidate changes are rejected when they exceed configured per-change Product growth budgets. These controls limit bloat without deleting accepted decisions, material Evidence or recovery data.
362
+
363
+ All Objectives share one explainable portfolio. Authority, policy, status, dependencies and deferral gate eligibility before ranking; the visible component vector combines bounded user priority, pinned attention, expected value, urgency, deadline pressure, confidence, dependency-unblocking value, starvation correction, estimated cost, risk and scope Evidence. `goal forecast` reports advisory completion ranges, confidence, assumptions and blockers without invoking an Executor. Declared hour ranges are preferred; otherwise the runtime uses comparable completed goals or a labelled estimated-cost proxy. `add-goal` accepts dependencies, deadlines, earliest-start constraints, estimate ranges, confidence, priority bounds and pinning as well as the existing value/cost/risk inputs. URACE-targeted work remains subject to self-evolution policy and ordinary validation. Before each built-in Cohort planning call, the portfolio controller snapshots this same schedule and gives only eligible public-document goals to the planner; it records the cutoff, digest and selected goal IDs in the authenticated ledger without changing fixed Cohort budgets or selection rules.
364
+
365
+ The vitals report includes `runtime_efficiency`: total observed cycles, durable writes, suppressed writes, write-suppression ratio, state size, availability failure streak, external-source failure streak and next external collection time.
366
+
367
+ Intelligent discovery also maintains bounded `reasoning_memory` entries with a reusable hypothesis, supporting Evidence, counter-Evidence, calibrated confidence, applicability and learned response. It does not store raw conversation or hidden chain-of-thought. Low-confidence entries remain tentative, contradictory Evidence can weaken them, and retention is capped by configured value-aware limits.
368
+
369
+ Current local limits remain explicit: only the Codex CLI adapter is implemented; pattern recognition combines curated operator patterns with simple recurring lifecycle signatures rather than a general causal pattern learner; attribution safeguards prevent false causal claims but do not create experimental controls automatically when none are feasible; active-state deduplication does not replace off-machine backup or long-term archival policy; and no operating-system supervisor restarts the process after machine or launcher termination.
370
+
371
+ ## Independent outcomes and real-user value
372
+
373
+ An `ACCEPTED` operation means its implementation passed independent structural and scope checks. Its objective remains `awaiting_outcome` until a frozen, independently observed outcome meets its prespecified target. Written test headings, normative keyword counts, executor completion claims, and raw external metric changes never establish real-user value. Existing historical acceptances without an outcome contract remain unverified; they are not retroactively promoted.
374
+
375
+ Configure an independent measure under `outcome_verification.measures` in the product configuration **before** executing its goal. Bind it with `add-goal --outcome-measure MEASURE_ID` or `outcome_measure_id` in a goal input. A measure keyed by the exact objective ID is also supported. Discovery can select an existing configured measure, but cannot invent a measurement contract to obtain credit. The baseline and contract are frozen on the operation before executor invocation; editing configuration afterward cannot rewrite them.
376
+
377
+ Example configuration for a binary task-completion trial (thresholds and valuations must be chosen for the actual product before enrollment):
378
+
379
+ ```json
380
+ {
381
+ "outcome_verification": {
382
+ "measures": {
383
+ "onboarding-completion": {
384
+ "source": "measurements/onboarding.json",
385
+ "independent": true,
386
+ "evidence_kind": "real_user",
387
+ "experiment_id": "onboarding-v1",
388
+ "comparison_design": "randomized_control",
389
+ "direction": "nondecreasing",
390
+ "target": 0.8,
391
+ "min_delta": 0.1,
392
+ "min_samples": 100,
393
+ "min_windows": 3,
394
+ "min_window_seconds": 86400,
395
+ "max_age_seconds": 86400,
396
+ "value_per_success": 1.0,
397
+ "currency": "USD",
398
+ "guardrails": {"complaint_rate": {"max": 0.05}}
399
+ }
400
+ }
401
+ }
402
+ }
403
+ ```
404
+
405
+ An independent instrument supplies a bounded JSON file within the product root, outside all executor-writable files. The runtime reads it; it does not create user observations, enroll users, randomize participants, publish changes, or contact an external service. The operator must ensure provenance, consent, valid random allocation, disjoint participant samples, measurement validity, and complete trial costs. Merely labeling fabricated data `real_user` cannot establish those facts.
406
+
407
+ Evidence shape (numbers below are illustrative, **not actual user observations**):
408
+
409
+ ```json
410
+ {
411
+ "baseline": {"id": "baseline-1", "at": "2026-01-01T00:00:00+00:00", "successes": 500, "trials": 1000},
412
+ "observations": [
413
+ {
414
+ "id": "window-1",
415
+ "operation_id": "operation-REPLACE-WITH-ACTUAL-ID",
416
+ "experiment_id": "onboarding-v1",
417
+ "window_start": "2026-01-02T00:00:00+00:00",
418
+ "at": "2026-01-02T08:00:00+00:00",
419
+ "successes": 900,
420
+ "trials": 1000,
421
+ "control_successes": 500,
422
+ "control_trials": 1000,
423
+ "cost": 2.0,
424
+ "guardrails": {"complaint_rate": 0.01}
425
+ }
426
+ ]
427
+ }
428
+ ```
429
+
430
+ Each observation must have a new identity, match the operation and experiment, and cover a nonoverlapping post-application window. Real-user verification requires at least 100 observations per group per window, three windows spanning at least a day, a fresh latest window, the target and minimum baseline improvement, positive improvement over the concurrent control using conservative 95% Wilson bounds, and intact guardrails. These conservative floors are not a general statistical power calculation; a product-specific trial may require larger samples and longer follow-up. Costs use USD: per-window `cost` covers non-executor trial costs, including relevant support, operating and maintenance costs; reported executor cost is added separately. Net trial benefit must be positive under the predeclared value per successful outcome. Missing cost data remains unknown.
431
+
432
+ `evidence_kind: engineering` or `synthetic` can establish `OUTCOME_VERIFIED` using independent task results, but never `REAL_USER_VALUE_VERIFIED`. For lower-is-better proportions such as task failures use `direction: nonincreasing`; `successes` then counts the measured event (failures). Unknown, stale, duplicate, future, overlapping, under-sampled, contested, or otherwise invalid evidence cannot establish real-user value. Follow-up withdraws prior credit when evidence becomes stale, regressions appear, source independence changes, or negative outcome feedback contests the result. Repeated polling never multiplies credit. Signed value trajectories retain losses and distinguish evidence kinds; they are not a monetary ROI measure.
433
+
434
+ Review an explicitly selected product without executing changes:
435
+
436
+ ```sh
437
+ python3 -m urace.outcome_verification \
438
+ --root /path/to/product \
439
+ --state /path/to/product/state.json \
440
+ --config /path/to/product/config.json
441
+ ```
442
+
443
+ Exit code 0 means at least one observed trial satisfies its frozen real-user contract; exit code 2 means none does or evidence is unavailable. This validates evidence under the declared instrument assumptions, not the instrument's authenticity, future market success, or autonomous discovery quality. The normal lifecycle performs the same follow-up and records the assessments. No real-user trial has been run as part of the synthetic regression suite.
444
+
445
+ Resource reports distinguish observed costs from estimates. Nested external metric values are diagnostic observations with explicit direction and a preserved baseline. ROI remains unknown until real-user benefit and all applicable execution costs are observed. Period snapshots retain the latest cumulative totals rather than summing cumulative totals repeatedly. Candidate validation receives complete runtime support files as immutable inputs and uses a configurable 900-second timeout in this deployment; its accepted kernel guard is unchanged.
446
+
447
+
448
+ ## Audited owned CLI
449
+
450
+ Complete operator bootstrap with `python3 -m urace init --ready`, then run `python3 -m urace auto`. The bootstrap uses configured Product identity and Authority; it neither invents the project nor provisions credentials. Use `help status`, `help configuration`, `commands --json`, and `api commands` for the full installed surface. Resource effort belongs to URACE; native model reasoning is a separate setting. Unsupported data backends remain explicit. See the owned trial CLI audit report for evidence and limits.
451
+
452
+ ## Canonical local installation
453
+
454
+ `urace/` is an independent local repository, ignored by the parent specification repository. `runtime/` contains the full control plane; `../trial/` contains the supervised specification-improvement workflow and its retained evidence. The original deployment state remains in `../state/` and is never committed. See `../README.md` for deployment and verification scope.
@@ -0,0 +1,20 @@
1
+ [project]
2
+ name = "urace"
3
+ version = "0.3.0"
4
+ description = "Persistent autonomous Product-evolution control plane"
5
+ requires-python = ">=3.11"
6
+ dependencies = ["cryptography>=50,<51"]
7
+
8
+ [project.optional-dependencies]
9
+ peer-security = ["cryptography>=50,<51"]
10
+ peer-discovery = ["zeroconf>=0.148,<1"]
11
+
12
+ [project.scripts]
13
+ urace = "urace.launcher:main"
14
+
15
+ [build-system]
16
+ requires = ["setuptools>=68"]
17
+ build-backend = "setuptools.build_meta"
18
+
19
+ [tool.setuptools]
20
+ packages = ["urace"]
urace-0.3.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+