Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Decide: one hosted `redirect` JSON block for disk scan and the in-memory engine (today {mode, rewrittenFiles} vs a seven-key block)

Ouverte
#1,881 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
38/100
Type d'issue
Refactorisation
Clarté
Plutôt claire
Activité
Active
Stack technique
rust

Piste de recherche

Read crates/socket-patch-cli/src/commands/scan/hosted.rs and crates/socket-patch-core/src/hosted/render.rs to compare the disk and in-memory redirect JSON blocks, then review CLI_CONTRACT and tests/hosted_memory_parity.rs. Decide which proposed shape should be shared, update the corresponding implementation and documentation, and fix the stale comment and repeated sentence. Done means disk and memory emit matching key sets, or the docs accurately describe both shapes, with the parity test covering the chosen contract.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

agent:needs-human agent:triaged arch-audit priority:p3 refactor

[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.

Kind: decision. Register ID: T29.

Question

The hosted --json envelope's nested redirect block has two shapes. Which one should both paths emit?

  • Option A (recommended): both paths emit core's seven-key block. Disk scan gains redirected, skipped, patches, warnings and dryRun; it already has mode and rewrittenFiles. This is additive for disk consumers. The per-patch pinned/would_pin/unpinned rows then also exist on disk, beside the envelope events[].
  • Option B: both paths emit the disk shape {mode, rewrittenFiles}, with per-patch outcomes only in events[] and warnings only in the top-level warnings[]. This removes keys from in-memory (napi/hosted-bundle) consumers.
  • Option C: keep both shapes, but correct the docs so neither claims to be the only one.

Problem

  • Disk: scan/hosted.rs redirect_block L95-L99 emits { "mode": "hosted", "rewrittenFiles": [...] }. Its per-patch outcomes are envelope events (applied/verified/skipped).
  • In-memory: core hosted/render.rs redirect_json_block L22-L77 emits mode, redirected, rewrittenFiles, skipped, patches, warnings and dryRun. Only hosted/memory/mod.rs calls it (L1289, L1571).
  • Its doc says this is "the ONE spelling of its key set … shared by every hosted path (disk scan, its zero-discovery arm, and the in-memory engine), so the two cannot drift by convention". That is false on main.
  • A comment at scan/hosted.rs L1900-L1904 refers to redirect.patches[], which the disk path never emits.
  • The sentence "no lockfile entry pinning it could be rewritten" is written 3 times (hosted.rs L150, L2444, render.rs L61).

Proposed change (after the decision)

  • A: disk calls redirect_json_block and redirect_block is deleted.
  • B: the memory path drops the extra keys.
  • C: both docs are corrected.

In every case, fix the stale comment and keep the sentence once.

Size

2 to 3 files plus CLI_CONTRACT text. Under 100 lines.

Acceptance criteria

  • One function builds the block for both paths, or the docs stop claiming that.
  • tests/hosted_memory_parity.rs (or a new test) asserts the disk and memory redirect key sets are equal.
Langage dominant
Rust
Étoiles
8
Forks
2
Merge moyen
19 h 12 min
PR mergées (30 j)
709

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de SocketDev/socket-patch

Toutes les issues de SocketDev/socket-patch

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.