Skip to content

session-flow: switch save_point.py and census.py to the shared plugin_paths.py #17383

Closed

Description

@kyle-sexton

Problem

In the session-flow plugin, scripts/save_point.py and scripts/census.py each keep their own copy of the plugin data-root rule. scripts/plugin_paths.py is the shared implementation, so the rule exists in three places, and test_plugin_paths.py carries an agreement test that exists only to keep the copies in step.

Switching both scripts is not a one-line change: their tests copy a fixed list of scripts into a temporary plugin tree, so that list and those tests change too.

Done looks like

  • save_point.py and census.py import the data-root rule from scripts/plugin_paths.py.
  • Their tests' fixed script lists include plugin_paths.py and the tests pass.
  • One implementation of the rule remains; the agreement test in test_plugin_paths.py is removed or reduced to what is still needed.

Refs: #17337

Activity

  1. added
    needs-triage
    on Nov 19, 2026
  2. github-actions commented on Nov 19, 2026

    @github-actions
    Contributor

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none
    Blast radius: session-flow's save_point.py, census.py, their tests, and test_plugin_paths.py; run by the plugin's scripts and its test suite.
    Reversible: yes; revert the change.
    Open questions: none
    Understood: remove the duplicated data-root rule from save_point.py and census.py by importing scripts/plugin_paths.py, add plugin_paths.py to the tests' copied script lists, and drop or trim the agreement test. The done-when items are exact. No duplicate or merged fix found among the listed issues and pull requests.

    Automated triage. A maintainer reviews it.

  3. removed
    needs-triage
    on Nov 19, 2026
  4. melodic-automation-lanes commented on Nov 19, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane yet: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited; intake's refinement of this body is due and may supply them.

  5. melodic-automation-lanes commented on Nov 19, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: save_point.py imports data_root from plugin_paths.py, its cache-install test copies plugin_paths.py too, and the agreement test is removed; census.py likely needs no change.

    Related work

    Open questions

    1. census.py has no copy of the data-root rule: it only takes a data_dir argument. Is census.py meant to change, or is the issue wrong about it?
      RECOMMENDED: Drop census.py from scope. Only save_point.py changes, and no census test has a copied script list. Basis: .base/plugins/session-flow/scripts/census.py:72
    2. Should the work be limited to replacing _plugin_data_root in save_point.py with plugin_paths.data_root(os.environ, _SCRIPTS_DIR.parent)?
      RECOMMENDED: Yes. That is the only duplicate outside plugin_paths.py, and away.py already uses plugin_paths. Basis: .base/plugins/session-flow/scripts/save_point.py:3153
    3. The agreement test calls save_point._plugin_data_root, which will no longer exist. Remove it and keep the direct data_root test?
      RECOMMENDED: Remove the agreement test at test_plugin_paths.py:75-82 and keep the direct rule test at line 16. Basis: .base/plugins/session-flow/scripts/tests/test_plugin_paths.py:75
    4. The cache-install helper copies only save_point.py and io_streams.py. Is adding plugin_paths.py there enough, given save_point.py will import it by sibling path?
      RECOMMENDED: Yes, add plugin_paths.py to the tuple at test_save_point.py:1464, and make sure save_point.py puts its own scripts dir on sys.path as away.py does. Basis: .base/plugins/session-flow/scripts/tests/test_save_point.py:1464

    Sources read

    • .base/plugins/session-flow/scripts/plugin_paths.py:35: data_root is the shared rule, with write_atomic and run_git
    • ​.base/plugins/session-flow/scripts/save_point.py:3153: _plugin_data_root is a local copy of the rule
    • ​.base/plugins/session-flow/scripts/census.py:72: only takes data_dir; no data-root rule
    • ​.base/plugins/session-flow/scripts/away.py:208: away.py already aliases plugin_paths.data_root
    • ​.base/plugins/session-flow/scripts/tests/test_plugin_paths.py:75: agreement test against save_point._plugin_data_root
    • ​.base/plugins/session-flow/scripts/tests/test_save_point.py:1464: cache-install helper copies save_point.py and io_streams.py only

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  6. kyle-sexton commented on Nov 19, 2026

    @kyle-sexton
    MemberAuthor

    Done in #17391.

    • The data-root rule now has one home: save_point._default_memory_dir calls the shared plugin_paths.data_root, and save_point's own copy is gone.
    • census.py has no data-root rule. Its only overlap with the shared helpers is write_atomic, which stays as it is: collect.py lists census.py as a collector input, so editing it would re-collect every stored session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    needs-owner-decision

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions