Skills Agentes

Test Evidence Storage

Nota interna del proyecto no-mistakes. Se usa al cambiar la recogida de evidencia de test, su publicación en una rama huérfana, sus rutas bajo el app root, la retención o la limpieza del scratch.

Estrellas
8.2k

en todo el repo

Actividad
60

0–100, la ruta de este skill

Actualizado
hace 3 días

último commit aquí

Commits
1

últimos 90 días

Contexto
1.2k tok

26 tok en reposo

Paquete
1 archivo

5 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add kunchenguid/no-mistakes --skill test-evidence-storage --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Nota interna: el paso de test siempre recoge la evidencia FUERA del worktree, en `StepContext.EvidenceDir`, y nada la stagea ni comitea a la rama empujada, así que nunca llega a la historia de la rama default.
  • Con `test.evidence.store_in_repo` y un link base de GitHub derivable, el paso de PR copia el directorio a una rama huérfana de evidencia vía `internal/evidence`, que usa solo plumbing de Git.
  • Los links del PR se fijan al COMMIT de evidencia, no a la rama, así que un run posterior que sobrescriba las mismas rutas no cambia lo que muestra un PR viejo.
  • La evidencia vive en `<NM_HOME>/evidence/<runID>`, nunca en `os.TempDir()`, porque la unidad de servicio del daemon no exporta `TMPDIR` y `/tmp` es un tmpfs que consumía RAM.
  • La limpieza es propia en tres capas (`cleanupRunEvidence`, `reapEvidence`, `reapLegacyEvidence`), todas con el guard de pending/running y best effort; ningún timer del OS es load-bearing.

Úsalo cuando

  • Se cambia la recogida de evidencia de test, su publicación, sus rutas, la retención o la limpieza del directorio de scratch.

No lo uses cuando

    Qué lo activa

    Di cualquiera de estas frases y el agente debería cargar este skill.

    • Voy a tocar la publicación de evidencia de test en no-mistakes
    • Revisa que la evidencia no llegue a la rama empujada
    • Cambia la política de retención del directorio de evidencia

    SKILL.md

    En inglés

    Test Evidence Lives on an Orphan Branch, Never in the Code Branch

    • The test step always collects evidence OUTSIDE the worktree, in the directory the executor resolved once as StepContext.EvidenceDir; nothing stages or commits it into the pushed branch, so evidence can never reach the default branch's history. With test.evidence.store_in_repo and a derivable GitHub link base, the PR step calls publishRunEvidence (internal/pipeline/steps/evidence_publish.go), which copies the directory onto the push-target repo's orphan evidence branch through internal/evidence and hands the PR body its links. A provider without derivable links does not push the branch.
    • internal/evidence owns the mechanism and its fail-closed rules: plumbing only (scratch GIT_INDEX_FILE + hash-object/write-tree/commit-tree), so HEAD, the index, and the worktree are untouched and a detached or shallow clone works; the parent is the just-fetched remote tip so the push is a plain fast-forward and never a force; an existing branch without the .no-mistakes-evidence marker at its tip is refused, which is what makes a wrong branch name (main) harmless. Every failure returns an error and the PR body falls back to local-path references rather than links that would not resolve.
    • PR links are pinned to the evidence COMMIT, not the branch, so a later run overwriting the same paths cannot change what an old PR shows. Link bases come from Repo.UpstreamURL/ForkURL, never the push URL, which can carry a credential.
    • test.evidence.branch is trusted-only in EffectiveRepoConfig (it names a ref the daemon pushes to); local_root/retention/max_runs are global-only (applyEvidenceStorageOverrides is called from Merge with GlobalConfig alone); the rest of test.evidence stays pushed-readable. Invalid branch names, relative local_root, unparseable retention, and negative max_runs all fail the config at parse time (validateTestRaw).
    • Regressions: internal/evidence/publish_test.go, internal/evidence/branch_test.go, internal/pipeline/steps/evidence_publish_test.go, TestPushStep_DoesNotPublishTestEvidenceIntoThePushedBranch, TestEffectiveRepoConfig_EvidenceBranchTrustedOnly, TestLoadGlobalConfig_InvalidEvidenceBranchFailsClosed, internal/config/evidence_storage_test.go.

    no-mistakes Owns Its Own Scratch (never the shared system temp dir)

    • Evidence lives at <NM_HOME>/evidence/<runID> (paths.EvidenceDir/EvidenceRoot/RunEvidenceDir), never os.TempDir(). The daemon's service unit exports only HOME, PATH, and proxy vars, so TMPDIR is unset and os.TempDir() resolved to the shared /tmp - a systemd tmpfs on Ubuntu 24.10+, so evidence consumed RAM. The app root is disk-backed on all three platforms, so there is deliberately NO runtime.GOOS branch; do not add one.
    • One owner for the path: the executor resolves it (Executor.runEvidenceDir) into StepContext.EvidenceDir, and agent.WithSteering(a, evidenceRoot) takes it as an argument. Steps and the steering preamble must never rebuild it - two independent os.TempDir() copies is exactly the drift this replaced.
    • Cleanup is ours, in three layers: RunManager.cleanupRunEvidence removes a finished run's dir when empty (os.Remove, never RemoveAll - the test step creates the dir before the agent decides it has anything to write, and that litter was 94% of observed accumulation), reapEvidence bounds the directory by age and count oldest-first, and reapLegacyEvidence drains the pre-relocation temp directory under the same policy. All three reuse skipWorktreeCleanup's pending/running guard and are best effort. No OS temp timer is load-bearing.
    • HELD SCOPE: internal/eval/replay.go sandboxes stay in the system temp directory. They are the largest scratch this program creates, but a replay materializes its own nested NM_HOME and worktree while Store.Prune, the case records, and the object pools all live under <NM_HOME>/eval - so relocating the sandbox inside the app root nests it in the state it is replaying, which e2e TestEvalJourney refuses on purpose. Moving it needs a disk-backed root outside NM_HOME, which does not exist yet; do not "fix" it by weakening that assertion. Every remaining os.MkdirTemp("", ...) caller is auto-named and self-cleaning with defer; keep it that way.
    • Regressions: internal/paths/evidence_test.go, internal/config/evidence_storage_test.go, internal/daemon/evidence_reap_test.go, TestSteeringNamesTheConfiguredEvidenceRoot, TestTestEvidenceDir_DefaultResolutionStaysUnderTheAppRoot, e2e TestTestEvidenceLivesUnderAppRootNotSharedTemp / TestRunCleanupLeavesNoEmptyEvidenceDirectory.

    Reproducido de kunchenguid/no-mistakes bajo licencia MIT. Leer esta página en markdown.

    Archivos

    1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

    Detalles

    Categoría
    Testing y QA
    Licencia
    MIT
    Recursos incluidos
    Solo SKILL.md
    Código fuente
    Ver SKILL.md

    Más de kunchenguid/no-mistakes

    Este repo incluye 16 skills. Si instalas uno, normalmente ya tienes los demás.

    Valida tus cambios de código por el pipeline de no-mistakes (review de código automatizado, tests, lint, docs, push, PR y CI) antes de que lleguen al destino de push configurado. Se activa con `/no-mistakes`.

    Costo de contexto al activarse
    5.9k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 3 días
    devops infraestructura

    Nota interna del proyecto no-mistakes. Se usa al cambiar la readiness de CI, la recogida de checks del forge, los reruns, los timeouts de CI o la monitorización del ciclo de vida del PR.

    Costo de contexto al activarse
    2.6k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    anteayer
    devops infraestructura

    Nota interna del proyecto no-mistakes. Se usa al cambiar las sesiones de review, las decisiones sobre findings, los timeouts de agente, el comportamiento del Test local o la conformidad con la intención.

    Costo de contexto al activarse
    4.1k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 3 días
    herramientas desarrollo

    Nota interna de seguridad del proyecto no-mistakes. Se usa al cambiar el render del cuerpo del PR, la redacción de rutas de home, la publicación de rutas de artefacto o los marcadores de attestation de pipeline.

    Costo de contexto al activarse
    1.1k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    anteayer
    seguridad

    Nota interna del proyecto no-mistakes. Se usa al añadir o cambiar tests, el harness e2e, el aislamiento de procesos de test o el sharding de tests en CI.

    Costo de contexto al activarse
    1.1k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    anteayer
    testing qa

    Nota interna del proyecto no-mistakes. Se usa al cambiar la configuración de modelo o esfuerzo de un agente, los mapeos de adaptador o los perfiles de candidato de eval, todo bajo el dueño único `internal/agentcfg`.

    Costo de contexto al activarse
    519 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 3 días
    herramientas desarrollo

    Skills relacionados

    Úsalo al recibir feedback de code review, antes de implementar sugerencias, sobre todo si el feedback parece poco claro o técnicamente cuestionable: exige rigor técnico y verificación, no acuerdo performativo ni implementación ciega.

    Costo de contexto al activarse
    1.6k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    el mes pasado
    testing qa

    Úsalo al completar tareas, implementar features mayores, o antes de mergear, para verificar que el trabajo cumple los requisitos.

    Costo de contexto al activarse
    739 tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 19 días
    testing qa

    Úsalo ante cualquier bug, fallo de test o comportamiento inesperado, antes de proponer arreglos.

    Costo de contexto al activarse
    2.4k tok
    Tamaño del paquete
    11 archivos
    Última actualización
    el mes pasado
    testing qa