Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

fix: count observations for whitespace paths

haelyra299544e6801e
diff --git a/skills/skill-stocktake/scripts/scan.sh b/skills/skill-stocktake/scripts/scan.sh
index ea2e65574..02c9c3dab 100755
--- a/skills/skill-stocktake/scripts/scan.sh
+++ b/skills/skill-stocktake/scripts/scan.sh
@@ -134,7 +134,7 @@ scan_dir_to_json() {
name=$(extract_field "$file" "name")
desc=$(extract_field "$file" "description")
mtime=$(date -u -r "$file" +%Y-%m-%dT%H:%M:%SZ)
- if [[ "$file" == *$'\n'* ]]; then
+ if [[ "$file" == *[[:space:]]* ]]; then
# The aggregated fast path is line-delimited. Preserve unusual paths by
# falling back to the structured JSON matcher for this record.
u7=$(count_obs "$file" "$c7")
diff --git a/tests/scripts/skill-stocktake-discovery.test.js b/tests/scripts/skill-stocktake-discovery.test.js
index 106d041ef..92c13c6df 100644
--- a/tests/scripts/skill-stocktake-discovery.test.js
+++ b/tests/scripts/skill-stocktake-discovery.test.js
@@ -61,7 +61,7 @@ if (process.platform === 'win32') {
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'ecc-skill-stocktake-'));
try {
const projectSkills = path.join(tempRoot, 'project', '.claude', 'skills');
- const directSkill = path.join(projectSkills, 'direct-skill');
+ const directSkill = path.join(projectSkills, 'direct skill');
const linkedTarget = path.join(tempRoot, 'shared', 'linked-skill');
const newlineSkill = path.join(projectSkills, 'newline\nskill');
const resultsPath = path.join(tempRoot, 'results.json');
@@ -83,6 +83,10 @@ if (process.platform === 'win32') {
tool: 'Read',
path: path.join(newlineSkill, 'SKILL.md'),
timestamp: new Date().toISOString(),
+ })}\n${JSON.stringify({
+ tool: 'Read',
+ path: path.join(directSkill, 'SKILL.md'),
+ timestamp: new Date().toISOString(),
})}\n`,
);
@@ -104,6 +108,9 @@ if (process.platform === 'win32') {
const newlineEntry = output.skills.find(skill => skill.name === 'newline-skill');
assert.strictEqual(newlineEntry.use_7d, 1);
assert.strictEqual(newlineEntry.use_30d, 1);
+ const spaceEntry = output.skills.find(skill => skill.name === 'direct-skill');
+ assert.strictEqual(spaceEntry.use_7d, 1);
+ assert.strictEqual(spaceEntry.use_30d, 1);
});
test('quick diff keeps newline-containing skill paths as one record', () => {