[2026 errata] sync_sprint2.py scans 2026/ instead of 2026/working/ and rewrites issues.json with an empty Track B

Open
#164 0 comments 0 reactions 0 assignees View on GitHub

@drk-ram is already working on this.

Since Nov 4, 2026.

  • #165 by @drk-ram — open

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start in 2026/working/polling/scripts/sync_sprint2.py, where EXISTING_DIR_PATH points at 2026 instead of 2026/working, and read load_existing_from_remote() and build_updated_config(). Run the reproduction snippet in the issue: it should report 10 existing entries and keep 10 Track B entries rather than 0. Done means the Track B lookup finds all ten LLM files and the script refuses to write an empty Track B list. A linked pull request (#165) already exists, so check it before starting.

Written by the indexing model from the issue text.

Description

Affected section

Other (Sprint 2 polling tooling under 2026/working/polling/scripts/)

Where does the issue appear?

GitHub source

What is incorrect?

sync_sprint2.py looks for the existing LLM01 to LLM10 entries in the wrong directory. EXISTING_DIR_PATH is "2026", but since the working/ / final/ split (#83, with path fixes in #84) the entries live in 2026/working/. The module docstring itself says the source is 2026/working/ (existing entries: LLM01_*.md ... LLM10_*.md).

load_existing_from_remote() lists 2026/ through the Contents API and keeps only files that match ^(LLM(?:0[1-9]|10))_.*\.md$. 2026/ now contains README.md, _template.md, final/ and working/, so nothing matches and the function returns an empty list without any warning.

The empty list then flows through the rest of the pipeline:

  1. reconcile() reports all 10 Track B entries as removed. print_diff() prints "removals are NOT auto-applied. Verify manually."
  2. build_updated_config() does apply them: it sets new_config["track_b"] = local_b, i.e. the empty list.
  3. main() Phase 4 calls write_config(), so a normal run (no --dry-run, no --no-write) overwrites issues.json with "track_b": [].
  4. Phase 5 then has no Track B entries to compare against the existing sprint-2 issues, and the NEXT STEPS block tells the operator to commit and push that file so the Apps Script form can fetch it and rebuildSprintTwoFormDynamic() can rebuild the ballot from it.

So the documented workflow silently empties the Track B half of the registry that the voting form is built from.

Proposed correction
  • Set EXISTING_DIR_PATH = "2026/working" (the directory the docstring already names).
  • Fail loudly instead of rewriting the registry when discovery returns nothing: if load_existing_from_remote() finds zero entries while the registry has Track B entries, print an error and return a non-zero exit code before Phase 4.
  • Make the code match the printed promise that removals are not auto-applied, or stop printing it: keep the registry's existing entry when its file is not found remotely, unless an explicit flag is passed.
Supporting evidence

Reproduced on origin/main @ 9253e38, Python 3.11, no network access. The Contents API and raw-file fetches are replaced with reads from a local checkout, so the "remote" is exactly the tree on main. Run from 2026/working/polling/scripts/:

python -c "
import json, pathlib
import sync_sprint2 as ss
root = pathlib.Path('../../../..').resolve()
ss.list_directory = lambda path, branch, token: [
    {'type': 'dir' if p.is_dir() else 'file', 'name': p.name} for p in (root / path).iterdir()]
ss.fetch_markdown = lambda path, branch, token: (root / path).read_text(encoding='utf-8')
config = json.loads((root / ss.REGISTRY_REPO_PATH).read_text(encoding='utf-8'))
local_b = ss.load_existing_from_remote('main', None)
known = {e['file']: e['id'] for e in config['track_a']}
local_a, _ = ss.load_candidates_from_remote('main', None, known)
print('existing entries found:', len(local_b))
diff = ss.reconcile(local_b, local_a, config)
print('removed from Track B:', len(diff['removed_b']))
new = ss.build_updated_config(local_b, local_a, config)
print('track_b in rewritten registry:', len(new['track_b']), '(registry had', len(config['track_b']), ')')
"

Output:

existing entries found: 0
removed from Track B: 10
track_b in rewritten registry: 0 (registry had 10 )

For comparison, pointing the same function at 2026/working finds all ten entries (LLM01_PromptInjection.md through LLM10_UnboundedConsumption.md), because parse_first_heading() and humanize_existing_title() already handle those files.

This is independent of #162 (exit codes when API calls fail): here every API call succeeds and the script still produces a wrong registry.

Acknowledgments
  • I checked the published release and the canonical GitHub source for an existing correction.
  • I agree to follow the OWASP Code of Conduct.
Dominant language
JavaScript
Stars
177
Forks
57
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenAI-Security-Project/GenAI-LLM-Top10

All issues in GenAI-Security-Project/GenAI-LLM-Top10

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.