Skip to content

Rename flexlibs2 package to flexicon - #241

Open
MattGyverLee wants to merge 4 commits into
mainfrom
claude/flexicon-issue-240-peqgun
Open

Rename flexlibs2 package to flexicon#241
MattGyverLee wants to merge 4 commits into
mainfrom
claude/flexicon-issue-240-peqgun

Conversation

@MattGyverLee

Copy link
Copy Markdown
Owner

Summary

This PR completes the package rename from flexlibs2 to flexicon across the entire codebase. All internal imports, documentation, examples, and test references have been updated to use the new package name.

Key Changes

  • Package rename: All import flexlibs2 statements changed to import flexicon
  • Module paths: Updated all module references from flexlibs2.code.* to flexicon.code.* and flexlibs2.sync.* to flexicon.sync.*
  • Documentation: Updated docstrings, comments, and README files to reference flexicon instead of flexlibs2
  • Test files: Updated all test imports and references to use the new package name
  • Examples: Updated all example scripts to import from flexicon
  • Ratchet guard: Added test_flexlibs2_alias_ratchet.py to enforce that internal code does not reference the deprecated flexlibs2 alias (issue flexlibs2 is still the default runtime path internally; the alias should be inbound-only #240)

Implementation Details

  • The flexlibs2 package remains as a compatibility alias for external callers only
  • Internal library code, examples, docstrings, and tests now exclusively use flexicon
  • The ratchet test ensures no future internal references to flexlibs2 are accidentally introduced
  • All 163 files updated maintain backward compatibility through the alias package while enforcing the new naming convention internally

https://claude.ai/code/session_01G2kMG5PfSCn9tFsQfAVWeU

claude added 4 commits August 15, 2026 20:02
#240)

Two live-runtime defects and every executable flexlibs2 import scheduled
for v5.0.0 removal are rewritten to the flexicon path. Docstring Usage::
blocks and broader test-suite sweeps still to follow in a later commit,
along with the ratchet-guard test.

- FLExGlobals.APIHelpFile: point at docs/flexiconAPI/flexicon.html so the
  documented entry point actually resolves.
- FLExProject.BestStr(): use logging.getLogger(__name__) instead of the
  orphaned "flexlibs2" logger name so records aren't silently dropped.
- flexicon/sync/tests/ (20 sites) + flexicon/examples/ (6 sites) +
  flexicon/tests/ (3 sites plus a stray flexlibs2.log filename): switch
  every executable "from flexlibs2..." / "import flexlibs2..." /
  "@patch('flexlibs2....')" to the flexicon path.
- tests/ source-inspection tests: repoint hardcoded
  Path("flexlibs2/code/...") strings and executable imports to
  flexicon/code/... (test_write_enabled_fix, test_phoneme_duplicate_fix,
  test_lcm_api_usage, test_itsstring_fix, test_lcm_method_verification,
  test_wfianalysis_agent_import, test_custom_field_create_refusal).

Refs: #240
The Usage:: blocks in the Operations classes were the largest source of
externally-copied flexlibs2 imports -- every user pasting an example
from a docstring wrote code that would break at v5.0.0. Rewrite the
prose across flexicon/code/ (80 files) so the taught path is flexicon,
matching what the executable imports already do.

Also correct the flexicon/sync/tests/__init__.py module docstring, which
still described itself as tests for "flexlibs2.sync".

No behaviour change; docstrings and comments only.

Refs: #240
Broader mechanical sweep so nothing internal walks the compatibility
alias -- imports, importlib.import_module() strings, source-inspection
Path() literals, and docstring >>> examples all now resolve through
flexicon. The remaining `"flexlibs2"` / `"flexlibs2/code"` string tokens
in tests/contract/extract_lcm_contract.py are the deliberate legacy
fallback candidates for extracting contracts from pre-rename checkouts;
they are bare tokens (no dotted `.subpath`) and stay out of the ratchet
regex.

- flexicon/sync/{__init__,diff,engine}.py: version comment plus two
  docstring >>> examples switched to `from flexicon.sync import ...`.
- tests/ (70 files, ~667 executable-import sites + ~155 importlib string
  targets + 9 Path() strings + prose): rewrite everything the previous
  7-file scope missed. Includes tests/conftest.py, tests/operations/*,
  tests/contract/*, and wrapper/collection/catalog tests.

No behaviour change; alias identity is preserved for external callers.

Refs: #240
…tchet (#240)

Final wave of the internal `flexicon` rename:

- examples/ (47 files) + demos/ (3) + tools/ (3) + stray top-level scripts
  (inspect_rule_final.py, research_phase2_lcm_api.py, test_undo_redo_mocked.py,
  verify_lcm_calls.py): ~80 executable imports, docstring examples, string
  literals (including a Windows path token in verify_lcm_calls.py and CLI
  identifiers in validate_lcm_properties.py) and prose all rewritten to
  flexicon.
- tests/test_flexlibs2_alias_ratchet.py: ratchet guard that AST-parses the
  repo and asserts (a) no `from flexlibs2 [...]` / `import flexlibs2 [...]`
  outside the alias package and its own test, and (b) no dotted
  `flexlibs2.<subpath>` string literals (which reach the alias at runtime
  through unittest.mock.patch, importlib.import_module, etc.). Modelled on
  the existing source-inspection tests in tests/test_transaction_honesty.py.

Passes cleanly against HEAD. Together with the earlier commits this closes
every executable `flexlibs2` reference outside the alias package -- the
alias is now inbound-only, as the v5.0.0 deprecation notice promises.

Refs: #240
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