okstra 0.107.2 → 0.109.0
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.
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/prompts/lead/okstra-lead-contract.md +1 -1
- package/runtime/prompts/profiles/_common-contract.md +3 -2
- package/runtime/python/okstra_ctl/graphify_cmd.py +225 -0
- package/runtime/python/okstra_ctl/resolve_task_key.py +15 -9
- package/runtime/python/okstra_ctl/session.py +44 -0
- package/runtime/python/okstra_project/__init__.py +2 -0
- package/runtime/python/okstra_project/state.py +36 -0
- package/runtime/python/okstra_token_usage/claude.py +15 -9
- package/runtime/python/okstra_token_usage/cli.py +23 -0
- package/runtime/python/okstra_token_usage/collect.py +163 -4
- package/runtime/python/okstra_vendor/__init__.py +41 -0
- package/runtime/python/okstra_vendor/graphify/.vendored-version +1 -0
- package/runtime/python/okstra_vendor/graphify/__init__.py +28 -0
- package/runtime/python/okstra_vendor/graphify/__main__.py +1371 -0
- package/runtime/python/okstra_vendor/graphify/analyze.py +540 -0
- package/runtime/python/okstra_vendor/graphify/benchmark.py +129 -0
- package/runtime/python/okstra_vendor/graphify/build.py +107 -0
- package/runtime/python/okstra_vendor/graphify/cache.py +169 -0
- package/runtime/python/okstra_vendor/graphify/cluster.py +137 -0
- package/runtime/python/okstra_vendor/graphify/detect.py +510 -0
- package/runtime/python/okstra_vendor/graphify/export.py +1014 -0
- package/runtime/python/okstra_vendor/graphify/extract.py +3277 -0
- package/runtime/python/okstra_vendor/graphify/hooks.py +220 -0
- package/runtime/python/okstra_vendor/graphify/ingest.py +297 -0
- package/runtime/python/okstra_vendor/graphify/manifest.py +4 -0
- package/runtime/python/okstra_vendor/graphify/report.py +175 -0
- package/runtime/python/okstra_vendor/graphify/security.py +203 -0
- package/runtime/python/okstra_vendor/graphify/serve.py +373 -0
- package/runtime/python/okstra_vendor/graphify/skill-aider.md +1184 -0
- package/runtime/python/okstra_vendor/graphify/skill-claw.md +1184 -0
- package/runtime/python/okstra_vendor/graphify/skill-codex.md +1242 -0
- package/runtime/python/okstra_vendor/graphify/skill-copilot.md +1268 -0
- package/runtime/python/okstra_vendor/graphify/skill-droid.md +1239 -0
- package/runtime/python/okstra_vendor/graphify/skill-kiro.md +1183 -0
- package/runtime/python/okstra_vendor/graphify/skill-opencode.md +1238 -0
- package/runtime/python/okstra_vendor/graphify/skill-trae.md +1208 -0
- package/runtime/python/okstra_vendor/graphify/skill-vscode.md +253 -0
- package/runtime/python/okstra_vendor/graphify/skill-windows.md +1245 -0
- package/runtime/python/okstra_vendor/graphify/skill.md +1319 -0
- package/runtime/python/okstra_vendor/graphify/transcribe.py +182 -0
- package/runtime/python/okstra_vendor/graphify/validate.py +72 -0
- package/runtime/python/okstra_vendor/graphify/watch.py +188 -0
- package/runtime/python/okstra_vendor/graphify/wiki.py +214 -0
- package/runtime/python/okstra_vendor/networkx/__init__.py +62 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/__init__.py +134 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/__init__.py +26 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/clique.py +259 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/clustering_coefficient.py +71 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/connectivity.py +412 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/density.py +396 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/distance_measures.py +150 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/dominating_set.py +149 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/kcomponents.py +369 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/matching.py +44 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/maxcut.py +143 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/ramsey.py +53 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/steinertree.py +265 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_approx_clust_coeff.py +41 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_clique.py +112 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_connectivity.py +199 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_density.py +146 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_distance_measures.py +59 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_dominating_set.py +78 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_kcomponents.py +303 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_matching.py +8 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_maxcut.py +94 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_ramsey.py +31 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_steinertree.py +306 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_traveling_salesman.py +1014 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_treewidth.py +274 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_vertex_cover.py +68 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/traveling_salesman.py +1508 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/treewidth.py +255 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/vertex_cover.py +83 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/__init__.py +5 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/connectivity.py +122 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/correlation.py +302 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/mixing.py +255 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/neighbor_degree.py +160 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/pairs.py +127 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/base_test.py +81 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_connectivity.py +143 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_correlation.py +122 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_mixing.py +174 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_neighbor_degree.py +107 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_pairs.py +87 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/asteroidal.py +164 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/__init__.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/basic.py +322 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/centrality.py +290 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/cluster.py +289 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/covering.py +57 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/edgelist.py +360 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/extendability.py +105 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/generators.py +603 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/link_analysis.py +316 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/matching.py +590 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/matrix.py +232 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/projection.py +526 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/redundancy.py +112 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/spectral.py +69 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_basic.py +125 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_centrality.py +192 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_cluster.py +84 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_covering.py +33 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_edgelist.py +240 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_extendability.py +334 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_generators.py +407 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_link_analysis.py +218 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matching.py +327 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matrix.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_project.py +409 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_redundancy.py +35 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py +80 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/boundary.py +168 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bridges.py +205 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/broadcasting.py +164 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/__init__.py +20 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/betweenness.py +591 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/betweenness_subset.py +236 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/closeness.py +282 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_betweenness.py +364 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_betweenness_subset.py +227 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_closeness.py +96 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/degree_alg.py +150 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/dispersion.py +107 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/eigenvector.py +357 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/flow_matrix.py +130 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/group.py +787 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/harmonic.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/katz.py +331 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/laplacian.py +150 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/load.py +200 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/percolation.py +128 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/reaching.py +209 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/second_order.py +141 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/subgraph_alg.py +361 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality.py +923 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py +354 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_closeness_centrality.py +274 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py +259 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py +147 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_closeness.py +43 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_degree_centrality.py +144 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_dispersion.py +73 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_eigenvector_centrality.py +186 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_group.py +277 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_harmonic_centrality.py +122 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_katz_centrality.py +345 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_laplacian_centrality.py +220 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_load_centrality.py +344 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_percolation_centrality.py +87 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_reaching.py +140 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_second_order_centrality.py +82 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_subgraph.py +110 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_trophic.py +302 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_voterank.py +64 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/trophic.py +181 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/voterank_alg.py +95 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/chains.py +172 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/chordal.py +443 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/clique.py +818 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/cluster.py +732 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/__init__.py +4 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/equitable_coloring.py +505 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/greedy_coloring.py +565 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/test_coloring.py +863 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/communicability_alg.py +163 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/__init__.py +28 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/asyn_fluid.py +153 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/bipartitions.py +354 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/centrality.py +171 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/community_utils.py +30 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/divisive.py +216 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/kclique.py +79 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/label_propagation.py +338 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/leiden.py +162 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/local.py +220 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/louvain.py +384 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/lukes.py +227 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/modularity_max.py +452 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/quality.py +347 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_asyn_fluid.py +147 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_bipartitions.py +157 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_centrality.py +85 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_divisive.py +106 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_kclique.py +91 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_label_propagation.py +241 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_leiden.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_local.py +76 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_louvain.py +264 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_lukes.py +152 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_modularity_max.py +340 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_quality.py +139 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_utils.py +26 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/__init__.py +6 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/attracting.py +115 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/biconnected.py +394 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/connected.py +282 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/semiconnected.py +71 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/strongly_connected.py +359 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_attracting.py +70 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_biconnected.py +248 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_connected.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_semiconnected.py +55 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_strongly_connected.py +193 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_weakly_connected.py +96 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/weakly_connected.py +196 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/__init__.py +11 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/connectivity.py +811 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/cuts.py +616 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/disjoint_paths.py +408 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/edge_augmentation.py +1270 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/edge_kcomponents.py +592 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/kcomponents.py +220 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/kcutsets.py +235 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/stoerwagner.py +152 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_connectivity.py +421 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_cuts.py +309 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_disjoint_paths.py +249 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_augmentation.py +502 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_kcomponents.py +488 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcomponents.py +323 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcutsets.py +280 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_stoer_wagner.py +102 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/utils.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/core.py +588 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/covering.py +142 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/cuts.py +416 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/cycles.py +1234 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/d_separation.py +677 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/dag.py +1392 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/distance_measures.py +1095 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/distance_regular.py +272 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/dominance.py +142 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/dominating.py +268 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/efficiency_measures.py +167 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/euler.py +470 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/__init__.py +11 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/boykovkolmogorov.py +370 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/capacityscaling.py +407 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/dinitz_alg.py +238 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/edmondskarp.py +241 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/gomory_hu.py +178 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/maxflow.py +611 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/mincost.py +356 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/networksimplex.py +662 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/preflowpush.py +425 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/shortestaugmentingpath.py +300 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gl1.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gw1.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/netgen-2.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_gomory_hu.py +128 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow.py +573 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow_large_graph.py +155 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_mincost.py +475 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_networksimplex.py +481 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/wlm3.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/utils.py +194 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/graph_hashing.py +435 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/graphical.py +483 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/hierarchy.py +57 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/hybrid.py +196 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isolate.py +107 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/__init__.py +7 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/ismags.py +1306 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/isomorph.py +336 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/isomorphvf2.py +1262 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/matchhelpers.py +352 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/temporalisomorphvf2.py +308 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.A99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.B99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.A99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.B99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_ismags.py +719 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphism.py +103 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py +490 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_match_helpers.py +64 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py +212 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py +202 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp.py +1655 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py +3118 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2userfunc.py +196 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tree_isomorphism.py +264 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/vf2pp.py +1102 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/vf2userfunc.py +192 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/__init__.py +2 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/hits_alg.py +337 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/pagerank_alg.py +498 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_hits.py +77 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_pagerank.py +213 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_prediction.py +687 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/lowest_common_ancestors.py +280 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/matching.py +1148 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/minors/__init__.py +27 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/minors/contraction.py +738 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/minors/tests/test_contraction.py +544 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/mis.py +78 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/moral.py +59 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/node_classification.py +219 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/non_randomness.py +155 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/__init__.py +4 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/all.py +324 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/binary.py +468 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/product.py +633 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_all.py +328 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_binary.py +451 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_product.py +491 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_unary.py +55 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/unary.py +77 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/perfect_graph.py +73 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/planar_drawing.py +464 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/planarity.py +1463 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/polynomials.py +306 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/reciprocity.py +98 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/regular.py +167 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/richclub.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/__init__.py +5 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/astar.py +239 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/dense.py +264 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/generic.py +716 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_astar.py +254 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense.py +212 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense_numpy.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_generic.py +511 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_unweighted.py +149 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_weighted.py +983 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/unweighted.py +625 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/weighted.py +2542 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/similarity.py +2107 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/simple_paths.py +966 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/smallworld.py +404 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/smetric.py +30 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/sparsifiers.py +296 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/structuralholes.py +374 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/summarization.py +564 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/swap.py +406 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_asteroidal.py +23 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_boundary.py +154 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_bridges.py +144 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_broadcasting.py +109 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chains.py +136 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chordal.py +129 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_clique.py +300 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cluster.py +678 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_communicability.py +80 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_core.py +266 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_covering.py +85 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cuts.py +171 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cycles.py +984 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_d_separation.py +340 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dag.py +835 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_measures.py +831 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_regular.py +85 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominance.py +299 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominating.py +115 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_efficiency.py +58 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_euler.py +314 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graph_hashing.py +872 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graphical.py +163 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hierarchy.py +46 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hybrid.py +24 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_isolate.py +26 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_link_prediction.py +615 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_lowest_common_ancestors.py +459 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_matching.py +556 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_max_weight_clique.py +179 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_mis.py +62 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_moral.py +15 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_node_classification.py +140 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_non_randomness.py +60 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_perfect_graph.py +27 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planar_drawing.py +274 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planarity.py +556 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_polynomials.py +57 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_reciprocity.py +37 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_regular.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_richclub.py +149 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_similarity.py +1158 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_simple_paths.py +803 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smallworld.py +76 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smetric.py +8 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_sparsifiers.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_structuralholes.py +191 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_summarization.py +642 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_swap.py +179 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_threshold.py +270 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_time_dependent.py +431 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_tournament.py +161 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_triads.py +248 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_vitality.py +41 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_voronoi.py +103 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_walks.py +54 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_wiener.py +157 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/threshold.py +981 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/time_dependent.py +142 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tournament.py +406 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/__init__.py +5 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/beamsearch.py +90 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/breadth_first_search.py +576 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/depth_first_search.py +529 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/edgebfs.py +185 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/edgedfs.py +182 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_beamsearch.py +25 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_bfs.py +203 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_dfs.py +307 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgebfs.py +147 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgedfs.py +131 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/__init__.py +7 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/branchings.py +1042 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/coding.py +413 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/decomposition.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/distance_measures.py +219 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/mst.py +1281 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/operations.py +106 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/recognition.py +273 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_branchings.py +624 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_coding.py +114 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_decomposition.py +79 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_distance_measures.py +99 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_mst.py +934 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_operations.py +53 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_recognition.py +174 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/triads.py +500 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/vitality.py +76 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/voronoi.py +86 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/walks.py +77 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/wiener.py +278 -0
- package/runtime/python/okstra_vendor/networkx/classes/__init__.py +13 -0
- package/runtime/python/okstra_vendor/networkx/classes/coreviews.py +435 -0
- package/runtime/python/okstra_vendor/networkx/classes/digraph.py +1363 -0
- package/runtime/python/okstra_vendor/networkx/classes/filters.py +95 -0
- package/runtime/python/okstra_vendor/networkx/classes/function.py +1549 -0
- package/runtime/python/okstra_vendor/networkx/classes/graph.py +2082 -0
- package/runtime/python/okstra_vendor/networkx/classes/graphviews.py +269 -0
- package/runtime/python/okstra_vendor/networkx/classes/multidigraph.py +977 -0
- package/runtime/python/okstra_vendor/networkx/classes/multigraph.py +1294 -0
- package/runtime/python/okstra_vendor/networkx/classes/reportviews.py +1447 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/dispatch_interface.py +192 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/historical_tests.py +476 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_coreviews.py +362 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph.py +331 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph_historical.py +110 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_filters.py +177 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_function.py +1045 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph.py +950 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph_historical.py +12 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graphviews.py +349 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_multidigraph.py +459 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_multigraph.py +528 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_reportviews.py +1421 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_special.py +131 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_subgraphviews.py +371 -0
- package/runtime/python/okstra_vendor/networkx/conftest.py +261 -0
- package/runtime/python/okstra_vendor/networkx/convert.py +502 -0
- package/runtime/python/okstra_vendor/networkx/convert_matrix.py +1314 -0
- package/runtime/python/okstra_vendor/networkx/drawing/__init__.py +7 -0
- package/runtime/python/okstra_vendor/networkx/drawing/layout.py +2036 -0
- package/runtime/python/okstra_vendor/networkx/drawing/nx_agraph.py +470 -0
- package/runtime/python/okstra_vendor/networkx/drawing/nx_latex.py +570 -0
- package/runtime/python/okstra_vendor/networkx/drawing/nx_pydot.py +361 -0
- package/runtime/python/okstra_vendor/networkx/drawing/nx_pylab.py +2978 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_complex.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_empty_graph.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_house_with_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_labels_and_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_shortest_path.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_house_with_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_agraph.py +237 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_image_comparison_pylab_mpl.py +229 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_latex.py +285 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_layout.py +631 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pydot.py +146 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pylab.py +1582 -0
- package/runtime/python/okstra_vendor/networkx/exception.py +131 -0
- package/runtime/python/okstra_vendor/networkx/generators/__init__.py +34 -0
- package/runtime/python/okstra_vendor/networkx/generators/atlas.dat.gz +0 -0
- package/runtime/python/okstra_vendor/networkx/generators/atlas.py +227 -0
- package/runtime/python/okstra_vendor/networkx/generators/classic.py +1091 -0
- package/runtime/python/okstra_vendor/networkx/generators/cographs.py +68 -0
- package/runtime/python/okstra_vendor/networkx/generators/community.py +1070 -0
- package/runtime/python/okstra_vendor/networkx/generators/degree_seq.py +886 -0
- package/runtime/python/okstra_vendor/networkx/generators/directed.py +572 -0
- package/runtime/python/okstra_vendor/networkx/generators/duplication.py +174 -0
- package/runtime/python/okstra_vendor/networkx/generators/ego.py +66 -0
- package/runtime/python/okstra_vendor/networkx/generators/expanders.py +499 -0
- package/runtime/python/okstra_vendor/networkx/generators/geometric.py +1037 -0
- package/runtime/python/okstra_vendor/networkx/generators/harary_graph.py +163 -0
- package/runtime/python/okstra_vendor/networkx/generators/internet_as_graphs.py +443 -0
- package/runtime/python/okstra_vendor/networkx/generators/intersection.py +125 -0
- package/runtime/python/okstra_vendor/networkx/generators/interval_graph.py +70 -0
- package/runtime/python/okstra_vendor/networkx/generators/joint_degree_seq.py +664 -0
- package/runtime/python/okstra_vendor/networkx/generators/lattice.py +405 -0
- package/runtime/python/okstra_vendor/networkx/generators/line.py +501 -0
- package/runtime/python/okstra_vendor/networkx/generators/mycielski.py +110 -0
- package/runtime/python/okstra_vendor/networkx/generators/nonisomorphic_trees.py +259 -0
- package/runtime/python/okstra_vendor/networkx/generators/random_clustered.py +117 -0
- package/runtime/python/okstra_vendor/networkx/generators/random_graphs.py +1416 -0
- package/runtime/python/okstra_vendor/networkx/generators/small.py +1070 -0
- package/runtime/python/okstra_vendor/networkx/generators/social.py +554 -0
- package/runtime/python/okstra_vendor/networkx/generators/spectral_graph_forge.py +120 -0
- package/runtime/python/okstra_vendor/networkx/generators/stochastic.py +54 -0
- package/runtime/python/okstra_vendor/networkx/generators/sudoku.py +131 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_atlas.py +75 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_classic.py +642 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_cographs.py +20 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_community.py +362 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_degree_seq.py +224 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_directed.py +189 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_duplication.py +103 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_ego.py +39 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_expanders.py +182 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_geometric.py +488 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_harary_graph.py +133 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_internet_as_graphs.py +221 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_intersection.py +28 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_interval_graph.py +144 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_joint_degree_seq.py +125 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_lattice.py +264 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_line.py +316 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_mycielski.py +30 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_nonisomorphic_trees.py +82 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_clustered.py +33 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_graphs.py +495 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_small.py +220 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_spectral_graph_forge.py +49 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_stochastic.py +72 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_sudoku.py +92 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_time_series.py +64 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_trees.py +195 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_triads.py +15 -0
- package/runtime/python/okstra_vendor/networkx/generators/time_series.py +74 -0
- package/runtime/python/okstra_vendor/networkx/generators/trees.py +1070 -0
- package/runtime/python/okstra_vendor/networkx/generators/triads.py +94 -0
- package/runtime/python/okstra_vendor/networkx/lazy_imports.py +188 -0
- package/runtime/python/okstra_vendor/networkx/linalg/__init__.py +13 -0
- package/runtime/python/okstra_vendor/networkx/linalg/algebraicconnectivity.py +650 -0
- package/runtime/python/okstra_vendor/networkx/linalg/attrmatrix.py +466 -0
- package/runtime/python/okstra_vendor/networkx/linalg/bethehessianmatrix.py +77 -0
- package/runtime/python/okstra_vendor/networkx/linalg/graphmatrix.py +168 -0
- package/runtime/python/okstra_vendor/networkx/linalg/laplacianmatrix.py +512 -0
- package/runtime/python/okstra_vendor/networkx/linalg/modularitymatrix.py +166 -0
- package/runtime/python/okstra_vendor/networkx/linalg/spectrum.py +186 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_algebraic_connectivity.py +400 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_attrmatrix.py +108 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_bethehessian.py +40 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_graphmatrix.py +275 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_laplacian.py +334 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_modularity.py +86 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_spectrum.py +70 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/__init__.py +17 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/adjlist.py +330 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/edgelist.py +489 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/gexf.py +1084 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/gml.py +879 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/graph6.py +427 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/graphml.py +1053 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/__init__.py +19 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/adjacency.py +156 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/cytoscape.py +190 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/node_link.py +261 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_adjacency.py +78 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_cytoscape.py +78 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_node_link.py +109 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_tree.py +48 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tree.py +137 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/leda.py +108 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/multiline_adjlist.py +393 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/p2g.py +113 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/pajek.py +286 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/sparse6.py +379 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_adjlist.py +354 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_edgelist.py +318 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gexf.py +612 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gml.py +744 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graph6.py +181 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graphml.py +1531 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_leda.py +30 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_p2g.py +63 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_pajek.py +128 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_sparse6.py +166 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_text.py +1742 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/text.py +851 -0
- package/runtime/python/okstra_vendor/networkx/relabel.py +285 -0
- package/runtime/python/okstra_vendor/networkx/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_all_random_functions.py +248 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_convert.py +321 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_numpy.py +531 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_pandas.py +349 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_scipy.py +281 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_exceptions.py +40 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_import.py +11 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_lazy_imports.py +96 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_relabel.py +349 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_removed_functions_exception_messages.py +8 -0
- package/runtime/python/okstra_vendor/networkx/utils/__init__.py +8 -0
- package/runtime/python/okstra_vendor/networkx/utils/backends.py +2171 -0
- package/runtime/python/okstra_vendor/networkx/utils/configs.py +396 -0
- package/runtime/python/okstra_vendor/networkx/utils/decorators.py +1233 -0
- package/runtime/python/okstra_vendor/networkx/utils/heaps.py +338 -0
- package/runtime/python/okstra_vendor/networkx/utils/mapped_queue.py +297 -0
- package/runtime/python/okstra_vendor/networkx/utils/misc.py +703 -0
- package/runtime/python/okstra_vendor/networkx/utils/random_sequence.py +198 -0
- package/runtime/python/okstra_vendor/networkx/utils/rcm.py +159 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test__init.py +11 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_backends.py +225 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_config.py +263 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_decorators.py +510 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_heaps.py +131 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_mapped_queue.py +268 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_misc.py +393 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_random_sequence.py +53 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_rcm.py +63 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_unionfind.py +55 -0
- package/runtime/python/okstra_vendor/networkx/utils/union_find.py +106 -0
- package/runtime/skills/okstra-graphify/SKILL.md +161 -0
- package/runtime/skills/okstra-inspect/SKILL.md +17 -9
- package/runtime/templates/reports/settings.template.json +4 -0
- package/runtime/validators/forbidden_actions.py +8 -2
- package/runtime/validators/validate_session_conformance.py +26 -5
- package/src/cli-registry.mjs +7 -0
- package/src/commands/graphify.mjs +32 -0
- package/src/commands/lifecycle/doctor.mjs +9 -0
- package/src/lib/skill-catalog.mjs +1 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import networkx as nx
|
|
2
|
+
from networkx.utils import reverse_cuthill_mckee_ordering
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def test_reverse_cuthill_mckee():
|
|
6
|
+
# example graph from
|
|
7
|
+
# http://www.boost.org/doc/libs/1_37_0/libs/graph/example/cuthill_mckee_ordering.cpp
|
|
8
|
+
G = nx.Graph(
|
|
9
|
+
[
|
|
10
|
+
(0, 3),
|
|
11
|
+
(0, 5),
|
|
12
|
+
(1, 2),
|
|
13
|
+
(1, 4),
|
|
14
|
+
(1, 6),
|
|
15
|
+
(1, 9),
|
|
16
|
+
(2, 3),
|
|
17
|
+
(2, 4),
|
|
18
|
+
(3, 5),
|
|
19
|
+
(3, 8),
|
|
20
|
+
(4, 6),
|
|
21
|
+
(5, 6),
|
|
22
|
+
(5, 7),
|
|
23
|
+
(6, 7),
|
|
24
|
+
]
|
|
25
|
+
)
|
|
26
|
+
rcm = list(reverse_cuthill_mckee_ordering(G))
|
|
27
|
+
assert rcm in [[0, 8, 5, 7, 3, 6, 2, 4, 1, 9], [0, 8, 5, 7, 3, 6, 4, 2, 1, 9]]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_rcm_alternate_heuristic():
|
|
31
|
+
# example from
|
|
32
|
+
G = nx.Graph(
|
|
33
|
+
[
|
|
34
|
+
(0, 0),
|
|
35
|
+
(0, 4),
|
|
36
|
+
(1, 1),
|
|
37
|
+
(1, 2),
|
|
38
|
+
(1, 5),
|
|
39
|
+
(1, 7),
|
|
40
|
+
(2, 2),
|
|
41
|
+
(2, 4),
|
|
42
|
+
(3, 3),
|
|
43
|
+
(3, 6),
|
|
44
|
+
(4, 4),
|
|
45
|
+
(5, 5),
|
|
46
|
+
(5, 7),
|
|
47
|
+
(6, 6),
|
|
48
|
+
(7, 7),
|
|
49
|
+
]
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
answers = [
|
|
53
|
+
[6, 3, 5, 7, 1, 2, 4, 0],
|
|
54
|
+
[6, 3, 7, 5, 1, 2, 4, 0],
|
|
55
|
+
[7, 5, 1, 2, 4, 0, 6, 3],
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
def smallest_degree(G):
|
|
59
|
+
deg, node = min((d, n) for n, d in G.degree())
|
|
60
|
+
return node
|
|
61
|
+
|
|
62
|
+
rcm = list(reverse_cuthill_mckee_ordering(G, heuristic=smallest_degree))
|
|
63
|
+
assert rcm in answers
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import networkx as nx
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_unionfind():
|
|
5
|
+
# Fixed by: 2cddd5958689bdecdcd89b91ac9aaf6ce0e4f6b8
|
|
6
|
+
# Previously (in 2.x), the UnionFind class could handle mixed types.
|
|
7
|
+
# But in Python 3.x, this causes a TypeError such as:
|
|
8
|
+
# TypeError: unorderable types: str() > int()
|
|
9
|
+
#
|
|
10
|
+
# Now we just make sure that no exception is raised.
|
|
11
|
+
x = nx.utils.UnionFind()
|
|
12
|
+
x.union(0, "a")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_subtree_union():
|
|
16
|
+
# See https://github.com/networkx/networkx/pull/3224
|
|
17
|
+
# (35db1b551ee65780794a357794f521d8768d5049).
|
|
18
|
+
# Test if subtree unions hare handled correctly by to_sets().
|
|
19
|
+
uf = nx.utils.UnionFind()
|
|
20
|
+
uf.union(1, 2)
|
|
21
|
+
uf.union(3, 4)
|
|
22
|
+
uf.union(4, 5)
|
|
23
|
+
uf.union(1, 5)
|
|
24
|
+
assert list(uf.to_sets()) == [{1, 2, 3, 4, 5}]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_unionfind_weights():
|
|
28
|
+
# Tests if weights are computed correctly with unions of many elements
|
|
29
|
+
uf = nx.utils.UnionFind()
|
|
30
|
+
uf.union(1, 4, 7)
|
|
31
|
+
uf.union(2, 5, 8)
|
|
32
|
+
uf.union(3, 6, 9)
|
|
33
|
+
uf.union(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
34
|
+
assert uf.weights[uf[1]] == 9
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_unbalanced_merge_weights():
|
|
38
|
+
# Tests if the largest set's root is used as the new root when merging
|
|
39
|
+
uf = nx.utils.UnionFind()
|
|
40
|
+
uf.union(1, 2, 3)
|
|
41
|
+
uf.union(4, 5, 6, 7, 8, 9)
|
|
42
|
+
assert uf.weights[uf[1]] == 3
|
|
43
|
+
assert uf.weights[uf[4]] == 6
|
|
44
|
+
largest_root = uf[4]
|
|
45
|
+
uf.union(1, 4)
|
|
46
|
+
assert uf[1] == largest_root
|
|
47
|
+
assert uf.weights[largest_root] == 9
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def test_empty_union():
|
|
51
|
+
# Tests if a null-union does nothing.
|
|
52
|
+
uf = nx.utils.UnionFind((0, 1))
|
|
53
|
+
uf.union()
|
|
54
|
+
assert uf[0] == 0
|
|
55
|
+
assert uf[1] == 1
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Union-find data structure.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from networkx.utils import groups
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UnionFind:
|
|
9
|
+
"""Union-find data structure.
|
|
10
|
+
|
|
11
|
+
Each unionFind instance X maintains a family of disjoint sets of
|
|
12
|
+
hashable objects, supporting the following two methods:
|
|
13
|
+
|
|
14
|
+
- X[item] returns a name for the set containing the given item.
|
|
15
|
+
Each set is named by an arbitrarily-chosen one of its members; as
|
|
16
|
+
long as the set remains unchanged it will keep the same name. If
|
|
17
|
+
the item is not yet part of a set in X, a new singleton set is
|
|
18
|
+
created for it.
|
|
19
|
+
|
|
20
|
+
- X.union(item1, item2, ...) merges the sets containing each item
|
|
21
|
+
into a single larger set. If any item is not yet part of a set
|
|
22
|
+
in X, it is added to X as one of the members of the merged set.
|
|
23
|
+
|
|
24
|
+
Union-find data structure. Based on Josiah Carlson's code,
|
|
25
|
+
https://code.activestate.com/recipes/215912/
|
|
26
|
+
with significant additional changes by D. Eppstein.
|
|
27
|
+
http://www.ics.uci.edu/~eppstein/PADS/UnionFind.py
|
|
28
|
+
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
def __init__(self, elements=None):
|
|
32
|
+
"""Create a new empty union-find structure.
|
|
33
|
+
|
|
34
|
+
If *elements* is an iterable, this structure will be initialized
|
|
35
|
+
with the discrete partition on the given set of elements.
|
|
36
|
+
|
|
37
|
+
"""
|
|
38
|
+
if elements is None:
|
|
39
|
+
elements = ()
|
|
40
|
+
self.parents = {}
|
|
41
|
+
self.weights = {}
|
|
42
|
+
for x in elements:
|
|
43
|
+
self.weights[x] = 1
|
|
44
|
+
self.parents[x] = x
|
|
45
|
+
|
|
46
|
+
def __getitem__(self, object):
|
|
47
|
+
"""Find and return the name of the set containing the object."""
|
|
48
|
+
|
|
49
|
+
# check for previously unknown object
|
|
50
|
+
if object not in self.parents:
|
|
51
|
+
self.parents[object] = object
|
|
52
|
+
self.weights[object] = 1
|
|
53
|
+
return object
|
|
54
|
+
|
|
55
|
+
# find path of objects leading to the root
|
|
56
|
+
path = []
|
|
57
|
+
root = self.parents[object]
|
|
58
|
+
while root != object:
|
|
59
|
+
path.append(object)
|
|
60
|
+
object = root
|
|
61
|
+
root = self.parents[object]
|
|
62
|
+
|
|
63
|
+
# compress the path and return
|
|
64
|
+
for ancestor in path:
|
|
65
|
+
self.parents[ancestor] = root
|
|
66
|
+
return root
|
|
67
|
+
|
|
68
|
+
def __iter__(self):
|
|
69
|
+
"""Iterate through all items ever found or unioned by this structure."""
|
|
70
|
+
return iter(self.parents)
|
|
71
|
+
|
|
72
|
+
def to_sets(self):
|
|
73
|
+
"""Iterates over the sets stored in this structure.
|
|
74
|
+
|
|
75
|
+
For example::
|
|
76
|
+
|
|
77
|
+
>>> partition = UnionFind("xyz")
|
|
78
|
+
>>> sorted(map(sorted, partition.to_sets()))
|
|
79
|
+
[['x'], ['y'], ['z']]
|
|
80
|
+
>>> partition.union("x", "y")
|
|
81
|
+
>>> sorted(map(sorted, partition.to_sets()))
|
|
82
|
+
[['x', 'y'], ['z']]
|
|
83
|
+
|
|
84
|
+
"""
|
|
85
|
+
# Ensure fully pruned paths
|
|
86
|
+
for x in self.parents:
|
|
87
|
+
_ = self[x] # Evaluated for side-effect only
|
|
88
|
+
|
|
89
|
+
yield from groups(self.parents).values()
|
|
90
|
+
|
|
91
|
+
def union(self, *objects):
|
|
92
|
+
"""Find the sets containing the objects and merge them all."""
|
|
93
|
+
# Find the heaviest root according to its weight.
|
|
94
|
+
roots = iter(
|
|
95
|
+
sorted(
|
|
96
|
+
{self[x] for x in objects}, key=lambda r: self.weights[r], reverse=True
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
try:
|
|
100
|
+
root = next(roots)
|
|
101
|
+
except StopIteration:
|
|
102
|
+
return
|
|
103
|
+
|
|
104
|
+
for r in roots:
|
|
105
|
+
self.weights[root] += self.weights[r]
|
|
106
|
+
self.parents[r] = root
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: okstra-graphify
|
|
3
|
+
description: >-
|
|
4
|
+
Use when the user wants to build, query, or navigate a knowledge graph over an okstra project's own `.okstra/` memory — its reports, decision records, and glossary. Turns that docs corpus into a persistent graph with community detection and an honest EXTRACTED/INFERRED/AMBIGUOUS audit trail, then answers cross-document questions the flat files can't. Trigger phrases include "okstra graphify", "graph the .okstra docs", "build okstra knowledge graph", "query okstra graph", "what connects to X in the okstra docs", "okstra graph 만들어", "결정 레코드 그래프". NOT for graphing arbitrary code or non-okstra folders (that is the standalone /graphify), and NOT for single-task inspection (okstra-inspect) or rollups (okstra-rollup).
|
|
5
|
+
trigger: /okstra-graphify
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# OKSTRA Graphify
|
|
9
|
+
|
|
10
|
+
Build and query a knowledge graph over the project's own okstra memory. The corpus is **fixed** to `<projectRoot>/.okstra` and the outputs land at `<projectRoot>/.okstra/graph/` — the `okstra graphify` CLI enforces both, so this skill never takes a user path argument and never touches files outside `.okstra/`.
|
|
11
|
+
|
|
12
|
+
Only `.okstra/**/*.md` (final reports, `decisions/*.md`, `glossary.md`, briefs) are indexed. This is docs-only — there is no code AST extraction here (that lives in the standalone `/graphify`).
|
|
13
|
+
|
|
14
|
+
| Sub-command | What it does |
|
|
15
|
+
|---|---|
|
|
16
|
+
| `build` | Extract entities/relationships from `.okstra` docs (subagent dispatch), then assemble the graph + report + HTML. |
|
|
17
|
+
| `query` | BFS/DFS traversal to answer a broad question over the graph. |
|
|
18
|
+
| `path` | Shortest path between two named concepts. |
|
|
19
|
+
| `explain` | Plain-language explanation of one node and its connections. |
|
|
20
|
+
| `wiki` | Agent-crawlable wiki (`index.md` + one article per community). |
|
|
21
|
+
| `mcp` | Start a stdio MCP server exposing the graph to other agents (opt-in — additionally needs `pip install mcp`). |
|
|
22
|
+
|
|
23
|
+
## Step 0: Verify okstra runtime + project setup (shared)
|
|
24
|
+
|
|
25
|
+
Before any sub-command, run each command below as a **separate Bash tool call**. Each starts with the literal token `okstra` so the `Bash(okstra:*)` permission match succeeds. Do **not** wrap them in `if`, `eval`, `export`, `$(...)`, `VAR=...`, `||`, `&&`, and do **not** introduce an `$OKSTRA_CMD` variable or an `npx -y okstra@latest` fallback — leading tokens defeat the permission match. You (the LLM) inspect each command's output and decide the next step in natural language, never in shell.
|
|
26
|
+
|
|
27
|
+
1. `okstra ensure-installed --runtime claude-code`
|
|
28
|
+
If this exits non-zero, tell the user: "okstra not installed — run `/okstra-setup` first." Then stop. Do **not** try `npx -y okstra@latest ...` as a fallback.
|
|
29
|
+
|
|
30
|
+
2. `okstra check-project --json`
|
|
31
|
+
Resolves PROJECT_ROOT from the Bash call's cwd, looks for `.okstra/project.json`, and prints `{ok, projectRoot, projectJsonPath, projectId}` (plus a `stage` on failure). Parse the JSON from stdout.
|
|
32
|
+
- `ok: true` → carry `projectRoot` as a literal string; it is the `--project-root` value for every sub-command below.
|
|
33
|
+
- `ok: false` → before concluding "no setup", ask whether the user pointed at a specific project directory. If so, re-run `okstra check-project --cwd <that-dir> --json` (the leading `okstra` token keeps the permission match). Only if this **also** returns `ok:false` do you tell the user: "this project has no okstra setup. Run `/okstra-setup` first." Then stop.
|
|
34
|
+
|
|
35
|
+
Every `okstra graphify` call below passes `--project-root <projectRoot>` — `--project-root` is REQUIRED and there is no cwd injection; a bare `okstra graphify build` fails with a usage error.
|
|
36
|
+
|
|
37
|
+
## Step 1: Dispatch by intent
|
|
38
|
+
|
|
39
|
+
Classify the request into one sub-command using the table above. If ambiguous ("okstra graph 보여줘"), ask which — enumerate the full sub-command table as a numbered text list and let the user pick. `build` is the prerequisite for `query`/`path`/`explain`/`wiki`/`mcp`; if the user asks to query before a graph exists, the CLI will fail cleanly with `no graph … Run \`okstra graphify build\` first` — run `build` first.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## build
|
|
44
|
+
|
|
45
|
+
Two parts: **semantic extraction** (subagents read `.okstra` docs and write chunk JSON), then **assemble** (the CLI clusters and generates outputs).
|
|
46
|
+
|
|
47
|
+
### build.1 — Detect the corpus
|
|
48
|
+
|
|
49
|
+
The corpus is fixed to `<projectRoot>/.okstra`. Glob the doc files yourself:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
find <projectRoot>/.okstra -type f -name '*.md' -not -path '*/graph/*'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Present a clean summary — `Corpus: N markdown files under <projectRoot>/.okstra` (reports, decisions, glossary, briefs). If zero files, stop with "No `.okstra` docs found — run some okstra tasks first, then graph them." The CLI disables graphify's filename-based sensitive-file skip inside `.okstra` (it is okstra's own generated memory, not a secrets store), so do not drop files whose names contain `token`/`secret`.
|
|
56
|
+
|
|
57
|
+
### build.2 — Semantic extraction (parallel subagents)
|
|
58
|
+
|
|
59
|
+
**MANDATORY: use the Agent tool.** Reading files one-by-one yourself is forbidden — it is far slower.
|
|
60
|
+
|
|
61
|
+
1. Split the doc list into chunks of 20-25 files. Group files from the same directory (e.g. all `decisions/`) together so cross-file relationships surface. Print a one-line estimate: `Semantic extraction: ~N files → X agents`.
|
|
62
|
+
2. Call the Agent tool **once per chunk, all in a single response** so they run in parallel. **`subagent_type="general-purpose"`** always — never `Explore` (it is read-only and cannot write chunk files, silently dropping results).
|
|
63
|
+
3. Each subagent writes its fragment to `<projectRoot>/.okstra/graph/.chunks/chunk-NN.json`.
|
|
64
|
+
|
|
65
|
+
Each subagent receives this exact prompt (substitute FILE_LIST, CHUNK_NUM, TOTAL_CHUNKS, OUT_PATH = `<projectRoot>/.okstra/graph/.chunks/chunk-<NN>.json`):
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
You are an okstra-graphify extraction subagent over an okstra project's `.okstra` docs
|
|
69
|
+
(final reports, decision records, glossary, briefs). Read the files listed and extract a
|
|
70
|
+
knowledge-graph fragment. Write ONLY valid JSON (schema below) to OUT_PATH — mkdir -p its
|
|
71
|
+
parent first. No explanation, no markdown fences.
|
|
72
|
+
|
|
73
|
+
Files (chunk CHUNK_NUM of TOTAL_CHUNKS):
|
|
74
|
+
FILE_LIST
|
|
75
|
+
|
|
76
|
+
Rules:
|
|
77
|
+
- EXTRACTED: relationship explicit in source (a report cites a decision, "see DEC-0003", a task references another task-key).
|
|
78
|
+
- INFERRED: reasonable inference (two reports discuss the same subsystem; a glossary term used in a decision).
|
|
79
|
+
- AMBIGUOUS: uncertain — flag, do not omit.
|
|
80
|
+
Extract named concepts, task-keys, decision ids, glossary terms, subsystems, and rationale
|
|
81
|
+
(sections explaining WHY a decision was made) as nodes; link them with the relations below.
|
|
82
|
+
Add a `semantically_similar_to` INFERRED edge (confidence_score 0.6-0.95) when two concepts in
|
|
83
|
+
this chunk address the same problem without any explicit link. Only when genuinely non-obvious.
|
|
84
|
+
|
|
85
|
+
confidence_score is REQUIRED on every edge:
|
|
86
|
+
- EXTRACTED → 1.0 always
|
|
87
|
+
- INFERRED → 0.6-0.9 (0.8-0.9 with clear evidence, 0.6-0.7 with some uncertainty)
|
|
88
|
+
- AMBIGUOUS → 0.1-0.3
|
|
89
|
+
|
|
90
|
+
Node ID: lowercase `[a-z0-9_]` only. Format `{stem}_{entity}` — filename stem + symbol,
|
|
91
|
+
both normalized (non-alphanumeric → `_`).
|
|
92
|
+
|
|
93
|
+
Output exactly this JSON to OUT_PATH:
|
|
94
|
+
{"nodes":[{"id":"dec_0003_stage_isolation","label":"Human Readable Name","file_type":"document","source_file":"relative/path","source_location":null}],"edges":[{"source":"node_id","target":"node_id","relation":"references|cites|conceptually_related_to|shares_data_with|semantically_similar_to|rationale_for","confidence":"EXTRACTED|INFERRED|AMBIGUOUS","confidence_score":1.0,"source_file":"relative/path","weight":1.0}]}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
After all subagents finish, confirm each `chunk-NN.json` exists on disk (the success signal). If a file is missing, warn — the subagent may have been read-only — and re-dispatch with `general-purpose`. If more than half the chunks are missing, stop and tell the user to re-run.
|
|
98
|
+
|
|
99
|
+
### build.3 — Assemble
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
okstra graphify build --project-root <projectRoot>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
This merges every `graph/.chunks/*.json` (`nodes` + `edges`), builds the graph, runs community detection, and writes to `<projectRoot>/.okstra/graph/`:
|
|
106
|
+
- `graph.json` — raw graph data
|
|
107
|
+
- `GRAPH_REPORT.md` — audit report (god nodes, surprising connections, suggested questions, token/confidence audit)
|
|
108
|
+
- `graph.html` — interactive graph, open in any browser
|
|
109
|
+
|
|
110
|
+
If the CLI errors with `no extraction chunks`, the subagents in build.2 did not write their files — re-dispatch them. After a successful build, paste the God Nodes / Surprising Connections / Suggested Questions sections from `GRAPH_REPORT.md` (not the whole file), then offer to trace the single most interesting suggested question via `query`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## query
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
okstra graphify query "<question>" --project-root <projectRoot>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
BFS traversal over the graph; prints the relevant subgraph (nodes, edge relations, confidence tags, source locations). Answer using **only** what the subgraph contains — quote `source_file`/`source_location` when citing a fact, and say so plainly if the graph lacks the information rather than inventing edges.
|
|
121
|
+
|
|
122
|
+
## path
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
okstra graphify path "<ConceptA>" "<ConceptB>" --project-root <projectRoot>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Prints the shortest path between two named concepts (each hop's relation + confidence). Explain in plain language what each hop means and why the bridge is significant.
|
|
129
|
+
|
|
130
|
+
## explain
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
okstra graphify explain "<NodeName>" --project-root <projectRoot>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Prints one node's source, type, community, degree, and its connections. Write a 3-5 sentence explanation of what it is, what it connects to, and why — cite source locations.
|
|
137
|
+
|
|
138
|
+
## wiki
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
okstra graphify wiki --project-root <projectRoot>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Writes an agent-crawlable wiki to `<projectRoot>/.okstra/graph/wiki/` — `index.md` (entry point) plus one article per community. Point the user at `index.md`.
|
|
145
|
+
|
|
146
|
+
## mcp
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
okstra graphify mcp --project-root <projectRoot>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Starts a stdio MCP server exposing the graph (`query_graph`, `get_node`, `get_neighbors`, `shortest_path`, …) so other agents can query it live. Long-running — the user Ctrl+C's to stop. This sub-command additionally requires `pip install mcp` (opt-in MCP server); the core `build`/`query`/`path`/`explain`/`wiki` sub-commands need no extra install. After doc changes, re-run `build` for LLM semantic re-extraction.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Output Rules (shared)
|
|
157
|
+
|
|
158
|
+
- Respond concisely in Korean unless the user requests otherwise.
|
|
159
|
+
- Use project-relative paths where possible; outputs live under `<projectRoot>/.okstra/graph/`.
|
|
160
|
+
- Never invent an edge — if unsure, it is AMBIGUOUS. Never hide cohesion/confidence scores.
|
|
161
|
+
- `query`/`path`/`explain`/`wiki`/`mcp` require a built graph; if the CLI says none exists, run `build` first.
|
|
@@ -166,9 +166,9 @@ Accepted `<status>` values: `todo`, `in-progress`, `blocked`, `done`.
|
|
|
166
166
|
**Procedure:**
|
|
167
167
|
|
|
168
168
|
1. **Validate status value.** If not in the enum, output an error and the allowed values list. Do not modify any file.
|
|
169
|
-
2. **Resolve the task** with the shared resolver
|
|
169
|
+
2. **Resolve the task** with the shared resolver. The token may be a task-id or a task-group (matched on both axes; a group expands to its member tasks). `--task-group` additionally scopes the task-id match case-insensitively:
|
|
170
170
|
```bash
|
|
171
|
-
okstra resolve-task-key <
|
|
171
|
+
okstra resolve-task-key <token> [--task-group <task-group>] --project-root <projectRoot> --json
|
|
172
172
|
```
|
|
173
173
|
Branch on `matches[]`: single → proceed. Multiple → list candidates and ask the user to retry with the explicit form (`okstra status set <task-group> <TASK-ID> <status>`). None → `<TASK-ID>를 찾을 수 없습니다.` and stop.
|
|
174
174
|
3. **Open the matching `task-manifest.json`** at `.okstra/tasks/<task-group-segment>/<task-id-segment>/task-manifest.json`. Assemble the path from the catalog entry's `taskGroupPathSegment` and `taskIdPathSegment` fields (filesystem-safe segments emitted by the renderer) — NOT from the raw user-supplied strings, which may differ in case or contain characters normalized when the manifest was created. Prefer the `taskManifestPath` field directly when present.
|
|
@@ -363,7 +363,7 @@ Aggregate elapsed work time for a task, grouped by **task type** and broken down
|
|
|
363
363
|
|
|
364
364
|
### time.1 — Resolve the task-key
|
|
365
365
|
|
|
366
|
-
Same standard as `cost.1`: full task-key → use directly; bare task-id → `okstra resolve-task-key <
|
|
366
|
+
Same standard as `cost.1`: full task-key → use directly; bare token (task-id or task-group) → `okstra resolve-task-key <token> --project-root <projectRoot> --json` and branch on `matches[]` (0 = not found, 1 = use, N = 3-option picker). If no okstra history exists, say `No okstra history found. Run /okstra-run first.`
|
|
367
367
|
|
|
368
368
|
### time.2 — Fetch aggregated data
|
|
369
369
|
|
|
@@ -421,7 +421,7 @@ Read-only estimate of how much file/context surface a prepared task bundle asks
|
|
|
421
421
|
Accepted target forms:
|
|
422
422
|
|
|
423
423
|
1. Full task-key: `<project-id>:<task-group>:<task-id>`.
|
|
424
|
-
2.
|
|
424
|
+
2. Bare token — a task-id (e.g. `DEV-9184`) **or** a task-group (e.g. `PROD`).
|
|
425
425
|
3. Task root path, e.g. `<projectRoot>/.okstra/tasks/<group>/<task-id>`.
|
|
426
426
|
|
|
427
427
|
If the user gives a task root path, run `okstra context-cost <absolute-or-user-provided-path>` directly.
|
|
@@ -432,16 +432,16 @@ If the user gives a full task-key, run:
|
|
|
432
432
|
okstra context-cost <task-key> --project-root <projectRoot>
|
|
433
433
|
```
|
|
434
434
|
|
|
435
|
-
If the user gives
|
|
435
|
+
If the user gives a bare token, resolve it with the shared resolver (SSOT — `scripts/okstra_ctl/resolve_task_key.py` / `okstra_project.resolve_task_reference`). The resolver matches the token as a task-id **and** as a task-group, unioning both (a group expands to its member tasks); each entry carries `_matchedVia` (`"taskId"` | `"taskGroup"`):
|
|
436
436
|
|
|
437
437
|
```bash
|
|
438
|
-
okstra resolve-task-key <
|
|
438
|
+
okstra resolve-task-key <token> --project-root <projectRoot> --json
|
|
439
439
|
```
|
|
440
440
|
|
|
441
441
|
Branch on the stdout JSON `matches[]` — this **standard 0/1/N rule** is referenced by `errors`/`recap` below:
|
|
442
442
|
- **0개** → report the task cannot be found. Do not guess.
|
|
443
443
|
- **1개** → use that entry's `taskKey`.
|
|
444
|
-
- **N개** → list the candidate `taskKey`s (with `updatedAt`) and ask via a 3-option picker (1~2 추천 + `직접 입력`), then use the chosen `taskKey`.
|
|
444
|
+
- **N개** → list the candidate `taskKey`s (with `updatedAt`, and `_matchedVia` so the user sees which came from a task-id vs a task-group) and ask via a 3-option picker (1~2 추천 + `직접 입력`), then use the chosen `taskKey`.
|
|
445
445
|
|
|
446
446
|
If the user asks generally ("컨텍스트 비용 보여줘") and does not name a task:
|
|
447
447
|
|
|
@@ -605,9 +605,11 @@ Aggregate a task's okstra-run error logs (`runs/*/logs/errors-*.jsonl`, lead-obs
|
|
|
605
605
|
Accepted target forms (same as `cost`):
|
|
606
606
|
|
|
607
607
|
1. Full task-key: `<project-id>:<task-group>:<task-id>`.
|
|
608
|
-
2.
|
|
608
|
+
2. Bare token (task-id or task-group) — resolve via `okstra resolve-task-key <token> --project-root <projectRoot> --json` and branch on `matches[]` using the standard 0/1/N rule from `cost.1` (0 = not found, 1 = use, N = picker).
|
|
609
609
|
3. Task root path.
|
|
610
610
|
|
|
611
|
+
사용자가 task 를 지정하지 않고 그냥 에러 리포트를 요청하면, `cost.1` 과 동일한 no-task fallback 을 적용한다 — 플레이스홀더 형식만 나열하고 되묻지 않는다: `.okstra/discovery/task-catalog.json` 을 읽어 task 가 1개면 그대로 사용하고, 여러 개면 `updatedAt` 최신 10개를 실제 task-key 로 나열해 물어본다(추측 금지).
|
|
612
|
+
|
|
611
613
|
### errors.2 — Run the renderer
|
|
612
614
|
|
|
613
615
|
Use the CLI output as the source of truth:
|
|
@@ -708,7 +710,13 @@ task-id 하나에 쌓인 `.okstra` 산출물 위에서 (a) 처리 전/후 요약
|
|
|
708
710
|
|
|
709
711
|
### recap.1 — Resolve target
|
|
710
712
|
|
|
711
|
-
`cost` / `errors` 와 동일한 3형식: ① full task-key, ② task-id
|
|
713
|
+
`cost` / `errors` 와 동일한 3형식: ① full task-key, ② bare token(task-id 또는 task-group → `okstra resolve-task-key <token> --project-root <projectRoot> --json`; `cost.1` 의 표준 0/1/N 분기), ③ task-root path.
|
|
714
|
+
|
|
715
|
+
사용자가 task 를 지정하지 않고 그냥 recap 을 요청하면(예: "이 작업 요약해줘"), `cost.1` 과 동일한 no-task fallback 을 적용한다 — 절대 `<task-group>` 같은 플레이스홀더 형식만 나열하고 되묻지 않는다:
|
|
716
|
+
|
|
717
|
+
1. `.okstra/discovery/task-catalog.json` 을 읽는다.
|
|
718
|
+
2. task 가 정확히 1개면 그 task 를 그대로 사용한다.
|
|
719
|
+
3. 여러 개면 `updatedAt` 최신 10개를 실제 task-key 로 나열하고 어느 task 인지 물어본다(추측 금지).
|
|
712
720
|
|
|
713
721
|
### recap.2 — Assemble the before/after summary
|
|
714
722
|
|
|
@@ -122,13 +122,19 @@ def scan_forbidden_actions(
|
|
|
122
122
|
"""Return human-readable violation strings (empty = clean)."""
|
|
123
123
|
_ensure_token_usage_importable()
|
|
124
124
|
from okstra_token_usage.claude import find_claude_team_sessions
|
|
125
|
-
from okstra_token_usage.collect import
|
|
125
|
+
from okstra_token_usage.collect import (
|
|
126
|
+
resolve_run_window,
|
|
127
|
+
resolve_team_needles_with_source,
|
|
128
|
+
)
|
|
126
129
|
|
|
127
130
|
since, until = resolve_run_window(team_state_path, team_state)
|
|
128
131
|
lead_sid = (team_state.get("lead") or {}).get("sessionId") or ""
|
|
132
|
+
team_needles, _needle_source = resolve_team_needles_with_source(
|
|
133
|
+
team_state, project_root, since, until, projects_root=claude_projects_dir
|
|
134
|
+
)
|
|
129
135
|
sessions = find_claude_team_sessions(
|
|
130
136
|
project_root,
|
|
131
|
-
|
|
137
|
+
team_needles,
|
|
132
138
|
lead_sid,
|
|
133
139
|
projects_root=claude_projects_dir,
|
|
134
140
|
)
|
|
@@ -33,7 +33,13 @@ _WORKER_DISPATCH_MODES = {"cli-wrapper", "mixed", "tmux-pane"}
|
|
|
33
33
|
_ATTEMPTED_STATUSES = {"completed", "timeout", "error"}
|
|
34
34
|
|
|
35
35
|
# lead 의 체크포인트 라인 — assistant text 블록 안에서 line-anchored 로만 인정.
|
|
36
|
-
|
|
36
|
+
# lead 는 계약상 raw 로 emit 해야 하지만 실측(dev-9902)에서 `` `PROGRESS: ...` ``
|
|
37
|
+
# 인라인 코드나 코드펜스로 감싸 emit 하는 경우가 있어, 라인 양끝의 backtick 과
|
|
38
|
+
# 선행 들여쓰기를 허용한다. phase 는 backtick 을 포함하지 않는다.
|
|
39
|
+
_PROGRESS_LINE_RE = re.compile(
|
|
40
|
+
r"^[ \t]*`*[ \t]*PROGRESS:[ \t]+(?P<phase>[^\s`]+)(?P<rest>[^`\n]*)`*[ \t]*$",
|
|
41
|
+
re.MULTILINE,
|
|
42
|
+
)
|
|
37
43
|
|
|
38
44
|
# claude-worker audit 사이드카의 heartbeat 라인 (claude-worker.md "Heartbeat").
|
|
39
45
|
_HEARTBEAT_LINE_RE = re.compile(
|
|
@@ -139,7 +145,8 @@ def _scan_one_jsonl(
|
|
|
139
145
|
continue
|
|
140
146
|
if block.get("type") == "text":
|
|
141
147
|
for m in _PROGRESS_LINE_RE.finditer(block.get("text") or ""):
|
|
142
|
-
|
|
148
|
+
line = f"PROGRESS: {m.group('phase')}{m.group('rest')}".rstrip()
|
|
149
|
+
progress.append((ts, m.group("phase"), line))
|
|
143
150
|
elif block.get("type") == "tool_use" and block.get("name") == "Read":
|
|
144
151
|
base = Path(str((block.get("input") or {}).get("file_path") or "")).name
|
|
145
152
|
if base in _SIDECAR_BASENAMES:
|
|
@@ -160,14 +167,29 @@ def _collect_lead_evidence(
|
|
|
160
167
|
agentName 없음)를 흡수한다 — worker 세션은 agentName 이 있어 자연 배제된다.
|
|
161
168
|
"""
|
|
162
169
|
from okstra_token_usage.claude import find_claude_team_sessions
|
|
163
|
-
from okstra_token_usage.collect import
|
|
170
|
+
from okstra_token_usage.collect import (
|
|
171
|
+
resolve_run_window,
|
|
172
|
+
resolve_team_needles_with_source,
|
|
173
|
+
)
|
|
164
174
|
from okstra_token_usage.paths import claude_project_dir
|
|
165
175
|
|
|
166
176
|
since, until = resolve_run_window(team_state_path, team_state)
|
|
167
177
|
lead_sid = (team_state.get("lead") or {}).get("sessionId") or ""
|
|
178
|
+
team_needles, _needle_source = resolve_team_needles_with_source(
|
|
179
|
+
team_state, project_root, since, until, projects_root=projects_root
|
|
180
|
+
)
|
|
168
181
|
sessions = find_claude_team_sessions(
|
|
169
|
-
project_root,
|
|
182
|
+
project_root, team_needles, lead_sid, projects_root=projects_root
|
|
170
183
|
)
|
|
184
|
+
# `claude --resume` 로 fork 되거나 leadSessionIds[] 에 기록된 lead 세대는
|
|
185
|
+
# team 태그 needle 로 안 잡힐 수 있어 명시적으로 후보에 추가한다.
|
|
186
|
+
proj_dir = claude_project_dir(project_root, projects_root)
|
|
187
|
+
for sid in (team_state.get("leadSessionIds") or []):
|
|
188
|
+
if not isinstance(sid, str) or not sid:
|
|
189
|
+
continue
|
|
190
|
+
candidate = proj_dir / f"{sid}.jsonl"
|
|
191
|
+
if candidate.is_file():
|
|
192
|
+
sessions.setdefault(sid, candidate)
|
|
171
193
|
evidence = _LeadEvidence(window=(since, until))
|
|
172
194
|
for sid, path in sorted(sessions.items()):
|
|
173
195
|
progress, reads, agent_name = _scan_one_jsonl(path, since, until)
|
|
@@ -178,7 +200,6 @@ def _collect_lead_evidence(
|
|
|
178
200
|
for base, ts_list in reads.items():
|
|
179
201
|
evidence.sidecar_reads.setdefault(base, []).extend(ts_list)
|
|
180
202
|
if not evidence.scanned_files:
|
|
181
|
-
proj_dir = claude_project_dir(project_root, projects_root)
|
|
182
203
|
return None, (
|
|
183
204
|
f"lead session jsonl not found under {proj_dir} "
|
|
184
205
|
f"(lead.sessionId={lead_sid or '<empty>'}) — PROGRESS checkpoint / "
|
package/src/cli-registry.mjs
CHANGED
|
@@ -173,6 +173,13 @@ export const COMMAND_REGISTRY = [
|
|
|
173
173
|
category: "introspection",
|
|
174
174
|
summary: ["Manage cross-project okstra tasks"],
|
|
175
175
|
},
|
|
176
|
+
{
|
|
177
|
+
name: "graphify",
|
|
178
|
+
module: "./commands/graphify.mjs",
|
|
179
|
+
export: "run",
|
|
180
|
+
category: "introspection",
|
|
181
|
+
summary: ["Build/query a .okstra-scoped knowledge graph"],
|
|
182
|
+
},
|
|
176
183
|
{
|
|
177
184
|
name: "worktree-lookup",
|
|
178
185
|
module: "./commands/execute/worktree-lookup.mjs",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { runPythonModule } from "../lib/python-helper.mjs";
|
|
2
|
+
|
|
3
|
+
const USAGE = `okstra graphify — build/query a .okstra-scoped knowledge graph
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
okstra graphify build --project-root <dir> [options]
|
|
7
|
+
okstra graphify query --project-root <dir> [options]
|
|
8
|
+
okstra graphify path --project-root <dir> [options]
|
|
9
|
+
okstra graphify explain --project-root <dir> [options]
|
|
10
|
+
okstra graphify mcp --project-root <dir> [options]
|
|
11
|
+
okstra graphify watch --project-root <dir> [options]
|
|
12
|
+
okstra graphify wiki --project-root <dir> [options]
|
|
13
|
+
|
|
14
|
+
--project-root <dir> targets the project whose .okstra/ subtree holds the graph.
|
|
15
|
+
All arguments are forwarded to the python wrapper (okstra_ctl.graphify_cmd);
|
|
16
|
+
--project-root is required by the wrapper, so a bare 'okstra graphify build'
|
|
17
|
+
fails cleanly with an argparse usage error.
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export async function run(args) {
|
|
21
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
22
|
+
process.stdout.write(USAGE);
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const result = await runPythonModule({
|
|
27
|
+
module: "okstra_ctl.graphify_cmd",
|
|
28
|
+
args,
|
|
29
|
+
stdio: "inherit-stdout",
|
|
30
|
+
});
|
|
31
|
+
return result.code;
|
|
32
|
+
}
|
|
@@ -113,6 +113,14 @@ async function checkPythonImport(moduleName, pythonpath) {
|
|
|
113
113
|
return { ok: true, detail: `${moduleName} importable` };
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
async function checkGraphifyVendor() {
|
|
117
|
+
const r = await runPythonSnippet({ script: "import okstra_vendor, graphify, networkx" });
|
|
118
|
+
if (r.code !== 0) {
|
|
119
|
+
return { ok: false, detail: `vendored graphify import failed: ${r.stderr.trim().split("\n").pop()}` };
|
|
120
|
+
}
|
|
121
|
+
return { ok: true, detail: "okstra_vendor, graphify, networkx importable" };
|
|
122
|
+
}
|
|
123
|
+
|
|
116
124
|
async function checkBashEntry(binDir, name) {
|
|
117
125
|
const p = join(binDir, name);
|
|
118
126
|
if (!(await fileExists(p))) return { ok: false, detail: `missing ${p}` };
|
|
@@ -218,6 +226,7 @@ export async function run(args) {
|
|
|
218
226
|
await check("python3", checkPython3),
|
|
219
227
|
await check("okstra_project import", () => checkPythonImport("okstra_project", paths.pythonpath)),
|
|
220
228
|
await check("okstra_ctl import", () => checkPythonImport("okstra_ctl", paths.pythonpath)),
|
|
229
|
+
await check("graphify vendor import", checkGraphifyVendor),
|
|
221
230
|
await check("agents dir", async () =>
|
|
222
231
|
(await fileExists(paths.agents))
|
|
223
232
|
? { ok: true, detail: paths.agents }
|