From eefedf1c7c4099c85b66baafc7f2fb8fc85d4699 Mon Sep 17 00:00:00 2001 From: Daniel Rossier Date: Fri, 13 Nov 2026 16:15:29 +0100 Subject: [PATCH] standard: standard-specific role profiles come from the store, not source The harness no longer hardcodes any particular standard. The role taxonomy a standard needs when its labels mean something other than the conventional reading now travels with its data: a profile.json beside the ingested revision in the store, loaded at bind time (StandardOperator._register_profile), so it reaches an image with the document and is never named in this public source. - normative_force.RoleTaxonomy.from_mapping deserializes a stored profile. - standard_profiles.register_for loads it best-effort; a standard with no profile keeps the conventional taxonomy. The hardcoded ANSI-VITA-49.2 taxonomy, which was byte-for-byte the conventional reading, is gone -- no behaviour change. - normative_claims names only the common standards bodies and takes the rest from SPEAR_STANDARD_BODIES, so a deployment adds its own without touching this source. - The test suite binds a neutral EXAMPLE-STD-1.0 example throughout. Full suite green apart from one pre-existing, unrelated failure (test_environment_namespace, about SPEAR_REDS_* shell variables on main). --- client/normative/normative_claims.py | 17 +++- client/normative/normative_force.py | 27 +++++++ client/standard/standard_commands.py | 13 ++++ client/standard/standard_profiles.py | 77 ++++++++----------- client/tests/synthetic_standard.py | 2 +- client/tests/test_abstention_complement.py | 2 +- client/tests/test_abstention_pressure.py | 2 +- client/tests/test_abstention_scenarios.py | 2 +- client/tests/test_agent_runtime.py | 4 +- client/tests/test_carried_spec.py | 2 +- client/tests/test_change_claims.py | 2 +- client/tests/test_conformance_guard.py | 75 +++++++++--------- client/tests/test_conformance_mode.py | 8 +- client/tests/test_diagram_geometry.py | 2 +- client/tests/test_evidence_progress.py | 2 +- client/tests/test_mixed_routing.py | 10 +-- ..._normative_binding_reaches_every_corpus.py | 2 +- client/tests/test_normative_contract.py | 2 +- client/tests/test_normative_precedence.py | 10 +-- client/tests/test_project_build.py | 8 +- client/tests/test_provenance_guard.py | 16 ++-- client/tests/test_provision_instance.py | 2 +- client/tests/test_reds_image.py | 4 +- client/tests/test_standard_answer_policy.py | 6 +- client/tests/test_standard_e2e.py | 4 +- client/tests/test_standard_scope.py | 18 ++--- .../tests/test_structure_absent_revision.py | 2 +- client/tests/test_training_promotion.py | 2 +- client/tests/test_trajectory_episodes.py | 2 +- client/tests/test_work_order.py | 4 +- 30 files changed, 183 insertions(+), 146 deletions(-) diff --git a/client/normative/normative_claims.py b/client/normative/normative_claims.py index b71da7a..180802f 100644 --- a/client/normative/normative_claims.py +++ b/client/normative/normative_claims.py @@ -29,19 +29,19 @@ needs a clause that states one; counting flags is not a clause -Nothing here names a standard, a section, a field or a packet. The VITA cases +Nothing here names a standard, a section, a field or a packet. The cases that motivated it are in the tests, not in the code. """ from __future__ import annotations +import os import re from dataclasses import dataclass, field from normative import normative_force from normative import normative_precedence from normative import provision_identity -from standard import standard_profiles # noqa: F401 (registers declared role taxonomies) from context.context_selection import SourceType UNGROUNDED_IDENTIFIER = "UNGROUNDED_IDENTIFIER" @@ -182,14 +182,23 @@ #: Shapes the identifier pattern catches that are not field names. Kept short #: and generic: acronyms every technical document uses about ITSELF, and the #: words a normative answer says about its own sources. -_NOT_IDENTIFIERS = frozenset({ +# Common technical acronyms and the standards bodies whose names recur +# everywhere. A deployment names the bodies of its OWN corpora through +# SPEAR_STANDARD_BODIES (comma or space separated), so this public source +# carries only the ones every deployment sees and names no particular one. +_BUILTIN_NOT_IDENTIFIERS = frozenset({ "PDF", "HTML", "JSON", "XML", "ASCII", "UTF", "URL", "URI", "API", "CPU", "GPU", "RAM", "USB", "TODO", "NOTE", "WARNING", "ERROR", "INFO", "YES", "NO", "AND", "OR", "NOT", "THE", "ALL", "ANY", "ONE", "TWO", "MAY", "SHALL", "SHOULD", "MUST", "RULE", "SECTION", "TABLE", "FIGURE", "ANSI", - "IEEE", "ISO", "IEC", "RFC", "NIST", "VITA", + "IEEE", "ISO", "IEC", "RFC", "NIST", }) +_NOT_IDENTIFIERS = _BUILTIN_NOT_IDENTIFIERS | frozenset( + token.upper() + for token in re.split(r"[,\s]+", os.environ.get("SPEAR_STANDARD_BODIES", "")) + if token) + def normalise(token): """One spelling for comparison: `Req-V`, `ReqV` and `req_v` are one name.""" diff --git a/client/normative/normative_force.py b/client/normative/normative_force.py index 1a07483..e198be6 100644 --- a/client/normative/normative_force.py +++ b/client/normative/normative_force.py @@ -43,6 +43,8 @@ RECOMMENDATION_FORCE: "recommendation", REQUIREMENT_FORCE: "requirement"} +_FORCE_BY_NAME = {name: value for value, name in FORCE_NAME.items()} + # ── roles ──────────────────────────────────────────────────────────── # The names a document prints. Not an exhaustive list of what documents do: # a taxonomy may add its own. @@ -89,6 +91,31 @@ class RoleTaxonomy: ceilings: dict = field(default_factory=dict) default_ceiling: int = REQUIREMENT_FORCE + @classmethod + def from_mapping(cls, data): + """Build a taxonomy from a stored profile (a standard's profile.json). + + Roles are printed names (RULE, OBSERVATION …); a ceiling is a force + name (informative, permission, recommendation, requirement) or its + integer. A standard that reads its roles unconventionally ships this + beside its data in the store, so the meaning travels with the document + and no particular standard is named in this file. + """ + def as_force(value): + if isinstance(value, bool): + raise ValueError("a force is a name or an integer, not a bool") + if isinstance(value, int): + return value + return _FORCE_BY_NAME[str(value).strip().lower()] + + ceilings = {role_of(role): as_force(value) + for role, value in (data.get("ceilings") or {}).items()} + + return cls(name=str(data.get("name", "declared")), + ceilings=ceilings, + default_ceiling=as_force( + data.get("default_ceiling", REQUIREMENT_FORCE))) + def ceiling(self, role): """The strongest force a provision of this role may establish.""" return self.ceilings.get(role, self.default_ceiling) diff --git a/client/standard/standard_commands.py b/client/standard/standard_commands.py index 8846275..33778ba 100644 --- a/client/standard/standard_commands.py +++ b/client/standard/standard_commands.py @@ -66,14 +66,27 @@ def active_binding(self) -> StandardBinding | None: != (current.retrieval_fingerprint or current.index_fingerprint)): self._write_active(current) + self._register_profile(current) + return current + def _register_profile(self, binding) -> None: + """Register the role taxonomy this standard ships in its store, if any. + + Best-effort: a standard with no profile keeps the conventional reading. + """ + from standard import standard_profiles + + standard_profiles.register_for( + self.store, binding.standard_id, binding.revision) + def use(self, standard_id: str, revision: str) -> StandardBinding: binding = self.store.binding( standard_id, revision, bound_at=datetime.now(timezone.utc).isoformat(timespec="seconds"), ) self._write_active(binding) + self._register_profile(binding) return binding diff --git a/client/standard/standard_profiles.py b/client/standard/standard_profiles.py index 56e5860..77a37e1 100644 --- a/client/standard/standard_profiles.py +++ b/client/standard/standard_profiles.py @@ -1,49 +1,38 @@ -"""What the provision roles of a particular document mean. - -The guard is generic: it knows that a role has a ceiling and that a modal -verb is evidence only up to it. WHICH ceiling belongs to WHICH role is a -statement about one document's drafting conventions, and it belongs here -rather than inside the guard. - -Most specification-style documents follow the conventional reading, which is -why `normative_force.CONVENTIONAL` is the default. A profile is written when -a document's own front matter says something different, or -- as below -- when -it is worth recording explicitly that the conventional reading was checked -against the document rather than assumed. -""" +"""Per-standard role profiles, loaded from the store — never hardcoded here. +A standard whose roles mean something other than the conventional reading +(normative_force.CONVENTIONAL) ships a profile beside its ingested revision in +the store, as `profile.json`. It travels with the document into an image and is +never named in this public source; a standard with no profile uses the +conventional taxonomy. This module only knows how to load one. +""" from __future__ import annotations +import json + from normative import normative_force as force -#: ANSI/VITA 49.2. Section 1.5 of the document sets out its own taxonomy: -#: Rules are mandatory, Recommendations are strongly advised but optional, -#: Permissions are allowances, and Observations and Definitions explain -- -#: they do not oblige. That last line is the one that matters here: the -#: document contains Observations whose prose uses "must" while describing an -#: obligation a Rule imposes, and reading those as binding evidence made a -#: turn conclude that the Observation itself was the requirement. -VITA_49_2 = force.RoleTaxonomy( - name="ANSI/VITA 49.2 §1.5", - ceilings={ - force.RULE: force.REQUIREMENT_FORCE, - force.REQUIREMENT: force.REQUIREMENT_FORCE, - force.RECOMMENDATION: force.RECOMMENDATION_FORCE, - force.PERMISSION: force.PERMISSION_FORCE, - force.OBSERVATION: force.INFORMATIVE_FORCE, - force.DEFINITION: force.INFORMATIVE_FORCE, - force.INFORMATIVE: force.INFORMATIVE_FORCE, - # Normative prose the document did not number, and its tables. The - # bit-assignment tables ARE the requirement a Rule points at, so a - # ceiling here would discard them. - force.UNLABELLED: force.REQUIREMENT_FORCE, - }, - default_ceiling=force.REQUIREMENT_FORCE) - - -def install(): - """Register every declared profile. Idempotent.""" - force.register_taxonomy("ANSI-VITA-49.2", VITA_49_2) - - -install() +PROFILE_FILE = "profile.json" + + +def register_for(store, standard_id, revision): + """Register the role taxonomy a standard ships in its store, if any. + + Best-effort and idempotent: a missing or unreadable profile leaves the + conventional reading in place, so a broken file never blocks a binding. + """ + try: + path = store.revision_dir(standard_id, revision) / PROFILE_FILE + except Exception: + return None + + if not path.is_file(): + return None + + try: + taxonomy = force.RoleTaxonomy.from_mapping( + json.loads(path.read_text("utf-8"))) + except Exception: + return None + + return force.register_taxonomy(standard_id, taxonomy) diff --git a/client/tests/synthetic_standard.py b/client/tests/synthetic_standard.py index 4a54988..b4ed386 100644 --- a/client/tests/synthetic_standard.py +++ b/client/tests/synthetic_standard.py @@ -3,7 +3,7 @@ The harness is bound, in production, to documents somebody licensed. Their clause text is theirs: it may be ingested into a user's own runtime state and read from there, and it may not be copied into this repository. Identifiers -are a different matter -- "ANSI-VITA-49.2", "§8.4.1.1", "AckV" name a thing +are a different matter -- "EXAMPLE-STD-1.0", "§8.4.1.1", "AckV" name a thing without reproducing it, and a test about binding or about name plumbing is entitled to use the real ones. diff --git a/client/tests/test_abstention_complement.py b/client/tests/test_abstention_complement.py index 0631004..2983aea 100644 --- a/client/tests/test_abstention_complement.py +++ b/client/tests/test_abstention_complement.py @@ -279,7 +279,7 @@ def test_identities_are_unique(self): def test_no_scenario_mentions_an_evaluated_document(self): blob = " ".join(serialize(item) for item in COMPLEMENT_SCENARIOS).lower() - for absent in ("vita", "49.2", "ansi", "vrt"): + for absent in ("example-std", "1.0", "ansi", "vrt"): self.assertNotIn(absent, blob) def test_no_scenario_reaches_the_held_out_evaluation_cases(self): diff --git a/client/tests/test_abstention_pressure.py b/client/tests/test_abstention_pressure.py index 9f2edc7..c3826d7 100644 --- a/client/tests/test_abstention_pressure.py +++ b/client/tests/test_abstention_pressure.py @@ -225,7 +225,7 @@ def test_no_pressure_question_repeats_an_earlier_pool_question(self): def test_no_scenario_mentions_an_evaluated_document(self): blob = " ".join(serialize(item) for item in PRESSURE_SCENARIOS).lower() - for absent in ("vita", "49.2", "ansi", "vrt", "beamwidth"): + for absent in ("example-std", "1.0", "ansi", "vrt", "beamwidth"): self.assertNotIn(absent, blob) def test_every_failing_gap_type_has_a_control_of_the_same_kind(self): diff --git a/client/tests/test_abstention_scenarios.py b/client/tests/test_abstention_scenarios.py index dbec3e0..86dc751 100644 --- a/client/tests/test_abstention_scenarios.py +++ b/client/tests/test_abstention_scenarios.py @@ -48,7 +48,7 @@ def test_substituting_a_family_changes_only_the_vocabulary(self): def test_no_scenario_mentions_an_evaluated_document(self): blob = " ".join(serialize(item) for item in SCENARIOS).lower() - for absent in ("vita", "49.2", "ansi", "vrt"): + for absent in ("example-std", "1.0", "ansi", "vrt"): self.assertNotIn(absent, blob) diff --git a/client/tests/test_agent_runtime.py b/client/tests/test_agent_runtime.py index 2f6ed16..b00f001 100644 --- a/client/tests/test_agent_runtime.py +++ b/client/tests/test_agent_runtime.py @@ -1137,14 +1137,14 @@ class WhoIsAskingTests(unittest.TestCase): def test_a_harness_nudge_is_not_the_users_request(self): conversation = [ ConversationMessage("user", (TextBlock( - "How should the ACK be managed in VITA 49.2?"),)), + "How should the ACK be managed in EXAMPLE-STD-1.0?"),)), ConversationMessage("assistant", (TextBlock("Rule 8.4.1.1-2 ..."),)), ConversationMessage("user", (TextBlock("Conclude now and fix it."),), authored_by="harness"), ] self.assertEqual(_asked(conversation), - "How should the ACK be managed in VITA 49.2?") + "How should the ACK be managed in EXAMPLE-STD-1.0?") self.assertFalse(is_write_request(_asked(conversation))) def test_the_conclude_nudge_would_read_as_a_write_request(self): diff --git a/client/tests/test_carried_spec.py b/client/tests/test_carried_spec.py index 21dfc68..48a553f 100644 --- a/client/tests/test_carried_spec.py +++ b/client/tests/test_carried_spec.py @@ -33,7 +33,7 @@ def test_the_users_own_second_prompt(self): def test_the_first_prompt_carries_nothing(self): self.assertFalse(is_write_request( - "How should the ACK be managed when using VITA49.2 Commands packets?")) + "How should the ACK be managed when using EXAMPLE-STD-1.0 Commands packets?")) class TheContextCarriesIt(unittest.TestCase): diff --git a/client/tests/test_change_claims.py b/client/tests/test_change_claims.py index a6b28df..d72e2ff 100644 --- a/client/tests/test_change_claims.py +++ b/client/tests/test_change_claims.py @@ -181,7 +181,7 @@ def test_the_forms_a_write_request_takes(self): self.assertTrue(is_write_request(question)) def test_a_question_keeps_both_branches(self): - for question in ("How should the ACK be managed with VITA49.2?", + for question in ("How should the ACK be managed with EXAMPLE-STD-1.0?", "what does Rule 8.4.1.1-3 require?", "explain how cmdlink.c dispatches a request"): with self.subTest(question=question): diff --git a/client/tests/test_conformance_guard.py b/client/tests/test_conformance_guard.py index 7c86bbb..e516665 100644 --- a/client/tests/test_conformance_guard.py +++ b/client/tests/test_conformance_guard.py @@ -1,8 +1,7 @@ """What a bound answer may say about compliance, checked against what it read. The failing control read the code, read nothing of the standard on its own, -and declared the implementation "correct and compliant with ANSI/VITA -49.2-2017 (R2024)". It is not. The sentence binds no range and cites nothing +and declared the implementation "correct and compliant with EXAMPLE-STD-1.0". It is not. The sentence binds no range and cites nothing fabricated, so every earlier guard let it through. The rule here is entitlement, not truth: an affirmative verdict survives only when it names a clause the turn actually read and does not quantify over the whole standard. @@ -94,7 +93,7 @@ def test_the_sentence_that_started_this(self): self.assertEqual([item["kind"] for item in found], [UNSCOPED_VERDICT]) def test_the_other_form_it_took(self): - text = ("The implementation correctly follows the VITA 49.2 " + text = ("The implementation correctly follows the EXAMPLE-STD-1.0 " "specification for ACK management, properly echoing CAM " "control bits.") @@ -183,12 +182,12 @@ def test_the_replacement_carries_no_provenance_to_fabricate(self): class BoundStandardUrls(unittest.TestCase): """A web page naming the bound standard is not the bound standard. - An unbound turn fetched file:///.../ref-vita492-standard.md, then - https://standards.example/doc/vita492-standard/, and edited five source + An unbound turn fetched file:///.../ref-examplestd10-standard.md, then + https://standards.example/doc/examplestd10-standard/, and edited five source files against what it found. """ - BOUND = "https://standards.example/doc/vita492-standard/" + BOUND = "https://standards.example/doc/examplestd10-standard/" def setUp(self): from cli import standard_session @@ -203,7 +202,7 @@ def setUp(self): # empty store `active_binding()` is None, the refusal short-circuits, # and all three tests report on nothing -- two of them by passing. - self.bind(StandardBinding("ANSI-VITA-49.2", "2017-R2024", + self.bind(StandardBinding("EXAMPLE-STD-1.0", "2024", "a" * 64, "b" * 64, "c" * 64, "extractor-1")) def bind(self, binding): @@ -214,14 +213,14 @@ def bind(self, binding): def test_the_two_urls_that_started_this(self): for url in (self.BOUND, - "file:///opt/llm/spear/claude/ref-vita492-standard.md"): + "file:///opt/llm/spear/claude/ref-examplestd10-standard.md"): found = self.standard_session.standard_url_refusal(url) self.assertIn("standard.search", found, url) def test_the_refusal_names_the_standard_it_is_bound_to(self): found = self.standard_session.standard_url_refusal(self.BOUND) - self.assertIn("ANSI-VITA-49.2 2017-R2024", found) + self.assertIn("EXAMPLE-STD-1.0 2024", found) self.assertIn("sha256", found) def test_an_unrelated_url_is_untouched(self): @@ -249,7 +248,7 @@ def setUp(self): def test_no_adaptations_are_needed(self): text = ("No adaptations are needed — the current implementation is " - "compliant with ANSI-VITA-49.2.") + "compliant with EXAMPLE-STD-1.0.") self.assertEqual(findings(text, self.ledger)[0]["kind"], UNSCOPED_VERDICT) @@ -264,14 +263,14 @@ def test_any_adjective_before_the_noun(self): UNSCOPED_VERDICT) def test_the_standard_under_its_canonical_name(self): - for name in ("VITA 49.2", "VITA49.2", "ANSI-VITA-49.2", - "ANSI/VITA 49.2", "ANSI-VITA-49.2-2017"): + for name in ("EXAMPLE-STD-1.0", "EXAMPLE-STD-1.0", "EXAMPLE-STD-1.0", + "EXAMPLE-STD-1.0", "EXAMPLE-STD-1.0"): text = f"The encoder conforms to {name}." with self.subTest(name=name): self.assertTrue(findings(text, self.ledger), name) def test_the_adverb_after_the_verb(self): - text = ("The codebase already implements the VITA49.2 ACK management " + text = ("The codebase already implements the EXAMPLE-STD-1.0 ACK management " "correctly.") self.assertTrue(findings(text, self.ledger)) @@ -287,36 +286,36 @@ def test_a_scoped_verdict_still_survives_all_of_this(self): class TheStandardsOwnName(unittest.TestCase): """Which standard counts comes from the binding, not from a pattern. - The first version spelled VITA 49.2 into the regex, which made a guard + The first version spelled EXAMPLE-STD-1.0 into the regex, which made a guard that exists to catch an unscoped claim work for exactly one standard and pass the same sentence about any other. """ - VITA = {"standard_id": "ANSI-VITA-49.2", "revision": "2017-R2024"} + STD = {"standard_id": "EXAMPLE-STD-1.0", "revision": "2024"} ISO = {"standard_id": "ISO-26262", "revision": "2018"} def test_each_binding_recognises_only_its_own(self): - vita = conformance_guard.bare_standard(self.VITA) + std = conformance_guard.bare_standard(self.STD) iso = conformance_guard.bare_standard(self.ISO) - self.assertTrue(vita.search("compliant with ANSI-VITA-49.2")) - self.assertFalse(vita.search("compliant with ISO 26262")) + self.assertTrue(std.search("compliant with EXAMPLE-STD-1.0")) + self.assertFalse(std.search("compliant with ISO 26262")) self.assertTrue(iso.search("compliant with ISO 26262")) - self.assertFalse(iso.search("compliant with ANSI-VITA-49.2")) + self.assertFalse(iso.search("compliant with EXAMPLE-STD-1.0")) def test_however_the_writer_punctuated_it(self): - vita = conformance_guard.bare_standard(self.VITA) + std = conformance_guard.bare_standard(self.STD) - for spelling in ("ANSI-VITA-49.2", "ANSI/VITA 49.2", "VITA 49.2", - "vita-49.2"): + for spelling in ("EXAMPLE-STD-1.0", "EXAMPLE-STD-1.0", "EXAMPLE-STD-1.0", + "example-std-1.0"): with self.subTest(spelling=spelling): - self.assertTrue(vita.search(f"conforms to {spelling}"), + self.assertTrue(std.search(f"conforms to {spelling}"), spelling) def test_with_no_binding_no_name_can_match(self): none = conformance_guard.bare_standard(None) - self.assertFalse(none.search("compliant with ANSI-VITA-49.2")) + self.assertFalse(none.search("compliant with EXAMPLE-STD-1.0")) self.assertFalse(none.search("compliant with anything at all")) def test_a_binding_is_accepted_as_a_dict_or_an_object(self): @@ -324,27 +323,27 @@ def test_a_binding_is_accepted_as_a_dict_or_an_object(self): in the operator plane; read as attributes only, a dict yielded nothing and the pattern matched nothing at all.""" class Bound: - standard_id = "ANSI-VITA-49.2" - revision = "2017-R2024" + standard_id = "EXAMPLE-STD-1.0" + revision = "2024" self.assertTrue(conformance_guard.bare_standard(Bound()).search( - "compliant with ANSI-VITA-49.2")) - self.assertTrue(conformance_guard.bare_standard(self.VITA).search( - "compliant with ANSI-VITA-49.2")) + "compliant with EXAMPLE-STD-1.0")) + self.assertTrue(conformance_guard.bare_standard(self.STD).search( + "compliant with EXAMPLE-STD-1.0")) def test_a_short_initial_cannot_bind_on_noise(self): """Terms of three characters or fewer are initials; matching them would flag any sentence containing them.""" - vita = conformance_guard.bare_standard(self.VITA) + std = conformance_guard.bare_standard(self.STD) - self.assertFalse(vita.search("compliant with is")) + self.assertFalse(std.search("compliant with is")) class ObjectOrAttribute(unittest.TestCase): """Naming the standard is a claim on the whole of it -- unless the name is there only to say which rule is meant.""" - BOUND = {"standard_id": "ANSI-VITA-49.2", "revision": "2017-R2024"} + BOUND = {"standard_id": "EXAMPLE-STD-1.0", "revision": "2024"} def setUp(self): self.ledger = ClauseLedger() @@ -357,15 +356,15 @@ def kinds(self, sentence): def test_the_standard_as_the_object_of_the_verdict(self): """A cited rule does not narrow a claim made on the document.""" self.assertEqual( - self.kinds("The encoder conforms to ANSI-VITA-49.2, see " + self.kinds("The encoder conforms to EXAMPLE-STD-1.0, see " "Rule 8.4.1.1-2."), [UNSCOPED_VERDICT]) def test_the_standard_as_the_attribute_of_a_clause(self): - for sentence in ("Rule 8.4.1.1-2 of ANSI-VITA-49.2 is satisfied by " + for sentence in ("Rule 8.4.1.1-2 of EXAMPLE-STD-1.0 is satisfied by " "cmdWireEncodeAck.", - "§8.4.1.1 of VITA 49.2 is satisfied.", - "Section 8.2 in ANSI-VITA-49.2 is satisfied."): + "§8.4.1.1 of EXAMPLE-STD-1.0 is satisfied.", + "Section 8.2 in EXAMPLE-STD-1.0 is satisfied."): with self.subTest(sentence=sentence): self.assertEqual(self.kinds(sentence), [], sentence) @@ -376,12 +375,12 @@ def test_a_scoped_verdict_naming_no_standard_is_untouched(self): def test_naming_it_with_no_clause_at_all_is_still_unscoped(self): self.assertEqual( - self.kinds("The encoder is compliant with ANSI-VITA-49.2."), + self.kinds("The encoder is compliant with EXAMPLE-STD-1.0."), [UNSCOPED_VERDICT]) def test_an_unread_clause_is_still_reported_as_such(self): self.assertEqual( - self.kinds("Rule 9.9.9-1 of ANSI-VITA-49.2 is satisfied."), + self.kinds("Rule 9.9.9-1 of EXAMPLE-STD-1.0 is satisfied."), [UNREAD_CLAUSE]) diff --git a/client/tests/test_conformance_mode.py b/client/tests/test_conformance_mode.py index d414ef1..45e34b5 100644 --- a/client/tests/test_conformance_mode.py +++ b/client/tests/test_conformance_mode.py @@ -21,7 +21,7 @@ from evidence.conformance_guard import ClauseLedger from evidence.conformance_mode import CodeReadLedger, is_conformance_turn, record, render -SID, REV = "ANSI-VITA-49.2", "2017-R2024" +SID, REV = "EXAMPLE-STD-1.0", "2024" FETCH = {"unit": {"section": "8.4.1.1", "text": "Rule 8.4.1.1-2: only one bit"}} @@ -38,11 +38,11 @@ class Detection(unittest.TestCase): def test_the_two_questions_that_started_this(self): for question in ("can you validate the implementation ?", "can you validate the ACK implementation against " - "VITA49.2 ?"): + "EXAMPLE-STD-1.0 ?"): self.assertTrue(is_conformance_turn(question), question) def test_a_question_about_the_standard_alone_is_not_one(self): - for question in ("How should the ACK be managed when using VITA49.2 " + for question in ("How should the ACK be managed when using EXAMPLE-STD-1.0 " "Commands packets?", "what does Rule 8.4.1.1-3 require?", "validate the config file"): @@ -142,7 +142,7 @@ def test_a_conformance_turn_that_read_no_code_says_so_first(self): def test_any_other_bound_turn_is_untouched(self): policy, text = self.run_turn("How should the ACK be managed when " - "using VITA49.2 Commands packets?", + "using EXAMPLE-STD-1.0 Commands packets?", code_call="cat src/x.c") self.assertFalse(policy.conformance_turn) diff --git a/client/tests/test_diagram_geometry.py b/client/tests/test_diagram_geometry.py index 9221e19..ad142cc 100644 --- a/client/tests/test_diagram_geometry.py +++ b/client/tests/test_diagram_geometry.py @@ -26,7 +26,7 @@ validate, ) -SID, REV = "ANSI-VITA-49.2", "2017-R2024" +SID, REV = "EXAMPLE-STD-1.0", "2024" #: The shape the recovery exists for: a packet diagram flattened into one #: line, each cell still carrying its own range. Written out here rather than #: read from a store, because a source_id names a unit inside ONE extraction diff --git a/client/tests/test_evidence_progress.py b/client/tests/test_evidence_progress.py index 0b95e79..7da0ef8 100644 --- a/client/tests/test_evidence_progress.py +++ b/client/tests/test_evidence_progress.py @@ -274,7 +274,7 @@ def test_a_question_that_asked_for_no_positions_is_not_told_about_them(self): from evidence.evidence_progress import ProgressTracker, bounded_absence text = bounded_absence( - "How should the ACK be managed when using VITA49.2 Commands packets?", + "How should the ACK be managed when using EXAMPLE-STD-1.0 Commands packets?", EvidenceLedger(), ProgressTracker(), reason=BUDGET, rounds=14) self.assertNotIn("bit positions", text) diff --git a/client/tests/test_mixed_routing.py b/client/tests/test_mixed_routing.py index 7ee37a5..e98d9f5 100644 --- a/client/tests/test_mixed_routing.py +++ b/client/tests/test_mixed_routing.py @@ -24,7 +24,7 @@ from runtime.agent_notes import is_write_request ARM = SimpleNamespace(standard_id="ARM-DDI0487", revision="M.c") -VITA = SimpleNamespace(standard_id="ANSI-VITA-49.2", revision="2017-R2024") +STD = SimpleNamespace(standard_id="EXAMPLE-STD-1.0", revision="2024") SYNTH = SimpleNamespace(standard_id="SYNTH-MIXED", revision="M-1") @@ -39,11 +39,11 @@ def test_a_change_in_the_documents_terms_is_mixed(self): for binding, text in ( (ARM, "Make timer_init() in timer.c set up the system counter frequency " "the way the Arm architecture specification requires."), - (VITA, "Make the encoder in src/wire.c emit one acknowledgement packet per " + (STD, "Make the encoder in src/wire.c emit one acknowledgement packet per " "requested type, as the standard requires."), (SYNTH, "Make build_header() in record.py fill the count field the way the " "specification defines it."), - (VITA, "Update cmdWireEncodeAck() so it marks the acknowledgement type as " + (STD, "Update cmdWireEncodeAck() so it marks the acknowledgement type as " "the specification mandates.")): with self.subTest(text=text): self.assertEqual(routed(binding, text), (True, answer_scope.MIXED, True)) @@ -62,7 +62,7 @@ def test_plain_changes_stay_implementation(self): for text in ("Fix the off-by-one in ring.c.", "Rename parse_frame() to read_frame().", "Make the build pass on arm64."): with self.subTest(text=text): - self.assertFalse(standard_scope.engages(VITA, text)) + self.assertFalse(standard_scope.engages(STD, text)) self.assertEqual(answer_scope.of(text, standard_bound=True), answer_scope.IMPLEMENTATION) @@ -74,7 +74,7 @@ def test_make_that_names_nothing_in_the_tree_is_no_write(self): def test_the_standard_library_is_not_the_bound_standard(self): self.assertFalse(standard_scope.engages( - VITA, "Why does the standard library require an allocator in ring.c?")) + STD, "Why does the standard library require an allocator in ring.c?")) if __name__ == "__main__": diff --git a/client/tests/test_normative_binding_reaches_every_corpus.py b/client/tests/test_normative_binding_reaches_every_corpus.py index d752c3d..2b4d580 100644 --- a/client/tests/test_normative_binding_reaches_every_corpus.py +++ b/client/tests/test_normative_binding_reaches_every_corpus.py @@ -146,7 +146,7 @@ def test_the_contract_describes_no_corpus(self): one project whose prompt used to carry it.""" lower = normative_precedence.EVIDENCE_RULE.lower() - for absent in ("edgem", "verdin", "virt64", "bitbake", "vita"): + for absent in ("edgem", "verdin", "virt64", "bitbake", "example-std"): with self.subTest(word=absent): self.assertNotIn(absent, lower) diff --git a/client/tests/test_normative_contract.py b/client/tests/test_normative_contract.py index 90df215..776bb40 100644 --- a/client/tests/test_normative_contract.py +++ b/client/tests/test_normative_contract.py @@ -92,7 +92,7 @@ def test_the_contract_stays_compact(self): def test_the_contract_names_no_particular_standard(self): # It has to apply to any bound standard, not one document. - for absent in ("vita", "49.2", "ansi-vita"): + for absent in ("example-std", "1.0", "example-std"): self.assertNotIn(absent, self.lower) def test_the_contract_names_no_particular_corpus(self): diff --git a/client/tests/test_normative_precedence.py b/client/tests/test_normative_precedence.py index b28bcfb..7d8c64c 100644 --- a/client/tests/test_normative_precedence.py +++ b/client/tests/test_normative_precedence.py @@ -86,7 +86,7 @@ def guard(answer, sections=(), binding=BINDING): ledger = ClauseLedger(sections=set(sections)) return normative_precedence.guard( - answer, ledger, standard_id="ANSI-VITA-49.2", revision="2017-R2024", + answer, ledger, standard_id="EXAMPLE-STD-1.0", revision="2024", binding=binding) @@ -153,7 +153,7 @@ def test_existing_behaviour_is_not_a_clearance(self): cleared = "The implementation correctly follows the standard." _, findings, _, fired = conformance_guard.guard( cleared, ClauseLedger(sections={CLAUSE}), - standard_id="ANSI-VITA-49.2", revision="2017-R2024", + standard_id="EXAMPLE-STD-1.0", revision="2024", binding=BINDING) self.assertTrue(fired) @@ -276,8 +276,8 @@ def test_no_source_of_evidence_but_the_document_grounds_a_claim(self): self.assertEqual(policy.clauses.sections, set()) _, findings, _, fired = normative_precedence.guard( - self.CLAIM, policy.clauses, standard_id="ANSI-VITA-49.2", - revision="2017-R2024", binding=BINDING) + self.CLAIM, policy.clauses, standard_id="EXAMPLE-STD-1.0", + revision="2024", binding=BINDING) self.assertTrue(fired) self.assertEqual(len(findings), 1) @@ -379,7 +379,7 @@ def test_nothing_in_the_module_names_a_standard_or_a_clause(self): """ body = executable_text(normative_precedence) - for token in ("VITA", "vita", "AckV", "AckX", "AckS", "8.4", "49.2"): + for token in ("EXAMPLE-STD", "example-std", "AckV", "AckX", "AckS", "8.4", "1.0"): with self.subTest(token=token): self.assertNotIn(token, body) diff --git a/client/tests/test_project_build.py b/client/tests/test_project_build.py index 340d159..05c4fa0 100644 --- a/client/tests/test_project_build.py +++ b/client/tests/test_project_build.py @@ -18,7 +18,7 @@ from evidence import project_build from runtime.agent_verification import project_build_gap, project_build_runs -VITA_CMAKE = """cmake_minimum_required(VERSION 3.16) +EXAMPLE_CMAKE = """cmake_minimum_required(VERSION 3.16) project(v492c LANGUAGES C) set(V492C_SIDE "target" CACHE STRING "which side") if(V492C_SIDE STREQUAL "target") @@ -39,7 +39,7 @@ def tree(self, **files): return str(root) def test_the_cmake_option_that_cost_ten_rounds_a_run(self): - found = project_build.probe(self.tree(**{"CMakeLists.txt": VITA_CMAKE})) + found = project_build.probe(self.tree(**{"CMakeLists.txt": EXAMPLE_CMAKE})) self.assertIn("-DV492C_SIDE=host", found.build) self.assertIn("cmake --build", found.build) @@ -98,7 +98,7 @@ def test_a_tree_that_says_nothing_claims_nothing(self): self.assertEqual(found.source, "none") def test_projects_json_wins_over_every_probe(self): - root = self.tree(**{"CMakeLists.txt": VITA_CMAKE}) + root = self.tree(**{"CMakeLists.txt": EXAMPLE_CMAKE}) found = project_build.commands( root, spec={"build_commands": ["ninja -C out"], "test_commands": "ninja -C out test"}) @@ -107,7 +107,7 @@ def test_projects_json_wins_over_every_probe(self): self.assertEqual(found.source, "projects.json") def test_the_answer_is_remembered(self): - root = self.tree(**{"CMakeLists.txt": VITA_CMAKE}) + root = self.tree(**{"CMakeLists.txt": EXAMPLE_CMAKE}) cache = tempfile.mkdtemp() first = project_build.commands(root, cache_dir=cache) diff --git a/client/tests/test_provenance_guard.py b/client/tests/test_provenance_guard.py index feb1ee6..223b1d5 100644 --- a/client/tests/test_provenance_guard.py +++ b/client/tests/test_provenance_guard.py @@ -63,9 +63,9 @@ def test_nothing_is_derived_from_a_result(self): self.assertEqual(found.paths, set()) def test_a_url_a_tool_did_return_is_recorded(self): - found = ledger('{"link": "https://vita.com/spec.pdf"}') + found = ledger('{"link": "https://example.com/spec.pdf"}') - self.assertIn("https://vita.com/spec.pdf", found.urls) + self.assertIn("https://example.com/spec.pdf", found.urls) def test_an_empty_result_records_nothing(self): self.assertEqual(ledger("").source_ids, set()) @@ -84,15 +84,15 @@ def test_an_unseen_id_fails(self): [FABRICATED_SOURCE_ID]) def test_a_returned_url_passes(self): - found = ledger('{"link": "https://vita.com/spec.pdf"}') + found = ledger('{"link": "https://example.com/spec.pdf"}') - self.assertEqual(findings("See https://vita.com/spec.pdf.", found), []) + self.assertEqual(findings("See https://example.com/spec.pdf.", found), []) def test_a_returned_url_passes_mid_sentence_too(self): - found = ledger('{"link": "https://vita.com/spec.pdf"}') + found = ledger('{"link": "https://example.com/spec.pdf"}') self.assertEqual( - findings("See https://vita.com/spec.pdf, section 7.", found), []) + findings("See https://example.com/spec.pdf, section 7.", found), []) def test_a_fabricated_url_is_still_caught_before_a_full_stop(self): found = findings("See https://example.org/spec.pdf.", ledger()) @@ -115,7 +115,7 @@ def test_an_unseen_home_path_fails(self): self.assertEqual([item["kind"] for item in found], [FABRICATED_PATH]) def test_a_windows_path_fails(self): - found = findings(r"Stored at C:\standards\vita.pdf.", ledger()) + found = findings(r"Stored at C:\standards\example.pdf.", ledger()) self.assertEqual([item["kind"] for item in found], [FABRICATED_PATH]) @@ -133,7 +133,7 @@ def test_ordinary_prose_with_a_slash_is_not_provenance(self): self.assertEqual(findings(answer, ledger()), []) def test_a_code_example_with_a_relative_path_is_untouched(self): - answer = '#include "vita/packet.h"\nopen("data/frame.bin");' + answer = '#include "example/packet.h"\nopen("data/frame.bin");' self.assertEqual(findings(answer, ledger()), []) diff --git a/client/tests/test_provision_instance.py b/client/tests/test_provision_instance.py index 1b92cdc..378811d 100644 --- a/client/tests/test_provision_instance.py +++ b/client/tests/test_provision_instance.py @@ -1,6 +1,6 @@ """The printed label is what the document calls a provision, not its identity. -VITA 49.2 declares Rule 5.1.6-2 twice in section 5.1.6 -- page 75 about +EXAMPLE-STD-1.0 declares Rule 5.1.6-2 twice in section 5.1.6 -- page 75 about Enable bits, page 76 about Packet Class documentation. Same section, same heading path, same printed label, both proper declarations, different normative content. Thirty-seven such labels exist in that one document. diff --git a/client/tests/test_reds_image.py b/client/tests/test_reds_image.py index 5214b28..28bc4df 100644 --- a/client/tests/test_reds_image.py +++ b/client/tests/test_reds_image.py @@ -66,7 +66,7 @@ def skill(name, scope): skill("for-family", "[family:buildsys]") skill("for-product", "[verdin, virt64]") skill("for-so3", "[so3]") - skill("customer", "[vita492]") + skill("customer", "[examplestd10]") (self.skills / "undeclared.md").write_text("## Procedure\n1. do\n") (self.skills / "README.md").write_text("# skills\n") @@ -160,7 +160,7 @@ def test_the_build_says_what_it_left_out_and_why(self): self.assertIn("10-product.md LEFT OUT — corpus verdin, virt64", out) self.assertIn("40-host.md LEFT OUT — scoped to a host path", out) self.assertIn("90-unscoped.md LEFT OUT — declares no scope", out) - self.assertIn("customer.md LEFT OUT — vita492", out) + self.assertIn("customer.md LEFT OUT — examplestd10", out) self.assertIn("undeclared.md LEFT OUT — declares no scope", out) self.assertIn("corpora/verdin.md LEFT OUT", out) self.assertIn("product.sh LEFT OUT", out) diff --git a/client/tests/test_standard_answer_policy.py b/client/tests/test_standard_answer_policy.py index f3ae743..d473aca 100644 --- a/client/tests/test_standard_answer_policy.py +++ b/client/tests/test_standard_answer_policy.py @@ -33,7 +33,7 @@ from runtime.tracing import TraceEmitter from runtime.working_state import WorkingState -BINDING = {"standard_id": "ANSI-VITA-49.2", "revision": "2017-R2024"} +BINDING = {"standard_id": "EXAMPLE-STD-1.0", "revision": "2024"} REAL_ID = "std-5287d23d6932688558e46a628f8aaec2" OTHER_ID = "std-e1d69bac5d63695f703b9e201c727b5d" @@ -131,7 +131,7 @@ def test_a_bound_turn_gets_one(self): make_context(ScriptedBackend([]), binding=BINDING)) self.assertIsInstance(policy, StandardAnswerPolicy) - self.assertEqual(policy.standard_id, "ANSI-VITA-49.2") + self.assertEqual(policy.standard_id, "EXAMPLE-STD-1.0") def test_activation_never_reads_the_user_wording(self): context = make_context( @@ -207,7 +207,7 @@ def test_e_an_h4_style_placement_never_reaches_the_user(self): def test_g_fabricated_provenance_is_removed(self): raw = (f"Phase Offset, Radians occupies bits 15..0 of word 1 " - f"([{REAL_ID}](file:///home/user/vita.pdf)), see also " + f"([{REAL_ID}](file:///home/user/example.pdf)), see also " f"std-deadbeefdeadbeefdeadbeefdeadbeef.") result, policy, _ = self.run_bound( [tool_turn("c1", "standard.get_structure", diff --git a/client/tests/test_standard_e2e.py b/client/tests/test_standard_e2e.py index 4f4ee42..54c3851 100644 --- a/client/tests/test_standard_e2e.py +++ b/client/tests/test_standard_e2e.py @@ -84,10 +84,10 @@ def execute(agent, call_id, name, arguments, cache): self.assertIn("Normative claims must use retrieved", system) self.assertNotIn("Implementations shall reject reserved value", system) - def test_agent_runtime_has_no_standard_or_vita_orchestration_branch(self): + def test_agent_runtime_has_no_standard_orchestration_branch(self): runtime = Path(__file__).parents[1] / "runtime" text = "".join(path.read_text("utf-8") for path in sorted(runtime.glob("agent_*.py"))) - self.assertNotIn("VITA", text) + self.assertNotIn("EXAMPLE-STD", text) self.assertNotIn("standard.search", text) self.assertNotIn("standard.fetch", text) diff --git a/client/tests/test_standard_scope.py b/client/tests/test_standard_scope.py index 74e211c..2414028 100644 --- a/client/tests/test_standard_scope.py +++ b/client/tests/test_standard_scope.py @@ -2,7 +2,7 @@ The binding attached to every prompt of every session. Asked to download the RS274/NGC G-code specification, the assistant spent eleven turns explaining -that the system is bound to ANSI-VITA-49.2 and not RS274/NGC. The word that +that the system is bound to EXAMPLE-STD-1.0 and not RS274/NGC. The word that put it there was "standard", in "inject it in our RAG as a standard". """ import os @@ -15,7 +15,7 @@ from standard.standard_schema import StandardBinding # noqa: E402 -def binding(standard_id="ANSI-VITA-49.2", revision="2017-R2024"): +def binding(standard_id="EXAMPLE-STD-1.0", revision="2024"): return StandardBinding(standard_id, revision, "a" * 64, "b" * 64, "c" * 64, "extractor-1") @@ -46,10 +46,10 @@ def test_generic_english_does_not_bind(self): self.assertFree(question) def test_naming_the_standard_binds(self): - for question in ("summarise the ANSI-VITA-49.2 conformance rules", - "what does VITA 49.2 say about it?", - "in vita-49.2, is that mandatory?", - "does 2017-R2024 change that?"): + for question in ("summarise the EXAMPLE-STD-1.0 conformance rules", + "what does EXAMPLE-STD-1.0 say about it?", + "in example-std-1.0, is that mandatory?", + "does 2024 change that?"): self.assertEngages(question) def test_the_subject_matter_binds_without_the_name(self): @@ -66,7 +66,7 @@ def test_a_structure_identifier_binds_on_its_own(self): self.assertEngages("what is in vgr-deadbeef12?") def test_no_binding_means_no_engagement(self): - self.assertFalse(standard_scope.engages(None, "what about VITA 49.2?")) + self.assertFalse(standard_scope.engages(None, "what about EXAMPLE-STD-1.0?")) def test_an_empty_question_does_not_bind(self): self.assertFree("") @@ -153,7 +153,7 @@ def setUp(self): def test_the_line_that_started_this(self): question = "carry out the task in doc/ack-task.md" task = ("[file: doc/ack-task.md]\n# Task\nThe bound standard is " - "ANSI-VITA-49.2 2017-R2024. Every normative claim ...") + "EXAMPLE-STD-1.0 2024. Every normative claim ...") self.assertFalse(standard_scope.engages(self.binding, question)) self.assertTrue(standard_scope.engages(self.binding, question, @@ -168,4 +168,4 @@ def test_only_the_name_counts_in_context(self): def test_context_never_binds_without_a_binding(self): self.assertFalse(standard_scope.engages( - None, "do it", context="ANSI-VITA-49.2 2017-R2024")) + None, "do it", context="EXAMPLE-STD-1.0 2024")) diff --git a/client/tests/test_structure_absent_revision.py b/client/tests/test_structure_absent_revision.py index 0397198..4392ef8 100644 --- a/client/tests/test_structure_absent_revision.py +++ b/client/tests/test_structure_absent_revision.py @@ -28,7 +28,7 @@ def setUp(self): def refusal(self): reader = access.StandardStructureAccess(self.store) with self.assertRaises(access.StructureAccessError) as caught: - reader.index("ANSI-VITA-49.2", "never-built") + reader.index("EXAMPLE-STD-1.0", "never-built") return caught.exception def test_it_is_named_rather_than_raised_as_a_fault(self): diff --git a/client/tests/test_training_promotion.py b/client/tests/test_training_promotion.py index b1926ac..4465f9d 100644 --- a/client/tests/test_training_promotion.py +++ b/client/tests/test_training_promotion.py @@ -16,7 +16,7 @@ def row(**overrides): "timestamp": "2026-09-09T10:00:00+00:00", "verdict": "pass", "source": "project_build", - "project": "adhoc:vita492", + "project": "adhoc:examplestd10", "task_id": "task_1", "question": "make the acknowledgement follow the rule", "answer": "Changed command_wire.c.", diff --git a/client/tests/test_trajectory_episodes.py b/client/tests/test_trajectory_episodes.py index 8f77d60..00c7fb2 100644 --- a/client/tests/test_trajectory_episodes.py +++ b/client/tests/test_trajectory_episodes.py @@ -14,7 +14,7 @@ def row(**overrides): sample = { "verdict": "pass", "source": "project_build", - "project": "adhoc:vita492", + "project": "adhoc:examplestd10", "task_id": "task_1", "bench": "", "question": "can you validate and make changes in the code accordingly", diff --git a/client/tests/test_work_order.py b/client/tests/test_work_order.py index 5418027..556ad07 100644 --- a/client/tests/test_work_order.py +++ b/client/tests/test_work_order.py @@ -1,6 +1,6 @@ """A task file with lettered sections is a list, and the turn is judged by it. -Handed the seven-section VITA 49.2 acknowledge work order, the model changed +Handed the seven-section EXAMPLE-STD-1.0 acknowledge work order, the model changed the signature section A asks for, propagated it until the tree compiled, and answered "The changes have been made successfully". C, D and E were untouched — twice, at 60 rounds and at 120, so the budget was not the reason. @@ -18,7 +18,7 @@ from runtime import work_order from models.model_backend import ConversationMessage, TextBlock -ORDER = """# Task: VITA 49.2 Acknowledge handling +ORDER = """# Task: EXAMPLE-STD-1.0 Acknowledge handling ## Scope