incremental_probe.py

scripts/incremental_probe.py

Feasibility measurements for incremental doxygen regeneration (task #483).

main

int incremental_probe.main()

Entry point.

scripts/incremental_probe.py:913

Show on the map →

Called by none

Calls target_for

Source · 58 lines
def main() -> int:
    """@brief Entry point.
    @return Exit status.
    @version 1
    """
    parser = argparse.ArgumentParser(description=__doc__)
    ## DERIVED, NEVER BAKED IN. This shipped with one machine's target slug
    ## (`docs-db-57bf14`) hardcoded, which is both a footgun — `autorefresh` builds against
    ## whatever that path names, i.e. the operator's LIVE index — and a violation of this
    ## repo's own no-hardcoding rule. The slug is a function of the repo path, so ask for it.
    from clew.mcp_server.state import TargetRegistry, target_for

    _target = target_for(REPO, TargetRegistry().home)
    default_db = Path(_target.db_path)
    default_doxyfile = default_db.parent / "clew.doxygen" / "Doxyfile.synth"
    parser.add_argument("--db", default=str(default_db))
    parser.add_argument("--doxyfile", default=str(default_doxyfile))
    parser.add_argument("--repo", default=str(REPO))
    parser.add_argument("--file", default="clew/mcp_server/tools_query.py")
    sub = parser.add_subparsers(dest="cmd", required=True)
    sub.add_parser("subset", help="doxygen cost versus input size")
    sub.add_parser("closure", help="one-hop xref closure per file")
    sub.add_parser("outbound", help="outbound xref loss under a subset run")
    sub.add_parser("refids", help="refid stability across input sets")
    sub.add_parser("autorefresh", help="drive the MCP auto-refresh hook in-process")
    sub.add_parser("control", help="two full builds of one unmodified tree (noise floor)")
    cmp_p = sub.add_parser(
        "compare", help="incremental refresh versus a full rebuild of the same tree"
    )
    cmp_p.add_argument("--edit-file", required=True, help="repo-relative file to append to")
    cmp_p.add_argument(
        "--append-text", required=True, help="text to append, introducing a cross-file call"
    )
    cmp_p.add_argument(
        "--include-line",
        default="",
        help="an #include to insert after the file's last one, making the new call legal C/C++",
    )
    fc_p = sub.add_parser("fastcompare", help="fast tier (an added function) versus full builds")
    fc_p.add_argument(
        "--edit-file", required=True, help="repo-relative file to append a function to"
    )
    fc_p.add_argument(
        "--append-text", required=True, help="the function's source (\\n escapes allowed)"
    )
    args = parser.parse_args()
    return {
        "subset": cmd_subset,
        "closure": cmd_closure,
        "outbound": cmd_outbound,
        "refids": cmd_refids,
        "autorefresh": cmd_autorefresh,
        "compare": cmd_compare,
        "control": cmd_control,
        "fastcompare": cmd_fastcompare,
    }[args.cmd](args)

Activity · 25 steps
lines 918–918parser = argparse.ArgumentParser(description=__doc__)lines 923–923from clew.mcp_server.state import TargetRegistry, target_forlines 925–925_target = target_for(REPO, TargetRegistry().home)lines 926–926default_db = Path(_target.db_path)lines 927–927default_doxyfile = default_db.parent / "clew.doxygen" / "Doxyfile.synth"lines 928–928parser.add_argument("--db", default=str(default_db))lines 929–929parser.add_argument("--doxyfile", default=str(default_doxyfile))lines 930–930parser.add_argument("--repo", default=str(REPO))lines 931–931parser.add_argument("--file", default="clew/mcp_server/tools_query.py")lines 932–932sub = parser.add_subparsers(dest="cmd", required=True)lines 933–933sub.add_parser("subset", help="doxygen cost versus input size")lines 934–934sub.add_parser("closure", help="one-hop xref closure per file")lines 935–935sub.add_parser("outbound", help="outbound xref loss under a subset run")lines 936–936sub.add_parser("refids", help="refid stability across input sets")lines 937–937sub.add_parser("autorefresh", help="drive the MCP auto-refresh hook in-process")lines 938–938sub.add_parser("control", help="two full builds of one unmodified tree (noise floor)")lines 939–941cmp_p = sub.add_parser( "compare", help="incremental refresh versus a full rebuild of the same tree" )lines 942–942cmp_p.add_argument("--edit-file", required=True, help="repo-relative file to append to")lines 943–945cmp_p.add_argument( "--append-text", required=True, help="text to append, introducing a cross-file call" )lines 946–950cmp_p.add_argument( "--include-line", default="", help="an #include to insert after the file's last one, making the new call legal C/C++", )lines 951–951fc_p = sub.add_parser("fastcompare", help="fast tier (an added function) versus full builds")lines 952–954fc_p.add_argument( "--edit-file", required=True, help="repo-relative file to append a function to" )lines 955–957fc_p.add_argument( "--append-text", required=True, help="the function's source (\\n escapes allowed)" )lines 958–958args = parser.parse_args()lines 959–968return { "subset": cmd_subset, "closure": cmd_closure, "outbound": cmd_outbound, "refids": cmd_refids, "autorefresh": cmd_autorefresh, "compare": cmd_compare, "control": cmd_control, "fastcompare": cmd_fastcompare, }[args.cmd](args)

Flows