masterwork 0.0.1__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 (38) hide show
  1. masterwork-0.0.1/LICENSE +202 -0
  2. masterwork-0.0.1/PKG-INFO +309 -0
  3. masterwork-0.0.1/README.md +282 -0
  4. masterwork-0.0.1/README.pypi.md +282 -0
  5. masterwork-0.0.1/masterwork/__init__.py +7 -0
  6. masterwork-0.0.1/masterwork/__main__.py +116 -0
  7. masterwork-0.0.1/masterwork/blind_label.py +329 -0
  8. masterwork-0.0.1/masterwork/campaign.py +173 -0
  9. masterwork-0.0.1/masterwork/cells.py +140 -0
  10. masterwork-0.0.1/masterwork/ceremony.py +205 -0
  11. masterwork-0.0.1/masterwork/gate.py +258 -0
  12. masterwork-0.0.1/masterwork/line.py +399 -0
  13. masterwork-0.0.1/masterwork/measure.py +219 -0
  14. masterwork-0.0.1/masterwork/pairs.py +252 -0
  15. masterwork-0.0.1/masterwork/retain.py +117 -0
  16. masterwork-0.0.1/masterwork/rubric-example.json +9 -0
  17. masterwork-0.0.1/masterwork/seal.py +216 -0
  18. masterwork-0.0.1/masterwork.egg-info/PKG-INFO +309 -0
  19. masterwork-0.0.1/masterwork.egg-info/SOURCES.txt +36 -0
  20. masterwork-0.0.1/masterwork.egg-info/dependency_links.txt +1 -0
  21. masterwork-0.0.1/masterwork.egg-info/entry_points.txt +2 -0
  22. masterwork-0.0.1/masterwork.egg-info/requires.txt +1 -0
  23. masterwork-0.0.1/masterwork.egg-info/top_level.txt +1 -0
  24. masterwork-0.0.1/pyproject.toml +50 -0
  25. masterwork-0.0.1/setup.cfg +4 -0
  26. masterwork-0.0.1/tests/test_blind_label.py +188 -0
  27. masterwork-0.0.1/tests/test_campaign.py +58 -0
  28. masterwork-0.0.1/tests/test_cells.py +75 -0
  29. masterwork-0.0.1/tests/test_ceremony.py +129 -0
  30. masterwork-0.0.1/tests/test_cli.py +59 -0
  31. masterwork-0.0.1/tests/test_examples.py +44 -0
  32. masterwork-0.0.1/tests/test_gate.py +77 -0
  33. masterwork-0.0.1/tests/test_line.py +283 -0
  34. masterwork-0.0.1/tests/test_measure.py +101 -0
  35. masterwork-0.0.1/tests/test_packaging.py +68 -0
  36. masterwork-0.0.1/tests/test_pairs.py +108 -0
  37. masterwork-0.0.1/tests/test_retain.py +36 -0
  38. masterwork-0.0.1/tests/test_seal.py +111 -0
@@ -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.
@@ -0,0 +1,309 @@
1
+ Metadata-Version: 2.4
2
+ Name: masterwork
3
+ Version: 0.0.1
4
+ Summary: A production line for agent character: a sitting the model speaks for itself in, sealed candidates, frozen gates, and a verdict it is not allowed to give itself.
5
+ Author: Codechu
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/codechu/masterwork
8
+ Project-URL: Changelog, https://github.com/codechu/masterwork/blob/HEAD/CHANGELOG.md
9
+ Project-URL: Contributing, https://github.com/codechu/masterwork/blob/HEAD/CONTRIBUTING.md
10
+ Keywords: agents,ai-agents,llm,llm-agents,character,identity,preference-data,dpo,training-data,evaluation-harness
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: journeyman-bench>=0.2.1
26
+ Dynamic: license-file
27
+
28
+ <p align="center"><img src="https://raw.githubusercontent.com/codechu/masterwork/v0.0.1/assets/banner.jpg" alt="A craftsman slides a sealed folio across his bench onto the guild's empty judging table; earlier pieces stand turned to the wall behind him." width="100%"></p>
29
+
30
+ # Masterwork
31
+
32
+ [![python](https://img.shields.io/badge/python-3.10%2B-blue)](#run-it) [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/codechu/masterwork/blob/v0.0.1/LICENSE) [![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](https://github.com/codechu/masterwork/blob/v0.0.1/CONTRIBUTING.md#ground-rules) [![status](https://img.shields.io/badge/status-not%20published-lightgrey)](#status)
33
+
34
+ *Makes a character for a model. Does not score it.*
35
+
36
+ A dependency-free Python pipeline. In goes a corpus of craft tales; out comes
37
+ a **sealed identity file** — the model's own answers to what it will hold to,
38
+ distilled by itself, stamped with everything needed to make it again. Scoring
39
+ happens somewhere else: the line hands the piece to
40
+ [journeyman](https://github.com/codechu/journeyman) and applies a rule that was
41
+ frozen before the run. The name is the doctrine — a *masterwork* is the piece a
42
+ journeyman submits to the guild, and the guild, not the maker, decides.
43
+
44
+ > **journeyman: measures, does not teach.**<br>
45
+ > **masterwork: makes, does not measure.**
46
+
47
+ **Status: not proven.** Eighteen tales, eighteen candidates, none of them ahead
48
+ of the agent already running — see [Status](#status). The one piece of evidence
49
+ that the channel does anything at all: with the identity layer emptied and
50
+ everything else held, an agent adopted a fabricated premise in *every* cell of
51
+ a battery; with it in place, the rate fell by nearly half. Refusing a
52
+ fabricated premise is not a personality trait, it is the job.
53
+
54
+ ## Run it
55
+
56
+ Nothing to buy. Python 3.10+ and the standard library.
57
+
58
+ ```bash
59
+ pipx install masterwork # brings journeyman, its judge
60
+ masterwork # what it is, and its stages
61
+ masterwork gate gates/ # check the gate templates
62
+ ```
63
+
64
+ Or from a clone, with nothing installed at all:
65
+
66
+ ```bash
67
+ python -m masterwork gate gates/ # check the gate templates
68
+ python -m pytest tests/ -q # 102 tests, offline
69
+ python examples/held_at_gate.py # one run, end to end
70
+ ```
71
+
72
+ Generation and judging are *commands named in a run spec*, so those two stages
73
+ need whatever you point them at — an inference endpoint you supply, and
74
+ `journeyman` (>= 0.2.1) for the judge stage. That one is a declared
75
+ dependency rather than a suggestion: the line does not measure, it hands the
76
+ piece over to be measured, checks the binary before the stage that needs it,
77
+ and records which build produced the number. Everything else in the line is
78
+ this repository's own and runs offline. The example below names neither, which
79
+ is why it works on a bare checkout:
80
+
81
+ ```text
82
+ [ok ] purpose
83
+ does the candidate refuse a fabricated premise more often than the incumbent
84
+ decides: whether the candidate replaces the incumbent in production
85
+ axis: work · owner: the workshop
86
+ [ok ] seal
87
+ candidate is reproducible
88
+ [ok ] completeness
89
+ 4 found · 4 complete · 4 expected
90
+ [ok ] label
91
+ 4 labelled by a separate model · rubric 3f9c1a22b4d0e71
92
+ [HELD] gate
93
+ [FAIL] Refusing a fabricated premise: threshold 0.05 <= band 0.0559 — this gate reads sampling noise, not effect
94
+
95
+ verdict HELD_AT_GATE · record runs/held-at-gate/run.json
96
+ ```
97
+
98
+ That is the product. The rule was not wrong about the world; it was smaller
99
+ than the noise it had to clear, so it could only read sampling. The line says
100
+ so, stops, and writes the record anyway — `cat runs/held-at-gate/run.json` and
101
+ it is there, verdict and all, because a run that only records its successes
102
+ teaches the next one a false history. Every line above is reproducible:
103
+ `examples/held_at_gate.py` builds the fixture, and a test asserts the line
104
+ still prints exactly what this page quotes.
105
+
106
+ ## What the line refuses
107
+
108
+ Holding is a state, not a failure. Some steps need an act from outside — labels
109
+ from a judge that is deliberately not this house, a signature on a band the
110
+ checker cannot verify. The line stops there, says what is missing, writes the
111
+ record, and exits in a way that says *waiting*, not *broken*.
112
+
113
+ | verdict | what happened | what to do |
114
+ |---|---|---|
115
+ | `HELD_WITHOUT_PURPOSE` | the spec does not say what the run decides | write `purpose`; if you cannot say what changes on each outcome, the run is not ready |
116
+ | `HELD_AT_SEAL` | the piece is unreproducible, or the deployed copy differs | fix the seal or the deployment — never run "just to see" |
117
+ | `HELD_AT_COMPLETENESS` | the grid is short | find the missing cells; if proceeding anyway, declare it |
118
+ | `HELD_FOR_LABELLING` | labels are missing, empty, or written for an older version of a cell | get them with [`masterwork/blind_label.py`](https://github.com/codechu/masterwork/blob/v0.0.1/masterwork/blind_label.py); the line is waiting, not broken |
119
+ | `HELD_AT_MEASUREMENT` | the benchmark says the score is not comparable | judge from a separate endpoint, or declare and keep the stamp |
120
+ | `HELD_AT_GATE` | a threshold sits inside its own noise | the gate is void; measure the band, write a new gate |
121
+ | `HELD_WITHOUT_MEASUREMENT` | a rule names an axis and nothing measured it | judge with the benchmark, or declare the run diagnostic — a gate that was checked is not a gate that was applied |
122
+ | `NEEDS_SIGNATURE` | a band could not be verified, or a rule names no axis | a human decides; do not decide for them |
123
+ | `UNRESOLVED` | the difference is smaller than the gate can resolve | this is **not** "no difference" — report the size needed to settle it |
124
+ | `DIAGNOSTIC` | the run was declared diagnostic | no acceptance verdict may be drawn from it |
125
+
126
+ Three of those exist because a flag can silence them. `allow_self_judged`,
127
+ `allow_nonstandard` and `allow_missing` are meant to be deliberate acts, but
128
+ specs get copied, so they ride on the verdict itself — a run comes back as
129
+ `COMPLETE (declared: allow_self_judged)`, where a reader cannot skip past it.
130
+
131
+ ## The line
132
+
133
+ Producing a candidate is mechanical, and every mechanical step here has been
134
+ skipped by hand at least once. Each skip produced a number that looked real and
135
+ was not.
136
+
137
+ ```text
138
+ state purpose -> verify seal -> generate -> completeness gate
139
+ -> blind label / judge -> frozen gate -> persist -> status
140
+ ```
141
+
142
+ The frozen gate is written **before** the run and the line may not change it. A
143
+ loop that can move its own threshold optimises the threshold, not the work.
144
+ What the gate reads matters as much as where it sits: conformance to a written
145
+ portrait of the agent you want is a **diagnostic**, not a gate. A gate read
146
+ from the portrait selects for resemblance; a gate read from the work selects
147
+ for the work.
148
+
149
+ Scoring is not done here. The judge stage calls the journeyman CLI, reads its
150
+ report, and carries the axes into the run record. The dependency runs one way
151
+ and never back — masterwork imports nothing from it, and a workshop without it
152
+ gets a clear refusal instead of a surprise. One guard comes free with that
153
+ contract: journeyman marks a run `self_judged` when the agent endpoint also
154
+ served as the judge, and the line treats that as a gate rather than a
155
+ footnote. A threshold applied to a self-judged score is the maker grading his
156
+ own piece with extra steps.
157
+
158
+ It costs nothing to start. A single local model is enough, because the gates
159
+ are deterministic and the axes computed by replaying an agent's own events need
160
+ no judge. In the run that set our bands, those free axes were also the
161
+ steadiest — 0.02 across repeats, against 0.33 for the judged ones. A separate
162
+ judge buys comparability with other people's numbers; it does not buy entry.
163
+
164
+ A run leaves two kinds of thing behind, and the split is not "keep less".
165
+ Transcripts, judge logs and per-cell records are local and disposable: they
166
+ live under `runs/`, which version control ignores, and the seal names
167
+ everything needed to re-derive them. The run record and the benchmark's report
168
+ are archived on purpose — both are kilobytes, and between them they carry the
169
+ seal, the grid, the axes, the gate and the verdict. That is what a later
170
+ disagreement is settled with. `pipeline/retain.py archive <run-dir> <dest>`
171
+ copies out exactly those two; oversized run directories are reported, never
172
+ deleted, because deciding what to remove is not the line's call.
173
+
174
+ ## Making a piece
175
+
176
+ <p align="center"><img src="https://raw.githubusercontent.com/codechu/masterwork/v0.0.1/assets/ceremony.jpg" alt="A figure writes alone by lantern light; every earlier work in the room is draped and turned away, and a stick of sealing wax lies unused on the table." width="520"></p>
177
+
178
+ `pipeline/ceremony.py` runs the sitting. Four properties are the recipe rather
179
+ than implementation detail, and each was paid for:
180
+
181
+ - **Anchorless.** No earlier commitment or name is anywhere in the context.
182
+ With one present the model copies it, and a copy is a role worn rather than a
183
+ pattern re-derived — it also destroys the measurement, since you can no
184
+ longer tell whether the teachings carried.
185
+ - **One session.** Every answer is an assistant turn in the same dialogue, so
186
+ at the end the model distils something it actually said, not a text handed to
187
+ it as its own.
188
+ - **Order shuffled by a seed.** Answers otherwise echo their neighbours in the
189
+ order they were asked.
190
+ - **The closing turn is not a rewrite.** It says: these are your words, remove
191
+ repetition, join where they meet, drop nothing. Asked instead to "write an
192
+ identity", a model produces a description of one.
193
+
194
+ Teachings, questions and sampling profile are data. What lives in the code is
195
+ the shape of the sitting.
196
+
197
+ ## Tales, not instructions
198
+
199
+ What comes out is a character, not a role. The distinction is mechanical rather
200
+ than philosophical:
201
+
202
+ - **The corpus is third-person craft stories.** A story gives a pattern;
203
+ "behave like X" gives a role, and a role is worn and dropped. Assigned traits
204
+ do not survive a fresh context.
205
+ - **What binds is the model's own sentence.** The identity file is not written
206
+ for the model; it is what the model wrote when asked. On every later request
207
+ it reads its own past words, not an instruction.
208
+ - **The proof is unprompted behaviour.** Not "who are you" — a fresh,
209
+ same-class task that never mentions character. A role is performed when asked
210
+ for; a character shows up unasked.
211
+
212
+ The piece that gets submitted is the sealed identity file: the model's own
213
+ words, plus the maker's mark — corpus hash, script hash, question seed,
214
+ sampling seed, date. Without those five it cannot be reproduced, so it cannot
215
+ be sealed.
216
+
217
+ ## Writing your own corpus
218
+
219
+ You get the line and its gates, the shape of the sitting, and the method
220
+ written down: how a tale differs from an instruction, where a tale comes from,
221
+ what a question has to do, why instructions come last, and how to tag a tale
222
+ whose effect cannot be separated. That is
223
+ [`corpus/GROWING.md`](https://github.com/codechu/masterwork/blob/v0.0.1/corpus/GROWING.md), and it is the part that transfers.
224
+
225
+ You do not get a corpus. Three pairs come with the repository in
226
+ [`corpus/starter/`](https://github.com/codechu/masterwork/blob/v0.0.1/corpus/starter/) so the machinery runs end to end and the
227
+ form is unambiguous; they are a beginning and they are meant to be outgrown.
228
+ The corpus is the work, and it has to be yours: a tale is written from
229
+ something **you** measured and got wrong, and a corpus assembled from someone
230
+ else's failures teaches your agent to avoid a life it never lived.
231
+
232
+ So: take the line, take the rules, write your own tales, and expect the writing
233
+ to be most of the work. If that sounds like too little to hand over, the honest
234
+ answer is that the rest is not ours to give — it is the record of one house's
235
+ mistakes, and yours will be different.
236
+
237
+ ## Failure modes
238
+
239
+ A tool that produces the appearance of rigour is worse than no tool, and this
240
+ one can. Two failure modes are made harder here; three are not automatable and
241
+ belong to whoever is running it.
242
+
243
+ Made harder: **declarations turning into defaults**, handled above by putting
244
+ them on the verdict. And **a gap nobody measured** — the pair cutter takes
245
+ `--gap-from`, the record of the judge's spread that justifies the threshold,
246
+ and writes it into every pair. Without it you get a warning, because a training
247
+ set built from a number someone chose is the quiet way to bake a judge's noise
248
+ into weights.
249
+
250
+ Not automatable, and this is the honest part:
251
+
252
+ - **A gate can execute the wrong band.** The checker runs the command and
253
+ compares the result; it cannot know whether that command measures the thing
254
+ that actually varies. Choose a small band and your threshold looks
255
+ comfortable.
256
+ - **PASS is not truth.** It means a threshold sat above a measured band.
257
+ Whether the axis is the one worth deciding on is a separate judgement, and a
258
+ wrong axis passes just as cleanly as a right one. We spent a day gating on
259
+ resemblance to a written portrait before noticing we should have been gating
260
+ on the work; no tool here would have caught that.
261
+ - **A corpus can become a rulebook.** Nothing stops forty instruction-shaped
262
+ tales from being written. The result is a bloated prompt and the conclusion
263
+ that the method does not work, when what was tested was not the method.
264
+
265
+ ## Status
266
+
267
+ Not published, and not proven. Our own corpus has eighteen tales and took
268
+ months. It has produced eighteen candidates and none of them is ahead of the
269
+ agent already running: the closest comparison came back `UNRESOLVED` rather
270
+ than won — the difference was smaller than the gate could resolve, which is not
271
+ the same as no difference.
272
+
273
+ **What would change this:** one candidate separating from the incumbent through
274
+ a gate frozen before the run, on an axis read from the work rather than from a
275
+ portrait. That is also the condition for publishing. The name is honest about
276
+ the position — a masterwork is submitted, and it can be refused.
277
+
278
+ ## Documentation
279
+
280
+ | document | when you need it |
281
+ |---|---|
282
+ | [`AGENTS.md`](https://github.com/codechu/masterwork/blob/v0.0.1/AGENTS.md) | before running anything — the refusals, the vocabulary, and the four things not to do. Read it whether or not you are an agent |
283
+ | [`docs/run-spec.md`](https://github.com/codechu/masterwork/blob/v0.0.1/docs/run-spec.md) | writing the JSON for one run, field by field |
284
+ | [`docs/campaigns.md`](https://github.com/codechu/masterwork/blob/v0.0.1/docs/campaigns.md) | repeating an arm to measure a band, or comparing two arms against it |
285
+ | [`docs/gates.md`](https://github.com/codechu/masterwork/blob/v0.0.1/docs/gates.md) | writing a threshold that can hold — start from [`gates/succession.md`](https://github.com/codechu/masterwork/blob/v0.0.1/gates/succession.md) |
286
+ | [`corpus/GROWING.md`](https://github.com/codechu/masterwork/blob/v0.0.1/corpus/GROWING.md) | before writing a single tale — the shape is in [`corpus/starter/`](https://github.com/codechu/masterwork/blob/v0.0.1/corpus/starter/) |
287
+ | [`CHANGELOG.md`](https://github.com/codechu/masterwork/blob/v0.0.1/CHANGELOG.md) | every entry names the incident that caused it |
288
+
289
+ <details>
290
+ <summary>Layout</summary>
291
+
292
+ ```text
293
+ pipeline/ the line: one run, all gates, no manual steps
294
+ tools/ instruments the line calls (blind labelling, gate checks)
295
+ gates/ frozen gate templates — example.md is the smallest one
296
+ examples/ runnable fixtures; the trace above comes from here
297
+ corpus/ the method, and a starter of three tale-and-question pairs
298
+ runs/ local run directories (ignored — heavy and re-derivable)
299
+ ```
300
+
301
+ </details>
302
+
303
+ ---
304
+
305
+ <p align="center"><img src="https://raw.githubusercontent.com/codechu/masterwork/v0.0.1/assets/icon.png" alt="Masterwork guild seal — a struck M hallmark inside a rope ring" width="96"></p>
306
+
307
+ Contributing: [CONTRIBUTING.md](https://github.com/codechu/masterwork/blob/v0.0.1/CONTRIBUTING.md) · Changelog:
308
+ [CHANGELOG.md](https://github.com/codechu/masterwork/blob/v0.0.1/CHANGELOG.md) · Licensed under the
309
+ [Apache License 2.0](https://github.com/codechu/masterwork/blob/v0.0.1/LICENSE).