Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

secret_guard: .dart/.kt missing from _SOURCE_SUFFIXES — Dart/Kotlin sources are pattern-redacted and stop compiling

Abierto Apto para principiantes
#31 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
dart, kotlin, python

Línea de trabajo

Comienza en argus_skill/core/secret_guard.py leyendo _SOURCE_SUFFIXES y scrub_recent_text_artifacts, especialmente la comprobación de include_patterns alrededor de la línea 848. Añade cobertura de regresión para expresiones inline privateKey: y apiKey: en archivos .dart y .kt, y confirma que los patrones equivalentes siguen ocultándose en artefactos .env o .json.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

The round secret guard (argus_skill/core/secret_guard.py) rewrites inline "secret" patterns in artifacts changed during a round. Source-code files listed in _SOURCE_SUFFIXES are exempt from this pattern redaction, but .dart and .kt are missing from that set. Ordinary Dart/Kotlin expressions such as privateKey: this.privateKey are therefore rewritten in place to privateKey: <REDACTED:secret> at the end of a round, and sources stop compiling.

The rewrite is silent (in-place, no backup) and happens after the Engineer has validated the tree, so the build breaks between rounds and the next round inherits a broken tree.

Impact

  • Any Flutter/Dart or Android/Kotlin project managed by Argus gets its changed sources corrupted whenever an ordinary privateKey: / apiKey: / clientSecret: expression is present.
  • Observed on argus-skill 0.1.1 (installed from main), macOS: 33 occurrences across 9 changed .dart/.kt files in a single round, re-applied after the agent restored the identifiers (the guard runs every round on git-changed files).
  • The false positive is systematic for mobile code: privateKey is a normal identifier in Dart/Kotlin, not a secret literal.

Root cause

argus_skill/core/secret_guard.py, _SOURCE_SUFFIXES (~line 180):

_SOURCE_SUFFIXES = {
    ".c",
    ".cc",
    ".cpp",
    ".cue",
    ".go",
    ".h",
    ".hpp",
    ".java",
    ".js",
    ".jsx",
    ".py",
    ".rs",
    ".sh",
    ".ts",
    ".tsx",
}

Used at ~line 848:

include_patterns = (
    not known_secret_only
    and path.suffix.casefold() not in _SOURCE_SUFFIXES
)

Files whose suffix is not in the set are pattern-redacted; Dart and Kotlin are not listed.

Minimal reproduction

Temp tree (no git repo → mtime path), a.dart contains:

class ServerConfig {
  final String privateKey;
  ServerConfig copy() => ServerConfig(privateKey: this.privateKey);
}

.env contains PRIVATE_KEY=0123456789abcdef (positive control). Call
scrub_recent_text_artifacts(tmp, modified_since=time.time() - 60).

Actual — upstream main@746f76b7a7:

changed: True  replacements: 2  files: ('.env', 'a.dart')
a.dart: ... ServerConfig(privateKey: <REDACTED:secret>;   <- broken: ')' consumed
.env :  PRIVATE_KEY= <REDACTED:secret>                    <- intended

With .dart added to _SOURCE_SUFFIXES:

changed: True  replacements: 1  files: ('.env',)
a.dart: ... ServerConfig(privateKey: this.privateKey);    <- untouched
.env :  PRIVATE_KEY= <REDACTED:secret>                    <- intended

Proposed fix

 _SOURCE_SUFFIXES = {
     ".c",
     ".cc",
     ".cpp",
     ".cue",
+    ".dart",
     ".go",
     ".h",
     ".hpp",
     ".java",
     ".js",
     ".jsx",
+    ".kt",
     ".py",
     ".rs",
     ".sh",
     ".ts",
     ".tsx",
 }

(Optionally .kts for Kotlin scripts.)

Suggested regression test

Assert that scrub_recent_text_artifacts leaves inline privateKey: / apiKey: expressions untouched in .dart and .kt files, while still redacting the same patterns in non-source artifacts (e.g. .env, .json).

Environment

  • argus-skill 0.1.1, installed from main zip, macOS (Darwin 25.6, arm64), Python 3.12.13
  • Verified on upstream main @ 746f76b7a7 (raw file still lacks .dart/.kt); the preview repo (lbx154/Argus, main) shows the same set.
Lenguaje dominante
Python
Estrellas
132
Forks
19
Merge medio
11 h 5 min
PR fusionados (30 d)
2

Preparar el entorno

Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/ArgusAgent

Todos los issues de microsoft/ArgusAgent

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.