Skip to content

Ship openDox's own default profile: documents and ideas, with the runtime verbs (T015) - #38

Merged
brettheap merged 3 commits into
mainfrom
build/034-t015-default-profile
Sep 27, 2026
Merged

brettheap merged 3 commits into
mainfrom
build/034-t015-default-profile

Conversation

@brettheap

@brettheap brettheap commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Plan 034's T015 (openxFactory specs/034-opendox-standalone-operation/tasks.md, slice P1-B), which realizes box 3.1 of the ratified add-neutral-product-standalone-operability (#1144).

  • src/opendox/default_profile.py (new) is openDox's default profile for its own domain, documents and ideas. It is a MODULE, so refusals and /capabilities name it opendox.default_profile. It declares the two facets openDox reads strictly:
    • SUBCOMMAND_EXTENSIONS = (RuntimeSubcommand(),), from this first landing (R1Q4 (a), R1Q5 (a)). So no build ever meets an empty default, which RULED ASK-2 and the packet's design § D5 keep refused. ProjectSubcommand is not included: R1Q5 (a) names the runtime verbs alone (plan 034, T006's finding U4).
    • ROUTE_EXTENSIONS = (). openDox's own routes are the core server's fixed dispatch, and the facet is declared because build_server() reads it strictly.
  • It declares no DISPLAY facet. That is how its vocabulary is NEUTRAL_DISPLAY unchanged (requirement 3's third scenario). The reason is under "The one judgement" below.
  • Importing it registers nothing. T016 wires the entry-point registration (R1Q3 (a)), and it lands after P1-A's T012.
  • tests/test_default_profile.py (new) holds it to requirement 3. Like test_profile_registration.py, it imports neither opendox.cli nor opendox.serve, since neither imports in a lone checkout until T011.

Authority

  • Ratified packet: openxFactory#656 comment 5815412869 ("ratify #1144").
  • Rulings carried out, openxFactory#656 comment 5817152735 ("(a) on all eleven, (d) on R1Q6"):
    • R1Q4 (a): the default contributes openDox's own verbs (the runtime verbs now), with NEUTRAL_DISPLAY.
    • R1Q5 (a): RuntimeSubcommand is in the default's SUBCOMMAND_EXTENSIONS, and opendox-runtime stays as an alias.
    • R1Q22 (a): no declared-edit act precedes an arc edit. This PR touches no carved file anyway; both files are created ones.
  • After: T006, which is done: #1167 landed on openxFactory main as a65230f6.
  • Claim: openxFactory#656 comment 5850105728.

The falsifier, and its run

tasks.md, T015: "Falsifier: the new vocabulary test, and a test that RuntimeSubcommand is in the default's SUBCOMMAND_EXTENSIONS. F3.1 needs T016's registration, so T016 quotes it. That the default imports with no extra installed is shown by T038's plain-install runs."

Requirement 3's second scenario, which the vocabulary test holds: "WHEN a neutral product's default profile names the publishing repository's status taxonomy, its change/spec/delta nouns or its act verbs — THEN the profile is refused under RULING C2 and DIRECTION Q5".

What the tests sweep:

  • Every name the default declares: its command tree walked whole, its route patterns, its view ids and its own registered name.
  • Every help string it contributes, for all three families, change and changes included. The one measured use in another sense is exempt by its exact string and for that word alone: runtime migrate --plan reads "report what would be applied and change nothing", a verb. Any other use of either word fails the sweep until someone reads it and enters it in _OTHER_SENSES, and test_every_exempt_help_string_is_one_the_default_really_carries fails once the text an entry names is gone, so a stale entry cannot linger.
  • Every word its display renders.

The three families are copied, with their source, from openxFactory at 42f34ab7:

  • the eight Status: words, plus projection;
  • the OpenSpec nouns;
  • the twenty act ids of contracts/domain-profiles/openxfactory-engineering.yaml.

test_the_sweep_catches_a_profile_that_carries_the_vocabulary shows that the sweep can fail.

Run from the checkout root at 72ba89fe (1d98bfe8 with main @ 582ed073, #37 and #39, merged in), in a venv built as validate builds one (pip install -c constraints-cpython312-linux.txt -e ".[test]", Python 3.12.3, pytest 8.4.2), under --noconftest as tasks.md § Phase 1 requires until T011:

$ python -m pytest -v --noconftest tests/test_default_profile.py
test_runtime_subcommand_is_in_the_defaults_subcommand_extensions PASSED [  5%]
test_the_default_is_never_an_empty_profile PASSED [ 11%]
test_the_default_contributes_the_runtime_command_opendox_runtime_builds PASSED [ 17%]
test_the_default_declares_the_two_facets_the_composition_points_read PASSED [ 23%]
test_the_default_is_named_by_its_module_path PASSED [ 29%]
test_the_default_names_none_of_the_publishers_vocabulary PASSED [ 35%]
test_the_defaults_help_carries_none_of_the_publishers_vocabulary PASSED [ 41%]
test_every_exempt_help_string_is_one_the_default_really_carries PASSED [ 47%]
test_the_default_renders_none_of_the_publishers_vocabulary PASSED [ 52%]
test_the_sweep_catches_a_profile_that_carries_the_vocabulary PASSED [ 58%]
test_the_default_renders_neutral_display_unchanged PASSED [ 64%]
test_the_default_claims_no_design_token_so_dark_mode_keeps_its_palette PASSED [ 70%]
test_importing_the_default_registers_nothing_and_needs_no_sibling PASSED [ 76%]
test_the_default_names_no_sibling_package[openxdox] PASSED [ 82%]
test_the_default_names_no_sibling_package[ideation_dashboard] PASSED [ 88%]
test_the_default_names_no_sibling_package[doc_health] PASSED [ 94%]
test_the_default_names_no_sibling_package[corpus_adapter_openxfactory] PASSED [100%]
============================== 17 passed in 0.15s ==============================

The tests can fail. Each mutation below was applied to a scratch copy of the module at 1d98bfe8, and the file re-run. The merge of main changed none of the files involved (git diff --stat 1d98bfe 72ba89f over default_profile.py, tests/test_default_profile.py, runtime/cli.py, subcommand_extension.py, display_profile.py and view_extension.py is empty):

mutation of default_profile.py result
SUBCOMMAND_EXTENSIONS = () 4 failed: the RuntimeSubcommand test, the never-empty test, the runtime-tree test and the name sweep
DISPLAY = NEUTRAL_DISPLAY added 3 failed: the facets test, the neutral-display test and the design-token test
ProjectSubcommand() added to the tuple 1 failed: the runtime-tree test (U4)
a contributed kickoff verb added 2 failed: the runtime-tree test and the name sweep
a contributed verb whose help reads "list each open change" 2 failed: the runtime-tree test and the help sweep
the runtime's --plan help reworded (in runtime/cli.py) 1 failed: the stale-exemption test

The one judgement: why DISPLAY is not declared

The task line says the default's "DISPLAY is NEUTRAL_DISPLAY unchanged". Setting DISPLAY = NEUTRAL_DISPLAY literally would render the same words. It would also publish all four design tokens as the HOST's own. display_manifest reports a declared facet's tokens in declared_tokens, and views/display.js's applyTokens writes exactly those onto :root inline, where they outrank every per-theme rule in styles.css. tests/test_display_facet.py::test_only_the_tokens_a_host_declared_are_written_onto_root exists to forbid that.

I measured it with the real views/display.js under node, applying each payload the way that test does:

payload                               host_facet  declared_tokens                                  written onto :root
default_profile (no DISPLAY facet)    absent      []                                               {}
DISPLAY = NEUTRAL_DISPLAY (literal)   declared    [captured, organized, proposed, completion]      --st-captured #7A5AD0, --st-organized #0D9488, --st-proposed #B96A1B, --st-completion #3B6FD4

So the default declares no facet, and display_profile's named absence renders NEUTRAL_DISPLAY word for word. test_the_default_renders_neutral_display_unchanged asserts the manifest equals the neutral one, with each word table equal to NEUTRAL_DISPLAY's. test_the_default_claims_no_design_token_so_dark_mode_keeps_its_palette asserts that declared_tokens == []. VIEW_EXTENSIONS is undeclared for the same kind of reason: the default contributes no consumer panel, and the absence answers an empty column, named absent.

The repository's own check

The three pytest steps of validate.yml's required validate job, with its "Pin the triple" arithmetic, reproduced locally in the same venv:

selected passed skipped failures errors
main @ 582ed073 1121 1118 3 0 0
this branch @ 72ba89fe 1121 1118 3 0 0

The counts are unchanged, because no file in the job's lists changed. The new test first runs in the required check at T036, which removes those lists (tasks.md § Phase 1: "No slice edits openDox-code's validate.yml before T036").

tests/test_provider_boundary.py is off the required list and red on main for 16.6's reasons, which T034 repairs. It sweeps every package module for provider needles, and it gives 12 failed, 16 passed both on main @ 582ed073 and on this branch @ 72ba89fe. None of the failures names default_profile.

Copilot's review

Copilot's overview at cd70eb3e noted that the vocabulary sweep could miss the nouns change and changes in contributed help text. It raised no thread. It was right: the help sweep had left both words out. 1d98bfe8 sweeps them, and exempts only the runtime's one measured verb use, by its exact string. The stand-in in test_the_sweep_catches_a_profile_that_carries_the_vocabulary now shows 'change' in 'ratify a change' caught, and the mutation table above shows a noun in new help text failing the sweep. Copilot's overviews at 1d98bfe8 and at 72ba89fe, the merge of main, both read "Approval recommended", with "Findings: None". No review thread is open.

Left for the tasks that own them

  • tests/test_consumer_reach.py's NEUTRAL_MODULES asks for every new module to be added to its census. That file is single-writer (T011, then T034, in plan.md's table), so opendox.default_profile is not added here. T034 re-derives the file. The claim itself is asserted here instead, in test_importing_the_default_registers_nothing_and_needs_no_sibling, which imports the module in a fresh interpreter with the four siblings blocked.
  • The root conftest.py still says "openDox ships no profile", in its comment above _SuiteProfile. That file is P1-G's (T035). The registration it performs stays right: an empty suite profile keeps pinning the core surface.
  • domain_profile.py's refusal text ("ships no profile of its own") and the registration runbook describe the contract T016 changes. T016 corrects them together with the entry-point registration that makes them false.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with Claude Code

Summary by Sourcery

Ship openDox’s standalone default profile with runtime verbs and safeguards for neutral vocabulary, display behavior, and isolated imports.

New Features:

  • Add openDox’s standalone default profile for its documents-and-ideas domain, including the runtime command extensions and route extension point.

Enhancements:

  • Keep the default profile neutral by leaving display and view facets undeclared while preserving the neutral display vocabulary.
  • Ensure importing the default profile is side-effect free, standalone, and does not require sibling packages or register a profile.

Tests:

  • Add coverage for the default profile’s runtime commands, required facets, neutral vocabulary, display behavior, import isolation, and publisher-vocabulary exclusions.

…time verbs (T015)

Plan 034's T015 (openxFactory specs/034-opendox-standalone-operation), which
realizes box 3.1 of the ratified add-neutral-product-standalone-operability.

src/opendox/default_profile.py is openDox's default profile for its own
domain. It declares the two facets openDox reads strictly:

- SUBCOMMAND_EXTENSIONS carries RuntimeSubcommand from this first landing
  (R1Q4 (a), R1Q5 (a), openxFactory#656 comment 5817152735), so no build
  meets an empty default.
- ROUTE_EXTENSIONS is empty, because openDox's own routes are the core
  server's fixed dispatch.

It declares no DISPLAY facet, so the display it yields is NEUTRAL_DISPLAY
unchanged, through display_profile's named absence. Declaring the table
itself would claim its four design tokens as the host's, and the shell would
then pin the light palette over the dark theme. Importing the module
registers nothing; T016 wires the entry-point registration.

tests/test_default_profile.py holds it to requirement 3:

- the RuntimeSubcommand test;
- the vocabulary test, over every name, help string and rendered word the
  default declares, with a stand-in that shows the sweep can fail;
- the display, which is NEUTRAL_DISPLAY with no token claimed;
- a subprocess import with the four siblings blocked, which registers
  nothing and loads nothing outside the standard library.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 26, 2026 22:03
@sourcery-ai

sourcery-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR introduces openDox’s own side-effect-free default profile, contributing only the runtime verbs while declaring the route facet required by strict composition reads, and adds focused tests covering parser behavior, neutral display semantics, publisher-vocabulary exclusion, and standalone imports.

Sequence diagram for building a parser with the default profile

sequenceDiagram
    participant EntryPoint
    participant Profile as opendox.default_profile
    participant Parser as cli.build_parser()
    participant Runtime as RuntimeSubcommand

    EntryPoint->>Profile: import module
    Profile-->>EntryPoint: SUBCOMMAND_EXTENSIONS
    EntryPoint->>Parser: build_parser()
    Parser->>Profile: read SUBCOMMAND_EXTENSIONS
    Profile-->>Parser: RuntimeSubcommand()
    Parser->>Runtime: register runtime init, migrate, serve, status, reset
Loading

File-Level Changes

Change Details Files
Add openDox’s standalone default domain profile with runtime command contributions and strict facet declarations.
  • Define the module profile as opendox.default_profile with RuntimeSubcommand() as its sole subcommand extension.
  • Declare an empty ROUTE_EXTENSIONS tuple so strict server facet reads resolve.
  • Intentionally omit DISPLAY and VIEW_EXTENSIONS so neutral display vocabulary and host theme tokens remain unclaimed.
  • Keep profile import side-effect-free and independent of sibling packages; registration is deferred to T016 entry-point wiring.
src/opendox/default_profile.py
Add comprehensive requirement-3 tests for the default profile’s behavior, vocabulary boundaries, and standalone import contract.
  • Verify runtime parser parity with the opendox-runtime alias and reject empty or extra project command contributions.
  • Sweep command names, route/view declarations, help text, display output, and profile naming for publisher vocabulary.
  • Verify neutral display output is unchanged and no design tokens are declared, preserving theme behavior.
  • Prove the vocabulary sweep detects mutations and verify isolated import behavior does not register a profile or require sibling packages.
tests/test_default_profile.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The vocabulary sweep may miss forbidden noun uses of “change” and “changes” in contributed help text.

Review effort: Lite
Findings: None

What changed in this PR

Adds openDox’s standalone default profile with runtime commands, neutral display behavior, and isolated-import coverage.

Changes:

  • Defines the default profile and required facets.
  • Adds tests for composition, neutrality, vocabulary isolation, and imports.
File Description
tests/​test_default_profile.py Tests default profile behavior and neutrality.
src/​opendox/​default_profile.py Defines the standalone default profile.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…rb use (T015)

Copilot's review of cd70eb3: the vocabulary sweep could miss the OpenSpec
nouns change and changes in contributed help text. The sweep had left both
words out of help text entirely, because the runtime's own help uses one as
an English verb.

Both words are swept in help text now. The one measured verb use,
`runtime migrate --plan`'s "report what would be applied and change nothing",
is exempt by its exact string and for that word alone. Any other use fails the
sweep until someone reads it and enters it in _OTHER_SENSES, and a new test
removes an entry once the text it names is gone. The stand-in profile shows
the noun is caught.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 26, 2026 22:22
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The reviewed changes are fully covered and no blocking issues were identified.

Review effort: Lite
Findings: None

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 26, 2026 22:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

@brettheap
brettheap marked this pull request as ready for review September 26, 2026 22:37

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 23 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap

Copy link
Copy Markdown
Contributor Author

READY at 72ba89f — Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

@brettheap
brettheap merged commit a435aec into main Sep 27, 2026
4 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

LANDED — lane openxfactory-4, 2026-09-27T00:13:27Z, PR #38 → a435aec (opensoft/openDox-code main; plain gate)

Brett: land the phase 1 PRs when green

brettheap added a commit that referenced this pull request Sep 27, 2026
Since this branch was cut, main gained T020 (#37), T026 (#39) and T015
(#38). None of them touches src/route_extension.py, src/opendox/serve.py,
the facet's tests or the profile-registration runbook.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 27, 2026
…check seams

main is a435aec, which carries T015 squashed (#38), T020 (#37) and T026
(#39). The one conflict is src/opendox/default_profile.py, added on both
sides: main holds T015's file byte for byte as its branch left it, and this
branch holds the same file with the one paragraph T016 rewrites (HOW IT IS
REGISTERED). The resolution keeps this branch's file, which is T015's plus
that paragraph and nothing else.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brettheap added a commit that referenced this pull request Sep 27, 2026
…ly before a build (T016) (#42)

## Summary

Plan 034's **T016** (openxFactory `specs/034-opendox-standalone-operation/tasks.md`, slice P1-B), which realizes box **3.2** of the ratified `add-neutral-product-standalone-operability` (#1144): registration semantics, on R1Q3 (a) with (i) and (ii), and RN-1 (a).

- **The entry points register openDox's default where nothing is registered.** `cli.build_parser()`, `serve.build_server()`, `cli.main()` and `serve.main()` each open with `domain_profile.register_default(default_profile)`, one line each. Afterwards `is_registered()` answers True. The default is an entry-point registration and never a fallback inside `current()`.
- **A bare process that builds nothing still meets `ProfileNotRegistered`** (R1Q3 (i)). `profile_proxy`'s nothing-registered refusal is kept, never weakened into `()`. `current()`'s refusal now names the default. It says that nothing is registered now, either because nothing was built through an entry point or because `unregister()` has dropped the registration since.
- **A host registration made before anything is built replaces the default** (RN-1 (a)). That covers a host that registered first, which the default then never displaces. It also covers a default an entry point registered that nothing has been built from yet, for example after `serve.main()` has registered it at process start.
- **After a parser or a server was built from the default, a host registration is refused** with today's `AlreadyRegistered` (R1Q3 (ii); RN-1 (a)). The message names the default and the build, and says to register before the first build, or to call `unregister()` first for a deliberate swap.
- **Re-registering the object already registered stays a no-op, the default included.** The registration keeps its kind, a host's or the entry point's default, and a build from the default stays on record.
- **What counts as a build.** Only a composition point's read of the facet it composes from. Those are `SUBCOMMAND_EXTENSIONS` in `cli.build_parser()` and `ROUTE_EXTENSIONS` in `serve.build_server()`, the two facets `profile_proxy._LateProfile.READERS` names. Those reads go through `domain_profile.current_for_build()`, which is `current()` plus the record. Every other read only asks and records nothing: `is_registered()`, `current()`, `repr`, a dunder probe, the proxy's `resolve()`, and the `DISPLAY` and `VIEW_EXTENSIONS` reads. So none of these closes the window in which a host still replaces the default: openXdox's `_upstream()`, `view_extension.host_profile_name()`, `display_profile.host_display()`, `view_extension.host_view_facet()` and `canvas_drafts`. T010's optional `HANDLER_CONTRIBUTIONS` is not one of the two reads either: a server's build is recorded at its `ROUTE_EXTENSIONS` read.

## Authority

- Ratified packet: openxFactory#656 comment [`5815412869`](opensoft/openXfactory#656 (comment)).
- **R1Q3 (a)**, with (i) and (ii): openxFactory#656 comment [`5817152735`](opensoft/openXfactory#656 (comment)). *"The default profile and the default adapter are both entry-point registrations, and F3.1 line 2 is amended. 3.2's 'ambiguous registration' wording is corrected. A late host registration replaces the default until something is built, and is refused after that."*
- **RN-1 (a)**: openxFactory#656 comment [`5850003126`](opensoft/openXfactory#656 (comment)). *"reword requirement 3 so a host registration overrides the default only before anything is built from it, and add the after-build refusal scenario."* The requirement's text was amended by openxFactory#1170 (T007 batch D) → `79a720a2`. Its two scenarios are what this PR's cases assert. "A host registers its own profile" covers a registration before a build, which replaces the default. "A host registers a profile after a build from the default" covers the refusal.
- **T007 batch A**, openxFactory#1171 → `bca4a260`, records the ruled amendments to box 3.2 and to F3.1's line 2 in the packet. T016 carries out both, and the amended line 2 is the one run below.
- **R1Q22 (a)**: `cli.py` and `serve.py` are carved files, and no declared-edit act precedes an arc edit.
- The holder's readings on `DISPLAY` and on U4 (`ProjectSubcommand` stays out of the default) are recorded on openxFactory#656 comment [`5851560764`](opensoft/openXfactory#656 (comment)). `default_profile.py` cites both.
- **After**: T015, #38 → `a435aecf`; T012, #47 → `27683028`, with T010 (#40 → `0f10b1f5`) and T011 (#46 → `0e88454a`) before it. All are on `main`, and `main` @ `9d13bd16` is merged in.
- Claim: openxFactory#656 comment [`5850105728`](opensoft/openXfactory#656 (comment)).

## The falsifier

tasks.md, T016: *"**Falsifier**: F3.1 with line 2 as amended (T007 batch A); `tests/test_profile_registration.py`."* Batch A's amendment, now in the packet at `bca4a260`: *"The line asks after `build_parser()`: `python -c "from opendox.cli import build_parser; from opendox import domain_profile as d; build_parser(); print('OK', d.name_of(d.current()))"`. The prose under it adds that a bare process that builds nothing still meets `ProfileNotRegistered`, which `tests/test_profile_registration.py` asserts."*

F3.1 as #1144 writes it, with line 2 as amended, run from the checkout root. The run uses `python3` for `python`, and `pip install -q` to quiet the install:

```sh
set -euo pipefail
W=$(mktemp -d)
python3 -m venv --clear "$W/v3"
. "$W/v3/bin/activate"
pip install -q ".[test]"
python -c "from opendox.cli import build_parser; build_parser(); print('OK')"
python -c "from opendox.cli import build_parser; from opendox import domain_profile as d; build_parser(); print('OK', d.name_of(d.current()))"
python -m pytest -q tests/test_profile_registration.py
```

At `69fecb9d`, in a fresh venv, with nothing on `PYTHONPATH`. T011 is on `main`, so no shim stands in any more:

```
== F3.1, amended line 2, from the checkout root at 69fecb9, no shim
OK
OK opendox.default_profile
...................................................                      [100%]
51 passed in 1.25s
rc=0
```

Line 3 ran with the root conftest in play, as F3.1 runs it.

`tests/test_profile_registration.py` grows from 30 to 51 cases. Its new section 10 asserts the three cases and the seams between them:

| case (R1Q3, RN-1) | test |
|---|---|
| a bare process that builds nothing refuses (i) | `test_a_bare_process_that_builds_nothing_still_meets_the_refusal`, in a fresh interpreter that imports `opendox.cli`, `opendox.serve` and the default, and builds nothing |
| the entry points register the default (a) | `test_f3_1s_second_line_as_amended_names_the_default` (F3.1 line 2, verbatim, in a fresh process); `test_build_parser_registers_the_default_and_builds_on_it`; `test_cli_main_registers_the_default_and_builds_on_it`; `test_build_server_registers_the_default_before_its_first_read` |
| a host registration before a build replaces it (RN-1 (a)) | `test_a_host_registered_before_any_entry_point_keeps_its_own_tree` (no `runtime` command, so a host keeps its 31-entry tree); `test_a_host_registration_replaces_a_default_nothing_was_built_from`; `test_serve_main_registers_the_default_first_and_a_host_may_still_replace_it` |
| a host registration after a build is refused (ii) | `test_a_host_registration_after_a_build_from_the_default_is_refused`, whose message names the default, the build, `5634195861`, R1Q3 (ii), RN-1 (a) and `unregister()` |
| what is a build | a composition point's read of its facet is, once per `READERS` facet (`test_a_composition_points_read_of_its_facet_is_a_build`). Asking is not (`test_asking_which_profile_is_registered_is_not_a_build`), and nor is a read that only asks: the profile's name, `DISPLAY`, `VIEW_EXTENSIONS`, `canvas_drafts` and `resolve()` (`test_a_read_that_only_asks_is_not_a_build`) |
| the other seams | `unregister()` clears the default and its build. Re-registering the object already registered is a no-op, the default included (three cases). `register_default()` never displaces a registration and refuses `None`. The refusal names the default, and after `unregister()` it claims nothing about what the process built |

`build_server()` and `serve.main()` are held from their own lines, lifted by AST, as this file already holds the server's composition point: a server still reaches `openxdox` to be BUILT in phase 1 (research R7), and `serve.main()`'s `--ref` default reads `openxdox.snapshot_registry` (T055, phase 2). The parser and `cli.main()` are run for real.

**Runs at `69fecb9d`**, in a venv built as `validate` builds one (`pip install -c constraints-cpython312-linux.txt -e ".[test]"`):

| run | result |
|---|---|
| `--noconftest tests/test_profile_registration.py tests/test_default_profile.py` | `68 passed` |
| `validate.yml`'s three pytest steps with its "Pin the triple" arithmetic | `selected=1143 passed=1140 skipped=3 failures=0 errors=0`, OK. `main` @ `9d13bd16` gives `1122 / 1119 / 3`, and the 21 more are this slice's new cases |
| CI at `69fecb9d` | `validate`, `runtime` and SonarCloud all green |
| the whole suite, `python -m pytest -q` with the root conftest in play, `main` @ `9d13bd16` against this branch | `19 failed, 1427 passed, 13 skipped, 66 errors` against `19 failed, 1448 passed, 13 skipped, 66 errors`. The 85 red results are the same set on both, in nine files. Eight are research R3's, and T011 cleared its ninth, `tests/test_consumer_reach.py`. The other is `tests/test_imports_standalone.py` (T011), which asks for every extra and passes on both under `pip install -e ".[runtime,test]"` |

**The tests can fail.** Each mutation below was applied to the checkout at `69fecb9d`, `tests/test_profile_registration.py` re-run without any shim, and the file restored:

| mutation | failed |
|---|---|
| `build_parser()` loses its registration line | 3: F3.1 line 2, the parser test, the after-build refusal |
| a host always replaces the default, even after a build (RN-1 (b)) | 6: the server test, the `cli.main()` test, the after-build refusal, both composition-facet builds, the build kept on record |
| a host never replaces the default | 7: both before-build replacements, the after-build refusal's wording, both not-a-build cases, both re-registrations of the default |
| `current()` falls back to the default (R1Q3 (b)) | 9: every refusal case, the bare process among them |
| `current()` records a build | 4: the `serve.main()` window, both not-a-build cases, re-registering before a build |
| `build_server()` reads `ROUTE_EXTENSIONS` before it registers | 1: the server test |
| `serve.main()` loses its registration line | 1: the `serve.main()` test |
| no read records a build | 6: the server test, the `cli.main()` test, the after-build refusal, both composition-facet builds, the build kept on record |
| every read records a build, `resolve()` included (`46519d61`'s proxy) | 1: the read that only asks |
| re-registering the same object falls through (`c755147b`'s `register()`) | 2: both re-registrations of the default |
| the refusal claims the process built nothing (`aee57d5e`'s text) | 1: the refusal after `unregister()` |

`tests/test_default_profile.py`'s facets test now also asserts that the default declares no `HANDLER_CONTRIBUTIONS`. Declaring `HANDLER_CONTRIBUTIONS = ()` fails it.

## Copilot's review

- **At `c755147b`**, *"Changes recommended"*, one thread. `register()` fell through on the object already registered, so re-registering the default cleared its bookkeeping. Fixed in `1dee448e` (the re-registration row above). The thread was answered with the failing run, and it is resolved.
- **At `46519d61`**, *"Changes recommended"*, one thread. Every proxy read went through `current_for_build()`, so `view_extension.host_profile_name()` and `canvas_drafts._facet()` closed the window with nothing built. I reproduced it read by read in fresh processes: all eight reads were refused before the fix, and after it six let a host replace the default. Fixed in `aee57d5e`, at the proxy (the two read-recording rows above). The thread was answered and is resolved.
- **At `aee57d5e`**, *"Needs a closer look"*, no thread, and one note under "previously missed". `current()`'s refusal claimed "this process has built nothing through one", even after `unregister()` had dropped a default that a parser was built from. Fixed in `16d597b8` (the last row above).
- **At `16d597b8`** and **at `69fecb9d`**, *"Needs a closer look"*, Findings: None. At `69fecb9d`: *"The registration lifecycle and build-boundary changes require final human review."* No thread is open.

## The files, and why each is touched

- `src/opendox/domain_profile.py`: `register_default()` and `current_for_build()` are new. `register()` gains a same-object early return, the before-build replacement and the after-build refusal. The refusal texts and the docstrings say what is now true. `is_registered()` and `current()`, the duck-typed contract openXdox's `_upstream()` reads, answer as before, and only the refusal's words changed.
- `src/opendox/profile_proxy.py`: `__getattr__` records a build for the `READERS` facets only. `resolve()` and every other read go through `current()`. The docstrings say which read is a build, and that the nothing-registered refusal is kept.
- `src/opendox/cli.py` and `src/opendox/serve.py`: the one-line calls, and the one paragraph each that said the unregistered case refuses.
- `src/opendox/default_profile.py`: its registration paragraph now describes what the entry points do. Its facet list names T010's `HANDLER_CONTRIBUTIONS`, which it does not declare, and it cites the holder's readings on `DISPLAY` and U4. `tests/test_default_profile.py` asserts that absence.
- `docs/profile-registration-runbook.md`: `current()`'s refusal cites it as the operational contract, and its body described the contract this PR changes. It is a `Status: record`, so it is not rewritten. It gains a pointer under its introduction and a closing section, "The default profile, since plan 034". That section states the new contract, says what counts as a build, and lists what it supersedes, down to rows of the first refusal table. `README.md`'s index row for it follows, one line.

## Left for the tasks that own them

- `tests/test_consumer_reach.py` (T034), `.github/workflows/validate.yml` (T036) and the root `conftest.py` (T035) are not touched. `opendox.default_profile` is not in `test_consumer_reach.py`'s `NEUTRAL_MODULES`. `tests/test_default_profile.py` asserts its import claim in a fresh interpreter with the siblings blocked, and T034 re-derives the census. `conftest.py`'s comment still says *"openDox ships no profile"*. Its `_SuiteProfile` registration stays correct: it registers before any build, so every suite keeps composing the core surface.
- `build_parser()`'s and `build_server()`'s docstrings still carry the stale pre-carve sentence the runbook lists as owed. This PR adds nothing false there, and it leaves that debt to the act that takes it.
- A suite that registers a stand-in profile should register it before it builds, or call `unregister()` first. Once an entry point has built from the default in a process, the default is that process's registration. The suites that register today are this file, `tests/test_view_registry.py` and `tests/test_route_handler_contribution.py`, and all three unregister around every case that registers. The other two put back what they found through `register()`. So an entry point's default found there would come back as a host's registration. No suite depends on that difference today, and neither file is this slice's.

Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Arc: neutral-product-standalone-operability
Lane: openxfactory-4 (openXfactory-4-openDox_extraction)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants