Skip to content

ScopeKey, inspection, authored-path retention; delete HistoryMigration (1.4.0) - #27

Merged
trissim merged 8 commits into
mainfrom
refactor/U3-generic-qt-machinery
Oct 11, 2026
Merged

trissim merged 8 commits into
mainfrom
refactor/U3-generic-qt-machinery

Conversation

@trissim

@trissim trissim commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Part of OpenHCS surface U3 (generic Qt and ObjectState machinery leaves OpenHCS). Version 1.4.0. Commits, each reviewable alone:

  1. ScopeKey owns the scope hierarchy grammar. A str subclass with of, child, parent, root, ancestors(), contains, strictly_contains, depth, last, parts and one SEPARATOR. Registry keys are ScopeKeys; the hand-written :: joins, ancestor lists, prefix tests and depth counts in the registry and ObjectState call it. Containment is by whole segments. get_root_from_scope_key and is_scope_affected (no callers) are deleted. Restoring the global scope still restores no descendant parameters.
  2. Delete HistoryMigration and migration=. A history document is current or refused; the only converter (OpenHCS's desktop history upgrade) was deleted by OpenHCS U5.
  3. MAIN_BRANCH and is_restoring_snapshot(). The main branch is named once; view libraries read the restore flag publicly instead of _in_time_travel.
  4. retain_only_authored_paths. Moved from OpenHCS's serializer: a lazy dataclass copy marking only the authored (signature-diff) paths explicit.
  5. objectstate.inspection. FieldInspection (raw/resolved value, edit state, inheritance, provenance, type names) and field_markers/state_markers, the one owner of the */_ marker rule.
  6. Release 1.4.0.

Removed public API: HistoryMigration, the migration= parameter, get_root_from_scope_key, is_scope_affected. The owner may prefer 2.0.0 for that; OpenHCS pins objectstate>=1.4,<2.

Tests: the suite passes locally (225 passed), including new test_scope_key.py, test_inspection.py, test_authored_paths.py.

Release order for the U3 train: python-introspect 0.2.6 → ObjectState 1.4.0 → pyqt-reactive 0.5.0 → OpenHCS repin. Not tagged or released; the owner releases.

🤖 Generated with Claude Code

trissim and others added 6 commits October 11, 2026 03:25
Scope ids were plain strings whose '::' grammar was restated at every use:
joining, ancestors, descendant tests, depth and last segment. ScopeKey, a str
subclass, owns that grammar once; the registry stores its states under
ScopeKey keys and every hierarchy operation calls it. Containment is by whole
segments, so /plate1 no longer looks like a parent of /plate10 to callers that
used a bare prefix test. get_root_from_scope_key and is_scope_affected, which
nothing called, are replaced by ScopeKey.root and ScopeKey.contains.

Restoring the global scope still restores no descendant parameters: the
global scope provides context to every scope and owns none of their state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A history document is current or refused. The one application that passed a
converter (OpenHCS's desktop history upgrade) deleted it: desktop histories are
runtime state and reset on upgrade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MAIN_BRANCH replaces four 'main' literals, so callers that fall back to the
main branch (deleting the current branch) name it through the registry.
is_restoring_snapshot() is the public reading of the restore-in-progress flag
that view libraries read privately to refresh widget values after time travel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fields explicit

A lazy dataclass rebuilt from ObjectState's flattened fields reads every field
as explicitly set. Clean code generation needs only the authored paths, which
ObjectState already tracks as signature-diff fields. The function lived in an
application's serializer while touching only ObjectState's lazy metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FieldInspection reads one field's raw and resolved value (an unresolvable
value is reported unavailable), its dirty and signature-diff state, whether it
inherits, its provenance and type names. field_markers/state_markers own the
'*' (dirty) and '_' (differs from signature default) markers views prefix to
fields; applications wrote that rule in each view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Added: ScopeKey; objectstate.inspection (FieldInspection, field_markers,
state_markers); retain_only_authored_paths; ObjectStateRegistry.MAIN_BRANCH and
is_restoring_snapshot().
Removed: HistoryMigration and the migration= parameter of
import_history_from_dict/load_history_from_file (a history document is current
or refused); get_root_from_scope_key and is_scope_affected (ScopeKey.root and
ScopeKey.contains).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 08:16

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

trissim and others added 2 commits October 11, 2026 04:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… two unused scope helpers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim merged commit 4d74eac into main Oct 11, 2026
11 checks passed
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