Skip to content

Commit bc0eee6

Browse files
committed
fix: redact doctor JSON skill paths
1 parent b73ca57 commit bc0eee6

5 files changed

Lines changed: 227 additions & 184 deletions

File tree

autonomy/loki

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14033,22 +14033,20 @@ _SKILL_ENTRIES = (
1403314033
skills = []
1403414034
for _sk_name, _sk_rel in _SKILL_ENTRIES:
1403514035
_sk_dir = os.path.join(os.path.expanduser('~'), _sk_rel)
14036+
# JSON is commonly archived or forwarded to automation. Keep the useful
14037+
# user-relative location without exposing the machine-specific home path.
14038+
_sk_json_path = '~/' + _sk_rel
1403614039
if os.path.isfile(os.path.join(_sk_dir, 'SKILL.md')):
14037-
skills.append({'name': _sk_name, 'path': _sk_dir, 'status': 'pass',
14040+
skills.append({'name': _sk_name, 'path': _sk_json_path, 'status': 'pass',
1403814041
'detail': None, 'required': 'required'})
1403914042
elif os.path.islink(_sk_dir):
1404014043
# islink is true for a DANGLING link (lstat-based), which is exactly
1404114044
# the broken case the text path reports as FAIL.
14042-
try:
14043-
_sk_target = os.readlink(_sk_dir)
14044-
except OSError:
14045-
_sk_target = 'unknown'
14046-
skills.append({'name': _sk_name, 'path': _sk_dir, 'status': 'fail',
14047-
'detail': 'broken symlink -> ' + _sk_target
14048-
+ '. Fix: loki setup-skill',
14045+
skills.append({'name': _sk_name, 'path': _sk_json_path, 'status': 'fail',
14046+
'detail': 'broken symlink. Fix: loki setup-skill',
1404914047
'required': 'required'})
1405014048
else:
14051-
skills.append({'name': _sk_name, 'path': _sk_dir, 'status': 'warn',
14049+
skills.append({'name': _sk_name, 'path': _sk_json_path, 'status': 'warn',
1405214050
'detail': 'not found - run loki setup-skill',
1405314051
'required': 'required'})
1405414052

0 commit comments

Comments
 (0)