Harden workflow ID minting and surface real collisions

Abierto
#934 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend, cli

Línea de trabajo

Look at the mint_id() function and its use of random.getrandbits. Replace with secrets.randbits or random.SystemRandom(). Then examine graph replay logic for node and link ID collisions. Design a collision contract: redraw IDs during minting against the graph, and create a typed conflict error for replay. Write tests for global seeding independence and collision outcomes.

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

Descripción

Random ID collisions can fail silently. Global seeding makes draws repeatable.

Full context for agent readers

Follow-up from the ID contract correction. That review established two behavior gaps intentionally excluded from the documentation-only pull request:

  1. mint_id() uses the process-global random.getrandbits. A caller's random.seed(...) can make independently created ID streams repeatable. Use an OS-backed or module-private source such as secrets.randbits or random.SystemRandom() and add a regression test proving global seeding does not control IDs.
  2. A genuine same-actor node or link ID collision has no explicit outcome. Node replay is first-arrival-wins; link replay can retain a destination reference to an unrelated existing link. Design the smallest safe collision contract: redraw while minting against a known graph, and surface a typed conflict when replay receives two different entities with one ID.

Acceptance criteria:

  • Global random.seed(...) cannot force mint_id() to repeat a known stream.
  • Local minting does not emit an ID already present in the target graph.
  • Replay of two distinct entities with one ID produces an explicit, tested outcome rather than silent success.
  • Node and link paths have asymmetric regression cases where the competing payloads differ.

Source findings: silent collision handling and seedable random source.

Lenguaje dominante
Python
Estrellas
1k
Forks
176
Merge medio
1 d 11 h
PR fusionados (30 d)
87

Preparar el entorno

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 Comfy-Org/comfy-cli

Todos los issues de Comfy-Org/comfy-cli

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.