Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .sentrux/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
},
"metrics": {
"complex_fn_count": 12,
"coupling_score": 44.78,
"cross_module_edges": 918,
"coupling_score": 45.07,
"cross_module_edges": 1023,
"cycle_count": 0,
"files": 205,
"functions": 2804,
"files": 227,
"functions": 3060,
"god_file_count": 29,
"max_complexity": 162,
"quality_signal": 3971,
"total_import_edges": 918
"quality_signal": 3969,
"total_import_edges": 1023
},
"savedAt": 1784946137,
"savedAt": 1785048977,
"schema": "code-intel-sentrux-baseline.v2",
"scope": ".",
"sourceCommit": "e746956754ff0dc89ae97d03716c7f53b967aa33"
"sourceCommit": "d20e4476c68c34b9596d96dfa7895dceabbd21b4"
}
10 changes: 7 additions & 3 deletions .sentrux/rules.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
# no god files, coupling grade B) is tracked modernization debt
# (issue #14, "Remaining tracked debt").
#
# Measured ratchet evidence (sentrux-native 2.0.0, 2026-07-25, PR #15 tree,
# recorded together with .sentrux/baseline.json in the same commit):
# Measured ratchet evidence (sentrux-native 2.0.0, 2026-07-26, PR #39 tree
# merged with v0.6.0 main, recorded together with .sentrux/baseline.json in
# the same commit):
# max_complexity 162 (scripts/tests/test-code-intel-pipeline.ps1),
# god_file_count 29, coupling_score 44.78, cycle_count 0.
# god_file_count 29, coupling_score 45.07, cycle_count 0.
# The 44.78 -> 45.07 coupling and 3971 -> 3969 quality movement is the cost
# of the v0.6.0 audit layer plus the edit.ast-grep-plan adapter module; god
# files and cycles did not move.
# The previous B / 70 / no-god thresholds were never green under any engine:
# the first honest self-scan of v0.5.0 already failed all three, so restoring
# them would guarantee a permanently red release gate, not protection.
Expand Down
5 changes: 4 additions & 1 deletion crates/code-intel-cli/src/capability_inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ mod native_code_evidence;
mod project_orientation;
#[path = "project_orientation_benchmark.rs"]
mod project_orientation_benchmark;
#[path = "structured_edit.rs"]
mod structured_edit;
#[path = "understanding_quadrant.rs"]
mod understanding_quadrant;

Expand Down Expand Up @@ -71,6 +73,7 @@ pub(crate) fn execute(
"evidence.native-code.compat" => {
native_code_evidence::execute(request, verified_inputs, out)
}
"edit.ast-grep-plan.compat" => structured_edit::execute(request, verified_inputs, out),
"project.orientation.compat" => project_orientation::execute(request, verified_inputs, out),
"understanding.quadrant.compat" => {
understanding_quadrant::execute(request, verified_inputs, out)
Expand Down Expand Up @@ -315,7 +318,7 @@ fn inventory(request: &Value, out: &Path) -> Result<AdapterOutput, AdapterError>
.collect::<Vec<_>>();
baseline_globs.extend(
lease
.inventory_gitlink_paths()
.inventory_excluded_paths()
.iter()
.map(|path| gitlink_exclude_glob(path)),
);
Expand Down
29 changes: 27 additions & 2 deletions crates/code-intel-cli/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ pub(crate) struct SnapshotLease {
policy: Policy,
scopes: Vec<String>,
manifest: InputManifest,
inventory_excluded_paths: Vec<String>,
}

#[derive(Clone, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -466,11 +467,20 @@ pub(crate) fn begin_consumption(repo: &Path, expected: &Value) -> Result<Snapsho
}
let manifest =
input_manifest(repo, policy, &scopes).map_err(|error| error.message().to_string())?;
let inventory_excluded_paths = if git_context(repo)
.map_err(|error| error.message().to_string())?
.is_some()
{
untracked_directory_paths(repo, &scopes).map_err(|error| error.message().to_string())?
} else {
Vec::new()
};
Ok(SnapshotLease {
expected: expected.clone(),
policy,
scopes,
manifest,
inventory_excluded_paths,
})
}

Expand All @@ -490,12 +500,13 @@ impl SnapshotLease {
paths
}

pub(crate) fn inventory_gitlink_paths(&self) -> Vec<String> {
pub(crate) fn inventory_excluded_paths(&self) -> Vec<String> {
self.manifest
.entries
.iter()
.filter(|entry| entry.kind == "gitlink")
.map(|entry| entry.path.clone())
.chain(self.inventory_excluded_paths.iter().cloned())
.collect()
}

Expand Down Expand Up @@ -1069,7 +1080,7 @@ fn effective_file_mode(index_mode: &str, metadata: &fs::Metadata) -> String {
}
}

fn untracked_paths(repo: &Path, scopes: &[String]) -> Result<Vec<String>, SnapshotError> {
fn untracked_entries(repo: &Path, scopes: &[String]) -> Result<Vec<String>, SnapshotError> {
let mut args = vec![
"ls-files",
"--others",
Expand All @@ -1085,6 +1096,20 @@ fn untracked_paths(repo: &Path, scopes: &[String]) -> Result<Vec<String>, Snapsh
)?)
}

fn untracked_paths(repo: &Path, scopes: &[String]) -> Result<Vec<String>, SnapshotError> {
Ok(untracked_entries(repo, scopes)?
.into_iter()
.filter(|path| !path.ends_with('/'))
.collect())
}

fn untracked_directory_paths(repo: &Path, scopes: &[String]) -> Result<Vec<String>, SnapshotError> {
Ok(untracked_entries(repo, scopes)?
.into_iter()
.filter_map(|path| path.strip_suffix('/').map(str::to_string))
.collect())
}

#[derive(Clone, Debug, Default, PartialEq, Eq)]
struct Overlay {
tracked_modified: BTreeSet<String>,
Expand Down
Loading
Loading