next-id: optional reservation so concurrent callers do not receive the same id

Abierto
#432 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
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript
Área
cli, tooling

Línea de trabajo

Start by locating the next-id command and MCP next_id entry points, then read how IDs are currently selected and written. The proposal also calls for a reservation sidecar and validate reporting, so check those entry points before scoping the change. Done means concurrent reserve calls return distinct IDs and a reserved ID is not offered again until release or expiry.

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

Descripción

enhancement

Problem

next-id <prefix> prints the next free id, but nothing records that it was handed out. Two scripts, CI jobs or LLM clients that call it before either has written its element get the same id and collide on write.

Proposal

  • next-id <prefix> --reserve [--count N] [--by <who>]: atomically allocate the next N ids and record them in a small sidecar (e.g. .syscribe/reserved-ids.json, with owner and timestamp), so later next-id calls skip them.
  • Reservations are released when the element exists, or by next-id --release <id>, or expire after a configurable time.
  • Writes use an exclusive file lock; MCP next_id gets a reserve argument.
  • validate reports a reservation that has no element after the expiry (info level).

Acceptance

  • Two concurrent next-id --reserve runs never return the same id.
  • A reserved id is not offered again until released or expired.
Lenguaje dominante
Rust
Estrellas
8
Forks
1
Merge medio
4 h 44 min
PR fusionados (30 d)
51

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: 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 sjames/syscribe

Todos los issues de sjames/syscribe

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.