forge-play 0.1.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.
- forge_play-0.1.0/.gitignore +8 -0
- forge_play-0.1.0/CHANGELOG.md +59 -0
- forge_play-0.1.0/LICENSE +202 -0
- forge_play-0.1.0/NOTICE +14 -0
- forge_play-0.1.0/PKG-INFO +141 -0
- forge_play-0.1.0/README.md +112 -0
- forge_play-0.1.0/demo/fixtures/fork_plan.json +34 -0
- forge_play-0.1.0/demo/the_first_bite.py +671 -0
- forge_play-0.1.0/docs/analysis/2026-08-18-fleet-cross-repo.html +547 -0
- forge_play-0.1.0/docs/design/README.md +30 -0
- forge_play-0.1.0/docs/design/the-forge-engine.md +177 -0
- forge_play-0.1.0/docs/design/the-forge-fsrs.md +191 -0
- forge_play-0.1.0/docs/design/the-forge-human-loop.md +141 -0
- forge_play-0.1.0/docs/design/the-forge-landscape.md +101 -0
- forge_play-0.1.0/docs/design/the-forge-measure.md +147 -0
- forge_play-0.1.0/docs/design/the-forge-promotion.md +164 -0
- forge_play-0.1.0/docs/design/the-forge-readiness.md +318 -0
- forge_play-0.1.0/docs/design/the-forge-reuse-map.md +218 -0
- forge_play-0.1.0/docs/design/the-forge-review-2026-07-31.md +105 -0
- forge_play-0.1.0/docs/design/the-forge-shape.md +843 -0
- forge_play-0.1.0/docs/design/the-forge.md +1220 -0
- forge_play-0.1.0/forge/__init__.py +1 -0
- forge_play-0.1.0/forge/_ids.py +32 -0
- forge_play-0.1.0/forge/build_loop.py +206 -0
- forge_play-0.1.0/forge/calibration.py +94 -0
- forge_play-0.1.0/forge/calibration_ledger.py +288 -0
- forge_play-0.1.0/forge/checkpoint.py +742 -0
- forge_play-0.1.0/forge/checkpoint_calibration.py +536 -0
- forge_play-0.1.0/forge/checkpoint_engagement.py +169 -0
- forge_play-0.1.0/forge/checkpoint_governance.py +265 -0
- forge_play-0.1.0/forge/checkpoint_memory.py +789 -0
- forge_play-0.1.0/forge/checkpoint_nudge.py +268 -0
- forge_play-0.1.0/forge/checkpoint_schedule.py +406 -0
- forge_play-0.1.0/forge/decision_extract.py +173 -0
- forge_play-0.1.0/forge/entry.py +254 -0
- forge_play-0.1.0/forge/friction_floor.py +341 -0
- forge_play-0.1.0/forge/human_loop.py +245 -0
- forge_play-0.1.0/forge/instrument_callgraph.py +241 -0
- forge_play-0.1.0/forge/instrument_execution.py +185 -0
- forge_play-0.1.0/forge/keywords.toml +96 -0
- forge_play-0.1.0/forge/majors.py +155 -0
- forge_play-0.1.0/forge/measure_panel.py +468 -0
- forge_play-0.1.0/forge/model_egress.py +85 -0
- forge_play-0.1.0/forge/model_route.py +174 -0
- forge_play-0.1.0/forge/paths.py +51 -0
- forge_play-0.1.0/forge/plan_shape.py +217 -0
- forge_play-0.1.0/forge/soil_store.py +119 -0
- forge_play-0.1.0/forge/trust.py +107 -0
- forge_play-0.1.0/promotion.json +13 -0
- forge_play-0.1.0/pyproject.toml +74 -0
- forge_play-0.1.0/tests/conftest.py +45 -0
- forge_play-0.1.0/tests/test_build_loop.py +151 -0
- forge_play-0.1.0/tests/test_calibration.py +49 -0
- forge_play-0.1.0/tests/test_calibration_ledger.py +144 -0
- forge_play-0.1.0/tests/test_checkpoint.py +752 -0
- forge_play-0.1.0/tests/test_checkpoint_calibration.py +519 -0
- forge_play-0.1.0/tests/test_checkpoint_engagement.py +101 -0
- forge_play-0.1.0/tests/test_checkpoint_governance.py +105 -0
- forge_play-0.1.0/tests/test_checkpoint_memory.py +424 -0
- forge_play-0.1.0/tests/test_checkpoint_nudge.py +222 -0
- forge_play-0.1.0/tests/test_checkpoint_schedule.py +344 -0
- forge_play-0.1.0/tests/test_decision_extract.py +167 -0
- forge_play-0.1.0/tests/test_demo.py +90 -0
- forge_play-0.1.0/tests/test_entry.py +163 -0
- forge_play-0.1.0/tests/test_human_loop.py +297 -0
- forge_play-0.1.0/tests/test_instrument_callgraph.py +186 -0
- forge_play-0.1.0/tests/test_instrument_execution.py +169 -0
- forge_play-0.1.0/tests/test_majors.py +77 -0
- forge_play-0.1.0/tests/test_measure_panel.py +204 -0
- forge_play-0.1.0/tests/test_measure_panel_pruning.py +70 -0
- forge_play-0.1.0/tests/test_model_route.py +129 -0
- forge_play-0.1.0/tests/test_no_reach_back.py +61 -0
- forge_play-0.1.0/tests/test_paths.py +63 -0
- forge_play-0.1.0/tests/test_promotion_trust.py +100 -0
- forge_play-0.1.0/tests/test_release_wiring.py +369 -0
- forge_play-0.1.0/tests/test_trust.py +100 -0
- forge_play-0.1.0/tests/test_vendor_sync.py +239 -0
- forge_play-0.1.0/tools/changelog_dedup.py +339 -0
- forge_play-0.1.0/tools/promotion_trust.py +184 -0
- forge_play-0.1.0/tools/vendor_sync_check.py +308 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-09-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Added
|
|
7
|
+
|
|
8
|
+
* the Forge engine — the harness that refuses a confident wrong answer ([f611d90](https://github.com/forge-play/Forge/commit/f611d903ba75e47e77b321fc794dbb9d3af67758))
|
|
9
|
+
|
|
10
|
+
## Changelog
|
|
11
|
+
|
|
12
|
+
Maintained by release-please from conventional commits; the first tagged
|
|
13
|
+
release will be `v0.1.0`. Entries below the first release heading are written
|
|
14
|
+
by the tool. This section is the hand-written history of what the engine
|
|
15
|
+
holds on the day the repository began.
|
|
16
|
+
|
|
17
|
+
## Unreleased
|
|
18
|
+
|
|
19
|
+
The engine, complete through the first loop:
|
|
20
|
+
|
|
21
|
+
- **The entry** — `forge/entry.py`: Nestor first (the per-project store), then
|
|
22
|
+
the box, then remote, each tier reporting what it answered; refuses without
|
|
23
|
+
Nestor. `forge/keywords.toml` + `forge/majors.py`: the keyword → major table
|
|
24
|
+
and the deterministic scan over it. More than one major is a `Decision`.
|
|
25
|
+
- **The checkpoint loop** — three bands (auto / recognize / socratic) over the
|
|
26
|
+
maker's sealed decisions (`forge/checkpoint.py`, `checkpoint_memory.py`),
|
|
27
|
+
the engagement gate that scores rubber-stamping (`checkpoint_engagement.py`),
|
|
28
|
+
spaced resurfacing with FSRS or a fixed-interval fallback
|
|
29
|
+
(`checkpoint_schedule.py`, `checkpoint_calibration.py`), the mid-session
|
|
30
|
+
nudge (`checkpoint_nudge.py`), and the governance record: a human-loop queue
|
|
31
|
+
and non-forgeable attestations (`checkpoint_governance.py`, `human_loop.py`).
|
|
32
|
+
- **Decision extraction and the build loop** — `forge/plan_shape.py` (the
|
|
33
|
+
`fork` entry), `decision_extract.py` (forks, open majors, conflicting
|
|
34
|
+
writes), `build_loop.py` (each decision through the checkpoint, the answer
|
|
35
|
+
substituted back, and the calibration wire: predict before, resolve after).
|
|
36
|
+
- **The measuring panel** — `forge/measure_panel.py` with census and hygiene
|
|
37
|
+
instruments, convergence as the alarm, honest coverage states, tool caches
|
|
38
|
+
pruned by name; `instrument_callgraph.py` (dead code via
|
|
39
|
+
codebase-memory-mcp, unreadable output reported as COULD NOT RUN) and
|
|
40
|
+
`instrument_execution.py` (parse-in-a-sandbox via kartikeya).
|
|
41
|
+
- **Calibration** — `forge/calibration.py` and `calibration_ledger.py`: brier,
|
|
42
|
+
log score, hit rate, overconfidence, and one routed review item when the
|
|
43
|
+
model promises more than it delivers.
|
|
44
|
+
- **Model routing and egress** — `forge/model_route.py`, `model_egress.py`:
|
|
45
|
+
local by default, cloud only when the maker's signed manifest asks.
|
|
46
|
+
- **Promotion trust** — `forge/trust.py` and `tools/promotion_trust.py`:
|
|
47
|
+
enroll, ratify, witness — §0.2 (proposing and ratifying never rest in the
|
|
48
|
+
same hand) as a mechanism, not a string.
|
|
49
|
+
- **The demo** — `demo/the_first_bite.py`: one person's day through the
|
|
50
|
+
engine, with a friction log as the real output.
|
|
51
|
+
- **Packaging and release** — `forge-play` on hatchling + hatch-vcs, the
|
|
52
|
+
fleet's release chain (release-please, Trusted Publishing, the PR-title
|
|
53
|
+
guard in both directions), the release-wiring rules as tests, and the
|
|
54
|
+
invariant that the engine never imports willow-mcp.
|
|
55
|
+
|
|
56
|
+
Origins: the engine was designed and first built inside `safe-app-store`
|
|
57
|
+
(2026-07 → 2026-08), extracted to a standalone repository on 2026-08-11, and
|
|
58
|
+
carried to this greenfield home with its history left behind on 2026-09-03.
|
|
59
|
+
The founding design is in `docs/design/`.
|
forge_play-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
forge_play-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
The Forge
|
|
2
|
+
Copyright 2026 the SAFE App Store authors.
|
|
3
|
+
|
|
4
|
+
This product includes software developed as part of the SAFE App Store
|
|
5
|
+
(rudi193-cmd/safe-app-store), Apache-2.0.
|
|
6
|
+
|
|
7
|
+
Vendored components (each Apache-2.0, copied rather than depended-on to keep the
|
|
8
|
+
engine dependency-light; see each file's header for provenance):
|
|
9
|
+
|
|
10
|
+
forge/calibration.py — calibration math, from oakenscrolls-office
|
|
11
|
+
forge/friction_floor.py — sycophancy/mirror scorer, from willow-gate via willow-mcp
|
|
12
|
+
forge/human_loop.py — attestation + human_required queue, from willow-mcp
|
|
13
|
+
forge/model_egress.py — is_local_host egress detection, from willow-mcp
|
|
14
|
+
forge/_ids.py — builder-id charset, from safe-app-store principal.py
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: forge-play
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The Forge — a refuse-a-confident-wrong-answer harness (checkpoint loop + measuring panel) for SAFE-native AI app building
|
|
5
|
+
Project-URL: Homepage, https://github.com/forge-play/Forge
|
|
6
|
+
Project-URL: Changelog, https://github.com/forge-play/Forge/blob/master/CHANGELOG.md
|
|
7
|
+
Author: Sean Campbell
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: NOTICE
|
|
11
|
+
Keywords: calibration,checkpoint,forge,governance,human-in-the-loop,nestor,willow
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: nestor-meaning<1.0.0,>=0.19.0; extra == 'test'
|
|
24
|
+
Requires-Dist: pytest>=8.0; extra == 'test'
|
|
25
|
+
Requires-Dist: pyyaml; extra == 'test'
|
|
26
|
+
Provides-Extra: trust
|
|
27
|
+
Requires-Dist: nestor-meaning[gate]; extra == 'trust'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# The Forge
|
|
31
|
+
|
|
32
|
+
**The engine that refuses a confident wrong answer.** *Per ignem, probatur — proven through fire.*
|
|
33
|
+
|
|
34
|
+
[](pyproject.toml)
|
|
35
|
+
[](LICENSE)
|
|
36
|
+
[](pyproject.toml)
|
|
37
|
+
|
|
38
|
+
The Forge is the **model side** of a SAFE-native app-building system: not a
|
|
39
|
+
model that emits answers, but the harness that refuses to let a confident wrong
|
|
40
|
+
one stand. It is the engine every builder in the fleet pins, and it needs **no
|
|
41
|
+
live model** to run — it works on decisions, plans and build directories the
|
|
42
|
+
way a linter works on source.
|
|
43
|
+
|
|
44
|
+
It asks one question of everything that passes through it: **has a human
|
|
45
|
+
already answered this?** When the answer is on file, the maker is confirmed,
|
|
46
|
+
not re-asked. When it is not, the maker is asked once, properly, and the answer
|
|
47
|
+
is sealed in their own memory. Waved-through answers come back sooner; argued
|
|
48
|
+
ones go away longer. And every time the engine states a confidence, it finds
|
|
49
|
+
out afterwards whether that confidence was earned.
|
|
50
|
+
|
|
51
|
+
## What it refuses, and where
|
|
52
|
+
|
|
53
|
+
| | Layer | What it refuses |
|
|
54
|
+
|---|-------|-----------------|
|
|
55
|
+
| 🚪 | **The entry** (`forge/entry.py`) | a build that never asked. Nestor is the *first* tool, not an available one: the entry asks the project's memory before anything else and refuses outright without it. Then the box, then remote — and it says which tier answered. |
|
|
56
|
+
| ⚖ | **The checkpoint loop** (`forge/checkpoint.py`) | a confident wrong **decision** — a three-band interaction (auto / recognize / socratic) over a memory of the maker's sealed decisions, with an engagement gate that scores rubber-stamping and a governance layer that records the maker's non-forgeable sign-off. *Authorship is not authority.* |
|
|
57
|
+
| 🔍 | **The measuring panel** (`forge/measure_panel.py`) | a confident wrong **artifact** — measuring instruments run across a build; **convergence** (two or more instruments naming one artifact) is the alarm, and the panel reports its own coverage honestly, so a class nothing measured is named *unseen*, never *sound*. |
|
|
58
|
+
| 📊 | **The calibration wire** (`forge/build_loop.py`) | a confidence nobody checked — a prediction is recorded before the maker answers and resolved after, against what they actually chose. Ground truth that arrives on its own. |
|
|
59
|
+
|
|
60
|
+
## From a sentence to a seal
|
|
61
|
+
|
|
62
|
+
The loop, end to end, with no model in it:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install forge-play nestor-meaning # or, in a checkout: pip install -e '.[test]'
|
|
66
|
+
|
|
67
|
+
# 1. the entry — Nestor first, then the keyword → major table, then the first
|
|
68
|
+
# decision through the router. Run it twice: asked once, confirmed the second time.
|
|
69
|
+
python -m forge.entry "I got sum kol sites for app to spin" --project rally --builder rosalind --choose web
|
|
70
|
+
|
|
71
|
+
# 2. a plan with a fork in it — extraction, the checkpoint, the calibration wire
|
|
72
|
+
python -m forge.decision_extract demo/fixtures/fork_plan.json
|
|
73
|
+
python -m forge.build_loop demo/fixtures/fork_plan.json --builder rosalind --choose "where-the-dates-live=exif in place"
|
|
74
|
+
|
|
75
|
+
# 3. the whole day, as a person would have it — the friction log is the real output
|
|
76
|
+
python demo/the_first_bite.py
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- `forge/keywords.toml` — the keyword → major table. A flat file to read and argue with.
|
|
80
|
+
- `forge/majors.py` — the scan over it: a span of text in, hits out. Deterministic, model-free, two callers (the Forge's entry and the corpus's prose lane) through one interface.
|
|
81
|
+
- `forge/plan_shape.py` — the decision-bearing plan: `file_write` entries plus one `fork` kind that carries a decision (options, tradeoffs, a recommendation, a confidence). A model-written plan carries forks; nothing else it writes reaches the router.
|
|
82
|
+
- `forge/decision_extract.py` — noticing *that* a decision is being made, by rule: a fork the proposer declared, a major the sentence left open, two writes to one path.
|
|
83
|
+
- `forge/build_loop.py` — each decision through the checkpoint, the answer substituted back, no fork left; and the prediction recorded before, resolved after.
|
|
84
|
+
- `forge/calibration_ledger.py` — the scorecard: brier, hit rate, overconfidence — and one `review` item routed to a human when the model promises more than it delivers.
|
|
85
|
+
|
|
86
|
+
## The home
|
|
87
|
+
|
|
88
|
+
All Forge state hangs off a single root: **`~/.forge`** (override `FORGE_HOME`),
|
|
89
|
+
resolved in one place, `forge/paths.py`. Under it: the per-builder checkpoint
|
|
90
|
+
memory and calibration ledger (`checkpoints/`), and the per-project Nestor
|
|
91
|
+
store (`projects/<project>/nestor/`) — a store whose whole content is one
|
|
92
|
+
build's world, disposable, portable, and the first thing the entry asks.
|
|
93
|
+
|
|
94
|
+
## Dependencies
|
|
95
|
+
|
|
96
|
+
Zero at runtime, on purpose — the same promise `kartikeya` and `jeles` make,
|
|
97
|
+
and the reason `willow-mcp` can take this package cheaply. Every heavy piece
|
|
98
|
+
is soft, and the engine degrades around its absence honestly:
|
|
99
|
+
|
|
100
|
+
| Absent | The engine still runs, but… |
|
|
101
|
+
|--------|------------------------------|
|
|
102
|
+
| **Nestor** (`nestor-meaning`, the decision seal) | **the entry refuses** — a build that never asked cannot start. Everywhere else: full-Socratic every time, decisions made but not sealed, no recognition, no reseal. |
|
|
103
|
+
| **fsrs** (spaced resurfacing) | fixed-interval fallback |
|
|
104
|
+
| **kartikeya** (the sandbox) | the `execution` instrument declares an honest coverage gap instead of parsing unsandboxed |
|
|
105
|
+
| **codebase-memory-mcp** (the call graph) | `call-graph` is named uncovered; a payload it cannot read is COULD NOT RUN, never clean |
|
|
106
|
+
| **willow-gate** (`forge[trust]`) | the promotion-trust seam is off; `verified_by` stays a string the host checks |
|
|
107
|
+
|
|
108
|
+
The Forge never imports `willow-mcp`. Willow depends on the Forge; the reverse
|
|
109
|
+
would be a cycle, and `tests/test_no_reach_back.py` keeps it that way. Three
|
|
110
|
+
modules (`human_loop`, `friction_floor`, `model_egress`) are vendored
|
|
111
|
+
byte-for-byte from willow-mcp until they move home the other way;
|
|
112
|
+
`tools/vendor_sync_check.py` keeps them honest meanwhile.
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pip install -e '.[test]'
|
|
118
|
+
pytest
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The suite is green with the soft dependencies present; individual tests skip
|
|
122
|
+
or fall back when theirs is absent. With the fleet's per-verifier Nestor
|
|
123
|
+
keyring in your environment the seal tests are correctly refused (a synthetic
|
|
124
|
+
verifier has no key) — run with `NESTOR_KEYRING` unset.
|
|
125
|
+
|
|
126
|
+
Releases are cut by release-please from conventional commits and published to
|
|
127
|
+
PyPI as `forge-play` through Trusted Publishing; the version is the git tag,
|
|
128
|
+
never a literal. `tests/test_release_wiring.py` holds the fifteen rules that
|
|
129
|
+
keep the three release files agreeing. Only commits that change what
|
|
130
|
+
`pip install forge-play` gives someone cut a release.
|
|
131
|
+
|
|
132
|
+
## Design
|
|
133
|
+
|
|
134
|
+
`docs/design/` holds the founding design — the decisions the engine was built
|
|
135
|
+
from, and the record of what is built and what is next. Decisions made since
|
|
136
|
+
live as drafts in the engine's own per-project Nestor, waiting for a human
|
|
137
|
+
seal. Documents are cited, never sealed.
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
Apache-2.0. See `LICENSE` and `NOTICE`.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# The Forge
|
|
2
|
+
|
|
3
|
+
**The engine that refuses a confident wrong answer.** *Per ignem, probatur — proven through fire.*
|
|
4
|
+
|
|
5
|
+
[](pyproject.toml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](pyproject.toml)
|
|
8
|
+
|
|
9
|
+
The Forge is the **model side** of a SAFE-native app-building system: not a
|
|
10
|
+
model that emits answers, but the harness that refuses to let a confident wrong
|
|
11
|
+
one stand. It is the engine every builder in the fleet pins, and it needs **no
|
|
12
|
+
live model** to run — it works on decisions, plans and build directories the
|
|
13
|
+
way a linter works on source.
|
|
14
|
+
|
|
15
|
+
It asks one question of everything that passes through it: **has a human
|
|
16
|
+
already answered this?** When the answer is on file, the maker is confirmed,
|
|
17
|
+
not re-asked. When it is not, the maker is asked once, properly, and the answer
|
|
18
|
+
is sealed in their own memory. Waved-through answers come back sooner; argued
|
|
19
|
+
ones go away longer. And every time the engine states a confidence, it finds
|
|
20
|
+
out afterwards whether that confidence was earned.
|
|
21
|
+
|
|
22
|
+
## What it refuses, and where
|
|
23
|
+
|
|
24
|
+
| | Layer | What it refuses |
|
|
25
|
+
|---|-------|-----------------|
|
|
26
|
+
| 🚪 | **The entry** (`forge/entry.py`) | a build that never asked. Nestor is the *first* tool, not an available one: the entry asks the project's memory before anything else and refuses outright without it. Then the box, then remote — and it says which tier answered. |
|
|
27
|
+
| ⚖ | **The checkpoint loop** (`forge/checkpoint.py`) | a confident wrong **decision** — a three-band interaction (auto / recognize / socratic) over a memory of the maker's sealed decisions, with an engagement gate that scores rubber-stamping and a governance layer that records the maker's non-forgeable sign-off. *Authorship is not authority.* |
|
|
28
|
+
| 🔍 | **The measuring panel** (`forge/measure_panel.py`) | a confident wrong **artifact** — measuring instruments run across a build; **convergence** (two or more instruments naming one artifact) is the alarm, and the panel reports its own coverage honestly, so a class nothing measured is named *unseen*, never *sound*. |
|
|
29
|
+
| 📊 | **The calibration wire** (`forge/build_loop.py`) | a confidence nobody checked — a prediction is recorded before the maker answers and resolved after, against what they actually chose. Ground truth that arrives on its own. |
|
|
30
|
+
|
|
31
|
+
## From a sentence to a seal
|
|
32
|
+
|
|
33
|
+
The loop, end to end, with no model in it:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install forge-play nestor-meaning # or, in a checkout: pip install -e '.[test]'
|
|
37
|
+
|
|
38
|
+
# 1. the entry — Nestor first, then the keyword → major table, then the first
|
|
39
|
+
# decision through the router. Run it twice: asked once, confirmed the second time.
|
|
40
|
+
python -m forge.entry "I got sum kol sites for app to spin" --project rally --builder rosalind --choose web
|
|
41
|
+
|
|
42
|
+
# 2. a plan with a fork in it — extraction, the checkpoint, the calibration wire
|
|
43
|
+
python -m forge.decision_extract demo/fixtures/fork_plan.json
|
|
44
|
+
python -m forge.build_loop demo/fixtures/fork_plan.json --builder rosalind --choose "where-the-dates-live=exif in place"
|
|
45
|
+
|
|
46
|
+
# 3. the whole day, as a person would have it — the friction log is the real output
|
|
47
|
+
python demo/the_first_bite.py
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- `forge/keywords.toml` — the keyword → major table. A flat file to read and argue with.
|
|
51
|
+
- `forge/majors.py` — the scan over it: a span of text in, hits out. Deterministic, model-free, two callers (the Forge's entry and the corpus's prose lane) through one interface.
|
|
52
|
+
- `forge/plan_shape.py` — the decision-bearing plan: `file_write` entries plus one `fork` kind that carries a decision (options, tradeoffs, a recommendation, a confidence). A model-written plan carries forks; nothing else it writes reaches the router.
|
|
53
|
+
- `forge/decision_extract.py` — noticing *that* a decision is being made, by rule: a fork the proposer declared, a major the sentence left open, two writes to one path.
|
|
54
|
+
- `forge/build_loop.py` — each decision through the checkpoint, the answer substituted back, no fork left; and the prediction recorded before, resolved after.
|
|
55
|
+
- `forge/calibration_ledger.py` — the scorecard: brier, hit rate, overconfidence — and one `review` item routed to a human when the model promises more than it delivers.
|
|
56
|
+
|
|
57
|
+
## The home
|
|
58
|
+
|
|
59
|
+
All Forge state hangs off a single root: **`~/.forge`** (override `FORGE_HOME`),
|
|
60
|
+
resolved in one place, `forge/paths.py`. Under it: the per-builder checkpoint
|
|
61
|
+
memory and calibration ledger (`checkpoints/`), and the per-project Nestor
|
|
62
|
+
store (`projects/<project>/nestor/`) — a store whose whole content is one
|
|
63
|
+
build's world, disposable, portable, and the first thing the entry asks.
|
|
64
|
+
|
|
65
|
+
## Dependencies
|
|
66
|
+
|
|
67
|
+
Zero at runtime, on purpose — the same promise `kartikeya` and `jeles` make,
|
|
68
|
+
and the reason `willow-mcp` can take this package cheaply. Every heavy piece
|
|
69
|
+
is soft, and the engine degrades around its absence honestly:
|
|
70
|
+
|
|
71
|
+
| Absent | The engine still runs, but… |
|
|
72
|
+
|--------|------------------------------|
|
|
73
|
+
| **Nestor** (`nestor-meaning`, the decision seal) | **the entry refuses** — a build that never asked cannot start. Everywhere else: full-Socratic every time, decisions made but not sealed, no recognition, no reseal. |
|
|
74
|
+
| **fsrs** (spaced resurfacing) | fixed-interval fallback |
|
|
75
|
+
| **kartikeya** (the sandbox) | the `execution` instrument declares an honest coverage gap instead of parsing unsandboxed |
|
|
76
|
+
| **codebase-memory-mcp** (the call graph) | `call-graph` is named uncovered; a payload it cannot read is COULD NOT RUN, never clean |
|
|
77
|
+
| **willow-gate** (`forge[trust]`) | the promotion-trust seam is off; `verified_by` stays a string the host checks |
|
|
78
|
+
|
|
79
|
+
The Forge never imports `willow-mcp`. Willow depends on the Forge; the reverse
|
|
80
|
+
would be a cycle, and `tests/test_no_reach_back.py` keeps it that way. Three
|
|
81
|
+
modules (`human_loop`, `friction_floor`, `model_egress`) are vendored
|
|
82
|
+
byte-for-byte from willow-mcp until they move home the other way;
|
|
83
|
+
`tools/vendor_sync_check.py` keeps them honest meanwhile.
|
|
84
|
+
|
|
85
|
+
## Development
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install -e '.[test]'
|
|
89
|
+
pytest
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The suite is green with the soft dependencies present; individual tests skip
|
|
93
|
+
or fall back when theirs is absent. With the fleet's per-verifier Nestor
|
|
94
|
+
keyring in your environment the seal tests are correctly refused (a synthetic
|
|
95
|
+
verifier has no key) — run with `NESTOR_KEYRING` unset.
|
|
96
|
+
|
|
97
|
+
Releases are cut by release-please from conventional commits and published to
|
|
98
|
+
PyPI as `forge-play` through Trusted Publishing; the version is the git tag,
|
|
99
|
+
never a literal. `tests/test_release_wiring.py` holds the fifteen rules that
|
|
100
|
+
keep the three release files agreeing. Only commits that change what
|
|
101
|
+
`pip install forge-play` gives someone cut a release.
|
|
102
|
+
|
|
103
|
+
## Design
|
|
104
|
+
|
|
105
|
+
`docs/design/` holds the founding design — the decisions the engine was built
|
|
106
|
+
from, and the record of what is built and what is next. Decisions made since
|
|
107
|
+
live as drafts in the engine's own per-project Nestor, waiting for a human
|
|
108
|
+
seal. Documents are cited, never sealed.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
Apache-2.0. See `LICENSE` and `NOTICE`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_name": "rally-dates",
|
|
3
|
+
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"kind": "file_write",
|
|
6
|
+
"dest_path": "README.md",
|
|
7
|
+
"content": "# rally-dates\n\nTells Rosalind which rally pictures have no date on them.\n"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"kind": "fork",
|
|
11
|
+
"decision_type": "where-the-dates-live",
|
|
12
|
+
"surface": "When a picture gets a date, where does the date go?",
|
|
13
|
+
"options": [
|
|
14
|
+
{"label": "sidecar json", "tradeoff": "the pictures stay untouched; the dates live in a file beside them and can be lost separately"},
|
|
15
|
+
{"label": "exif in place", "tradeoff": "the date travels with the picture forever; the original bytes change"}
|
|
16
|
+
],
|
|
17
|
+
"recommended": "sidecar json",
|
|
18
|
+
"confidence": 0.8,
|
|
19
|
+
"resolves": {
|
|
20
|
+
"sidecar json": [
|
|
21
|
+
{"kind": "file_write", "dest_path": "dates.py", "content": "# writes <picture>.json beside each picture\n"}
|
|
22
|
+
],
|
|
23
|
+
"exif in place": [
|
|
24
|
+
{"kind": "file_write", "dest_path": "dates.py", "content": "# writes DateTimeOriginal into each picture's EXIF\n"}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"kind": "file_write",
|
|
30
|
+
"dest_path": "app.py",
|
|
31
|
+
"content": "print('which pics have no date?')\n"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|