From ff3261a50f1423bbe0f08b8f63b4add93576cbce Mon Sep 17 00:00:00 2001 From: Weksa Date: Thu, 12 Nov 2026 09:46:50 +0000 Subject: [PATCH] Lows: show-working publishes by allowlist and prints Display, edition_year says first appearance The split guard failed open on any new split name; it now allows Train and split-less items only. The page printed Debug of Refusal/StoreError and the EntityRead store message; it prints Display and a fixed line. edition_year held the first-appearance year of the work or translation, not the page read: the doc comment and published schema say so. Co-Authored-By: Claude Sonnet 5.5 --- crates/weksa/examples/show_working.rs | 6 +++--- crates/weksa/src/corpus.rs | 6 +++++- schemas/cultnet/weksa.corpus_item.schema.json | 3 ++- tools/show-working/build.py | 4 +++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/crates/weksa/examples/show_working.rs b/crates/weksa/examples/show_working.rs index dae9ca9..8c23fb2 100644 --- a/crates/weksa/examples/show_working.rs +++ b/crates/weksa/examples/show_working.rs @@ -258,7 +258,7 @@ fn lower_error(e: &LowerError) -> Value { LowerError::DanglingStress { entity, at } => ("DanglingStress", format!("the ruled pronunciation of {entity} has a stress mark at {at} with no vowel after it")), LowerError::ConsentMissing { predication } => ("ConsentMissing", format!("{predication} is a request the packet does not carry the addressee's consent to")), LowerError::AskerNotAddressee { predication } => ("AskerNotAddressee", format!("the agent of {predication} is not the addressee")), - LowerError::EntityRead { entity, why } => ("EntityRead", format!("reading {entity}: {why}")), + LowerError::EntityRead { entity, .. } => ("EntityRead", format!("the entity store failed reading {entity}")), }; json!({ "variant": variant, "reason": reason }) } @@ -279,11 +279,11 @@ fn run(w: &World, dir: &Path, packet: &Packet) -> Result<(String, Value), Value> Err(StoreError::Invalid(rs)) => { return Err(json!({ "kind": "admission_refused", - "refusals": rs.iter().map(|r| json!({ "rule": r.rule(), "detail": format!("{r:?}") })).collect::>(), + "refusals": rs.iter().map(|r| json!({ "rule": r.rule(), "detail": r.to_string() })).collect::>(), })); } Err(e) => { - return Err(json!({ "kind": "admission_refused", "refusals": [{ "rule": "store", "detail": format!("{e:?}") }] })); + return Err(json!({ "kind": "admission_refused", "refusals": [{ "rule": "store", "detail": e.to_string() }] })); } }; let text = lower(&view, &w.inv, &w.entities).map_err(|e| { diff --git a/crates/weksa/src/corpus.rs b/crates/weksa/src/corpus.rs index a2f94ae..4afa662 100644 --- a/crates/weksa/src/corpus.rs +++ b/crates/weksa/src/corpus.rs @@ -32,7 +32,7 @@ pub enum Source { /// A public-domain work, with everything a reader needs to check the claim: /// the edition's licence and the jurisdiction the public-domain status is /// asserted in, who translated it (the translation is the text's copyright, - /// not the original's) and when the edition appeared. A work missing any + /// not the original's) and when the work or translation first appeared. A work missing any /// is refused at admission. PublicDomain { work: String, @@ -41,6 +41,10 @@ pub enum Source { licence: String, jurisdiction: String, translator: String, + /// The year the work, or for a translation this translation, first + /// appeared. It is not the year of the `edition_url` file's source + /// print: Project Gutenberg's text may be a later or modernised + /// edition, and the claim rests on the date of first appearance. edition_year: u16, }, /// Labelled model output; never in the test split. The rule that it is diff --git a/schemas/cultnet/weksa.corpus_item.schema.json b/schemas/cultnet/weksa.corpus_item.schema.json index b5e5bc9..1bd6083 100644 --- a/schemas/cultnet/weksa.corpus_item.schema.json +++ b/schemas/cultnet/weksa.corpus_item.schema.json @@ -170,7 +170,7 @@ ] }, { - "description": "A public-domain work, with everything a reader needs to check the claim:\nthe edition's licence and the jurisdiction the public-domain status is\nasserted in, who translated it (the translation is the text's copyright,\nnot the original's) and when the edition appeared. A work missing any\nis refused at admission.", + "description": "A public-domain work, with everything a reader needs to check the claim:\nthe edition's licence and the jurisdiction the public-domain status is\nasserted in, who translated it (the translation is the text's copyright,\nnot the original's) and when the work or translation first appeared. A work missing any\nis refused at admission.", "type": "object", "properties": { "PublicDomain": { @@ -183,6 +183,7 @@ "type": "string" }, "edition_year": { + "description": "The year the work, or for a translation this translation, first\nappeared. It is not the year of the `edition_url` file's source\nprint: Project Gutenberg's text may be a later or modernised\nedition, and the claim rests on the date of first appearance.", "type": "integer", "format": "uint16", "maximum": 65535, diff --git a/tools/show-working/build.py b/tools/show-working/build.py index 84e5189..ede5458 100755 --- a/tools/show-working/build.py +++ b/tools/show-working/build.py @@ -59,7 +59,9 @@ for m in re.finditer(r'^(item:\S+) \[(.*?)\]\n "(.*)"$', run([str(weksa_bin), " if set(corpus) != cited: sys.exit(f"corpus dump lacks cited items {sorted(cited - set(corpus))}; unexpected {sorted(set(corpus) - cited)}") # The dump's meta ends with the split (`... group=g Validation`, `... excluded`). -held_out = {k: v["meta"].split()[-1] for k, v in corpus.items() if v["meta"].split()[-1] in ("Validation", "Test")} +# Only Train and split-less items publish; any other name, including a split +# added later, is held out until it is allowed here. +held_out = {k: v["meta"].split()[-1] for k, v in corpus.items() if v["meta"].split()[-1] not in ("Train", "excluded")} if held_out: sys.exit(f"refusing to publish held-out items (nothing written): {held_out}") model = "qwen3-embedding:0.6b"