Skip to content

Wizard: offer defib for a protected NOR chip only where its agent runs - #542

Merged
openipc-ai merged 1 commit into
masterfrom
wizard-defib-only-where-agent
Oct 31, 2026
Merged

openipc-ai merged 1 commit into
masterfrom
wizard-defib-only-where-agent

Conversation

@openipc-ai

Copy link
Copy Markdown
Collaborator

The note under sf lock 0 told every NOR install that defib's flash agent
unlocks the chip over the serial console. defib has an agent for twenty
HiSilicon and Goke chips (_CHIP_TO_AGENT in its agent/client.py), and none
for Novatek, Ingenic, SigmaStar, Fullhan, Anyka or the rest, so an NT98566
owner was sent to a tool that cannot flash their camera (#537).

Those chips now get lock_caveat_programmer_html, the same note ending on the
external programmer alone. A catalogue row for a memory variant
(HI3516CV610-DDR3-128M) counts as its chip.

The golden changes for the 124 SoCs without an agent and no other: their
documents name the new note.

Fixes #537

The note under `sf lock 0` told every NOR install that defib's flash agent
unlocks the chip over the serial console. defib has an agent for twenty
HiSilicon and Goke chips (`_CHIP_TO_AGENT` in its agent/client.py), and none
for Novatek, Ingenic, SigmaStar, Fullhan, Anyka or the rest, so an NT98566
owner was sent to a tool that cannot flash their camera (#537).

Those chips now get lock_caveat_programmer_html, the same note ending on the
external programmer alone. A catalogue row for a memory variant
(HI3516CV610-DDR3-128M) counts as its chip.

The golden changes for the 124 SoCs without an agent and no other: their
documents name the new note.

Fixes #537
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Offer defib only for NOR chips with a supported flash agent

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Stop recommending defib for protected NOR chips its flash agent cannot unlock.
• Retain the defib option for supported chips, including memory variants.
• Add localized programmer-only guidance and tests for the affected wizard documents.
Diagram

graph TD
  Model["SoC model"] --> Selector["sf lock caveat"] --> Agent{"Agent available?"} -- Yes --> Defib["Defib note"] --> Document["Wizard document"]
  Agent -- No --> Programmer["Programmer note"] --> Document
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Store defib support in catalogue metadata
  • ➕ Keeps chip capabilities alongside other SoC data.
  • ➖ Requires catalogue changes across supported rows and still needs synchronization with defib's external agent list.

Recommendation: Keep the narrow allowlist in the wizard for now: it directly represents defib's agent coverage without spreading an external tool's capabilities through catalogue records. Revisit a shared capability source if agent coverage changes frequently.

Files changed (10) +176 / -130

Bug fix (8) +33 / -5
en.ymlAdd English programmer-only flash protection caveat +1/-0

Add English programmer-only flash protection caveat

• Adds a version of the 'sf lock 0' guidance that directs owners of unsupported chips to an external programmer without suggesting defib.

data/locales/en.yml

ru.ymlAdd Russian programmer-only flash protection caveat +1/-0

Add Russian programmer-only flash protection caveat

• Adds the Russian counterpart to the new caveat, retaining the protection warning while removing the defib option.

data/locales/ru.yml

zh.ymlAdd Chinese programmer-only flash protection caveat +1/-0

Add Chinese programmer-only flash protection caveat

• Adds the Chinese counterpart to the new caveat, directing unsupported-chip owners to an external programmer.

data/locales/zh.yml

wizard.en.jsonExpose English programmer-only guidance in the site +1/-0

Expose English programmer-only guidance in the site

• Adds the new English note key to the frontend wizard translations so exported documents can render it.

frontend/apps/site/src/i18n/wizard.en.json

wizard.ru.jsonExpose Russian programmer-only guidance in the site +1/-0

Expose Russian programmer-only guidance in the site

• Adds the corresponding Russian note key to the frontend wizard translations.

frontend/apps/site/src/i18n/wizard.ru.json

wizard.zh.jsonExpose Chinese programmer-only guidance in the site +1/-0

Expose Chinese programmer-only guidance in the site

• Adds the corresponding Chinese note key to the frontend wizard translations.

frontend/apps/site/src/i18n/wizard.zh.json

export.goSelect flashing caveats with camera context +1/-1

Select flashing caveats with camera context

• Passes the camera into caveat selection when exporting command blocks, allowing note keys to depend on the selected SoC.

service/internal/wizard/export.go

lines.goGate defib guidance on flash-agent coverage +26/-4

Gate defib guidance on flash-agent coverage

• Adds an allowlist of defib-supported chips and matches memory variants to their base chip. For 'sf lock' commands on other chips, selects the programmer-only caveat instead of the existing defib caveat.

service/internal/wizard/lines.go

Tests (2) +143 / -125
documents.jsonRefresh affected wizard document hashes +124/-124

Refresh affected wizard document hashes

• Updates golden hashes for the 124 SoC documents whose exported caveat key changes; supported-agent SoC hashes remain unchanged.

service/internal/wizard/testdata/documents.json

wizard_test.goTest agent-dependent lock caveats +19/-1

Test agent-dependent lock caveats

• Checks that representative supported chips and a memory variant receive the defib note, while unsupported chips receive the programmer-only note.

service/internal/wizard/wizard_test.go

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai
openipc-ai merged commit b36c991 into master Oct 31, 2026
4 checks passed
@openipc-ai
openipc-ai deleted the wizard-defib-only-where-agent branch October 31, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

installation manual for NT98566 has link to defib

1 participant