usecix 1.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. cix/__init__.py +1 -0
  2. cix/_indexed_extensions.py +68 -0
  3. cix/_ip_boundary.py +97 -0
  4. cix/_tool_manifest.py +1359 -0
  5. cix/cloud/__init__.py +9 -0
  6. cix/cloud/_changed_files.py +92 -0
  7. cix/cloud/access_check.py +204 -0
  8. cix/cloud/auth_check.py +196 -0
  9. cix/cloud/client.py +225 -0
  10. cix/cloud/config.py +45 -0
  11. cix/cloud/credentials.py +69 -0
  12. cix/cloud/dispatch.py +2443 -0
  13. cix/cloud/freshness.py +151 -0
  14. cix/cloud/license.py +128 -0
  15. cix/cloud/login.py +503 -0
  16. cix/cloud/login_gate.py +59 -0
  17. cix/cloud/telemetry.py +139 -0
  18. cix/cloud/token_refresh.py +68 -0
  19. cix/cloud/transport.py +2078 -0
  20. cix/core/__init__.py +48 -0
  21. cix/core/diagnostics.py +266 -0
  22. cix/core/edit_guard.py +327 -0
  23. cix/core/get_lines.py +413 -0
  24. cix/core/helpers.py +1196 -0
  25. cix/core/precommit.py +106 -0
  26. cix/core/presenter.py +310 -0
  27. cix/core/registry.py +367 -0
  28. cix/core/troubleshoot_log.py +155 -0
  29. cix/core/working_tree.py +662 -0
  30. cix/install.py +1432 -0
  31. cix/integrations/__init__.py +2 -0
  32. cix/integrations/clients.py +50 -0
  33. cix/integrations/docs.py +347 -0
  34. cix/integrations/gemini.py +240 -0
  35. cix/integrations/windows.py +190 -0
  36. cix/lib/__init__.py +0 -0
  37. cix/lib/file_claims.py +63 -0
  38. cix/lib/git.py +59 -0
  39. cix/lib/naming.py +36 -0
  40. cix/lib/project_config.py +235 -0
  41. cix/lib/project_id.py +105 -0
  42. cix/lib/registration_guard.py +350 -0
  43. cix/lib/rewrite.py +70 -0
  44. cix/lib/schema_json.py +178 -0
  45. cix/lib/testdb.py +133 -0
  46. cix/mcp_server/__init__.py +0 -0
  47. cix/mcp_server/main.py +576 -0
  48. cix/mcp_server/watcher.py +507 -0
  49. cix/scripts/__init__.py +0 -0
  50. cix/scripts/_cloud_wait.py +271 -0
  51. cix/scripts/agent_framing_hook.py +78 -0
  52. cix/scripts/audit.py +195 -0
  53. cix/scripts/bash_workaround_hook.py +395 -0
  54. cix/scripts/build_tool_manifest.py +114 -0
  55. cix/scripts/catchup.py +352 -0
  56. cix/scripts/clean.py +418 -0
  57. cix/scripts/cli.py +82 -0
  58. cix/scripts/codex_policy_debug.py +92 -0
  59. cix/scripts/codex_policy_hook.py +366 -0
  60. cix/scripts/config.py +77 -0
  61. cix/scripts/convention_validator_hook.py +686 -0
  62. cix/scripts/coverage.py +294 -0
  63. cix/scripts/cross_project_advisor_hook.py +136 -0
  64. cix/scripts/doctor.py +535 -0
  65. cix/scripts/feedback.py +134 -0
  66. cix/scripts/file_claim_hook.py +177 -0
  67. cix/scripts/guard.py +360 -0
  68. cix/scripts/hooks_ctl.py +134 -0
  69. cix/scripts/impact.py +161 -0
  70. cix/scripts/index.py +638 -0
  71. cix/scripts/init.py +829 -0
  72. cix/scripts/md_edit_guard_hook.py +190 -0
  73. cix/scripts/memory_guard_hook.py +97 -0
  74. cix/scripts/memory_seeds/tool_surface.md +132 -0
  75. cix/scripts/orient.py +493 -0
  76. cix/scripts/post_search_hook.py +333 -0
  77. cix/scripts/post_write_hook.py +97 -0
  78. cix/scripts/precommit.py +890 -0
  79. cix/scripts/read_advisor_hook.py +424 -0
  80. cix/scripts/reconcile.py +279 -0
  81. cix/scripts/schema_pull.py +848 -0
  82. cix/scripts/session_start_hook.py +898 -0
  83. cix/scripts/source_of_truth_hook.py +118 -0
  84. cix/scripts/summarize.py +278 -0
  85. cix/scripts/version_check.py +139 -0
  86. cix/scripts/vital.py +464 -0
  87. cix/scripts/vital_sign.py +29 -0
  88. cix/scripts/wedge_ack.py +69 -0
  89. cix/uninstall.py +538 -0
  90. cix_shared_schema/__init__.py +17 -0
  91. cix_shared_schema/parse_error.py +21 -0
  92. cix_shared_schema/sync_envelope.py +125 -0
  93. usecix-1.0.6.dist-info/METADATA +110 -0
  94. usecix-1.0.6.dist-info/RECORD +98 -0
  95. usecix-1.0.6.dist-info/WHEEL +5 -0
  96. usecix-1.0.6.dist-info/entry_points.txt +36 -0
  97. usecix-1.0.6.dist-info/licenses/LICENSE +37 -0
  98. usecix-1.0.6.dist-info/top_level.txt +2 -0
cix/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """cix — code index for AI coding tools."""
@@ -0,0 +1,68 @@
1
+ """Canonical map of indexed file extensions → cix language labels.
2
+
3
+ This is **documentation infrastructure** — the client never parses files.
4
+ The authoritative parser surface lives in cix-api per
5
+ docs/ship_boundary.md §2. This constant exists so generated docs
6
+ (CLAUDE.md / AGENTS.md / GEMINI.md sections from cix.integrations.docs),
7
+ hook messages, and inline comments can quote one source of truth instead
8
+ of pointing readers at ``cix/lib/parser.py:EXTENSION_MAP`` — that module
9
+ was deleted on 2026-05-14 when parsing moved cloud-side.
10
+
11
+ When cix-api gains parser support for a new extension, add the entry
12
+ here and let the docs regenerate. The list is informational; cix-api is
13
+ the runtime authority and may diverge before this catches up.
14
+ """
15
+ from __future__ import annotations
16
+
17
+ # (extension, language-label) pairs in stable display order. Order is the
18
+ # order they appear in generated CLAUDE.md/AGENTS.md/GEMINI.md sections,
19
+ # so keep popular languages first.
20
+ INDEXED_EXTENSIONS: tuple[tuple[str, str], ...] = (
21
+ ('.py', 'python'),
22
+ ('.js', 'javascript'),
23
+ ('.ts', 'typescript'),
24
+ ('.jsx', 'javascript'),
25
+ ('.tsx', 'tsx'),
26
+ ('.vue', 'vue'),
27
+ ('.php', 'php'),
28
+ ('.go', 'go'),
29
+ ('.java', 'java'),
30
+ ('.cpp', 'cpp'),
31
+ ('.c', 'c'),
32
+ ('.cs', 'csharp'),
33
+ ('.rb', 'ruby'),
34
+ ('.swift', 'swift'),
35
+ ('.kt', 'kotlin'),
36
+ ('.rs', 'rust'),
37
+ ('.scala', 'scala'),
38
+ ('.sql', 'sql'),
39
+ ('.html', 'html'),
40
+ ('.css', 'css'),
41
+ ('.scss', 'scss'),
42
+ ('.md', 'markdown'),
43
+ )
44
+
45
+
46
+ def indexed_extensions() -> tuple[str, ...]:
47
+ """Just the extension strings (e.g. ``.py``), in display order."""
48
+ return tuple(ext for ext, _ in INDEXED_EXTENSIONS)
49
+
50
+
51
+ def indexed_languages() -> tuple[str, ...]:
52
+ """Just the language labels, deduplicated, in first-seen order."""
53
+ seen: set[str] = set()
54
+ out: list[str] = []
55
+ for _, lang in INDEXED_EXTENSIONS:
56
+ if lang not in seen:
57
+ seen.add(lang)
58
+ out.append(lang)
59
+ return tuple(out)
60
+
61
+
62
+ def render_extensions_inline() -> str:
63
+ """Render the extension list as a single line of backtick-quoted entries.
64
+
65
+ Used by ``cix.integrations.docs`` to populate the "Indexed file types"
66
+ section in CLAUDE.md / AGENTS.md / GEMINI.md.
67
+ """
68
+ return ' '.join(f'`{ext}`' for ext, _ in INDEXED_EXTENSIONS)
cix/_ip_boundary.py ADDED
@@ -0,0 +1,97 @@
1
+ """IP boundary — modules that must NOT ship in the user's binary.
2
+
3
+ Phase 2c constant. The Nuitka build (Phase 2d) reads this list and
4
+ configures ``--nofollow-import-to`` for each entry, so the produced
5
+ binary fails fast if any client-side code path tries to import a
6
+ restricted module. The thin-mode tests in
7
+ ``tests/test_thin_client_boundary.py`` simulate that absence at import
8
+ time and verify MCP advertisement + cloud dispatch keep working.
9
+
10
+ What's restricted: every cix.core.* module whose tools have a router
11
+ in ``cix.cloud.dispatch._ROUTERS`` (the set is exposed as
12
+ ``CLOUD_ROUTED_TOOLS``). Those tools are served cloud-side; their
13
+ Python source is the IP. Modules NOT in this list are local-only
14
+ handlers (refactor, audit, reindex, registry, diagnostics, notes —
15
+ see PHASE_2_STATUS.md "Stays local by nature") or shared
16
+ infrastructure that the thin client needs.
17
+
18
+ Updating: when a new tool's handler module joins the cloud-routed
19
+ set, add the module here AND verify the boundary tests in
20
+ ``tests/py/test_thin_client_boundary.py`` still pass. The reverse —
21
+ moving a tool's handling back to local —
22
+ is a deliberate IP-leakage event that requires a code-review pause;
23
+ removing a module from this list should never be incidental.
24
+ """
25
+ from __future__ import annotations
26
+
27
+ # Modules excluded from the user's binary in Phase 2d. All entries are
28
+ # tool-bearing thin router-shells (TOOL_DEFS + cloud_unreachable handler);
29
+ # their full local implementations were ripped on 2026-05-15 under
30
+ # clean-and-ship s3. Each ships only as a manifest-advertisement surface
31
+ # the binary doesn't need to carry.
32
+ #
33
+ # Removed 2026-05-15: cix.core.coverage and cix.core.workspaces — these
34
+ # were support-only helpers for impact / navigation / orientation. With
35
+ # the shadow code gone, nothing client-side imports them, so they no
36
+ # longer have to be enumerated here.
37
+ #
38
+ # Alphabetical for stable diff readability; runtime behavior doesn't
39
+ # depend on order.
40
+ # Full IP-boundary tracking set (18 entries). This is what the Nuitka
41
+ # build excludes via --nofollow-import-to and what the thin-client
42
+ # boundary tests + tool-manifest sync test iterate over. Every entry is
43
+ # a tool-bearing module whose tool stays advertised via the frozen
44
+ # cix._tool_manifest and routes cloud-side via cix.cloud.dispatch.
45
+ # Alphabetical for stable diffs; runtime behavior is order-independent.
46
+ IP_BOUNDARY_TRACKED: tuple[str, ...] = (
47
+ 'cix.core.audit',
48
+ 'cix.core.catchup',
49
+ 'cix.core.counterfactual',
50
+ 'cix.core.coverage_map',
51
+ 'cix.core.diagnostics',
52
+ 'cix.core.impact',
53
+ 'cix.core.last_diff',
54
+ 'cix.core.navigation',
55
+ 'cix.core.orientation',
56
+ 'cix.core.read_stale',
57
+ 'cix.core.refactor',
58
+ 'cix.core.refresh_stale',
59
+ 'cix.core.reindex',
60
+ 'cix.core.renames',
61
+ 'cix.core.search',
62
+ 'cix.core.stale',
63
+ 'cix.core.team_index',
64
+ 'cix.core.vital_sign',
65
+ )
66
+
67
+ # Strict subset that must NOT appear as a source module inside the built
68
+ # wheel. This is the grep input for forbidden-path verification
69
+ # (tools/build/verify_wheel.py). It is IP_BOUNDARY_TRACKED minus
70
+ # 'cix.core.diagnostics': those 17 shadow modules were deleted from disk
71
+ # 2026-05-19 (clean-and-ship s3), so a clean wheel contains none of them
72
+ # and the grep returns []. diagnostics is deliberately EXCLUDED here:
73
+ # cix/core/diagnostics.py is a real, present source module that
74
+ # legitimately ships (referenced by cix._tool_manifest), so grepping for
75
+ # it would false-positive on a clean wheel (final-launch-design
76
+ # decision #41 / risk #600). diagnostics is still IP-boundary-tracked
77
+ # (Nuitka excludes it from the binary) — it is just not forbidden in the
78
+ # pip wheel.
79
+ SHADOWS_FORBIDDEN_IN_WHEEL: tuple[str, ...] = tuple(
80
+ m for m in IP_BOUNDARY_TRACKED if m != 'cix.core.diagnostics'
81
+ )
82
+
83
+ # Backwards-compatible alias. Existing consumers — the thin-client
84
+ # boundary tests, the tool-manifest sync test, and scripts/build_binary.py
85
+ # (Nuitka excludes) — want the full tracking set, which is now
86
+ # IP_BOUNDARY_TRACKED. Keep this name so those imports don't break.
87
+ IP_RESTRICTED_MODULES: tuple[str, ...] = IP_BOUNDARY_TRACKED
88
+
89
+
90
+ def is_ip_restricted(module_name: str) -> bool:
91
+ """True when ``module_name`` is in the restricted set.
92
+
93
+ Used by Nuitka config (Phase 2d) and by the manifest-walker in
94
+ ``cix.mcp_server.main`` to decide whether a missing module is the
95
+ intentional thin-client cut or an actual install error.
96
+ """
97
+ return module_name in IP_RESTRICTED_MODULES