fix: reconcile the docs with what trond actually does - #224
Merged
kuny0707 merged 1 commit intoAug 23, 2026
Merged
Conversation
An audit of every tracked doc against the built binary, ahead of the first tag. Three of the gaps were the implementation being wrong, not the prose. Implementation: - `--config` was registered on the root command and advertised in --help as "Config file (default ~/.trond/config.yaml)". Nothing read it — the whole codebase referenced `configFile` exactly twice, the declaration and the registration — so `--config /nonexistent` succeeded silently. There is no config-file feature; the flag is removed rather than left advertising a setting trond does not have. - An unknown `--output` fell through to the text writer. The writers switch on "json" and default to text, so `-o yaml` — which contracts/cli-contract.md listed as supported — returned a human table with exit 0 to a caller that asked for machine-readable output. An agent then parses a table as JSON. Both `--output` and `--log-format` are now validated up front and refused with exit 2, covered by a test. - `network --help` printed `upgrade` twice: `upgradeCmd` was added both in network.go's init and in upgrade.go's, where it sits with the MarkFlagRequired calls that must run alongside it. Dropped the former; `add` already self-registers the same way. - `ExitPartialSuccess = 5` was defined and never used by any command. A multi-node partial result actually exits 1 with `error_code: "PARTIAL_SUCCESS"` (cmd/network/destroy.go), so an agent branching on 5 would wait for a code nothing emits. Constant removed, 5 left unassigned, and AGENTS.md now tells agents to branch on error_code — including that re-running the whole command is usually wrong, since the nodes that succeeded are already in the requested state. Docs: - README never mentioned `recipe`, `schema`, `mcp`, `doctor`, `verify-config` or `shadow-fork` — not "described thinly", zero occurrences. They are the agent-facing half of the CLI, documented in AGENTS.md and never carried across. Two new sections cover them. - README's global-flags table omitted `--require-private` and `--version`. - The Intent Reference's top-level block omitted `monitoring` (a real schema key, shown only in the Commands section), and `nodes[].jar` was the one node field of 29 with no README entry. - CHANGELOG claimed 32 CLI commands; there are 40 top-level plus subcommands, and the group list omitted snapshots, builds, shadow-fork and the agent interfaces entirely. - SECURITY.md still said "0.1.x (alpha)" after tronprotocol#223 settled on v0.1.0, and its private-key section could be read as "keys never touch disk" — the key is inlined into the rendered HOCON at apply time, because that is where java-tron reads localwitness from. Says so now, and notes the audit log follows --state-dir. - contracts/cli-contract.md advertised `--config` and `-o yaml`, both unimplemented, and omitted --state-dir and --require-private. The published private-net key is now labelled as published. It stays — the genesis block in private_net_config.conf is derived from it, so the template cannot produce blocks without it — but nothing said so at any of the four places it appears. The template, AGENTS.md and knowledge/test-harness.md now state that it is public, that a rig using it is unauthenticated, and that it must never be reused on a network carrying value. No secrets were found in the audit: no tokens, no passwords, no SSH keys. The only email is security@tron.network, and the only public IPs are TRON's own mainnet snapshot mirrors, whose cleartext-HTTP posture knowledge/snapshots.md already documents. Verified: make test 25/25; `-o yaml` exits 2 and `-o json` still works; `network --help` lists upgrade once; `output.ExitPartialSuccess` no longer compiles; knowledge/ and internal/knowledge/files/ still byte-identical; every command now appears in README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An audit of every tracked doc against the built binary, ahead of the first tag. Three of the gaps turned out to be the implementation being wrong rather than the prose.
Implementation
--configwas a dead flag. Registered on the root command and advertised in--helpas "Config file (default ~/.trond/config.yaml)", but the whole codebase referencedconfigFileexactly twice — the declaration and the registration:There is no config-file feature, so the flag is removed rather than left advertising a setting trond does not have.
An unknown
--outputfell through to text. The writers switch on"json"and default to text, so-o yaml— whichcontracts/cli-contract.mdlisted as supported — returned a human table with exit 0 to a caller that asked for machine-readable output. An agent then parses a table as JSON.--outputand--log-formatare now validated up front:Covered by
TestValidateFormat.network --helpprintedupgradetwice.upgradeCmdwas added both innetwork.go's init and inupgrade.go's, where it sits with theMarkFlagRequiredcalls that have to run alongside it. Dropped the former;addalready self-registers the same way.Exit code 5 was promised and never emitted.
ExitPartialSuccess = 5was defined and used by no command. A multi-node partial result actually exits 1 witherror_code: "PARTIAL_SUCCESS"(cmd/network/destroy.go:188), so an agent branching on 5 waits for a code nothing sends. The constant is removed, 5 is left unassigned rather than reused, and AGENTS.md now tells agents to branch onerror_code— including that re-running the whole command is usually wrong, because the nodes that succeeded are already in the requested state.Docs
recipe,schema,mcp,doctor,verify-config,shadow-fork. Not "described thinly" — zero occurrences each. They are the agent-facing half of the CLI, documented in AGENTS.md and never carried across. Two new sections cover them.--require-privateand--version.monitoring(a real schema key, shown only under Commands), andnodes[].jarwas the one node field out of 29 with no README entry.0.1.x (alpha)after docs(changelog): make the first release v0.1.0, and fold in the alpha section #223 settled onv0.1.0. Its private-key section could also be read as "keys never touch disk" — the key is inlined into the rendered HOCON at apply time, because that is where java-tron readslocalwitnessfrom. It says so now, and notes the audit log follows--state-dir.contracts/cli-contract.mdadvertised--configand-o yaml, both unimplemented, and omitted--state-dirand--require-private.The published private-net key
private_net_config.confcarries a plaintext witness key (a31d54…acae, addressTM4yToQ1njkcFwi3ADY5x6dbdfNekU3rVi). It stays — the genesis block in that same file is derived from the matching address, so the template cannot produce blocks without it, andknowledge/test-harness.mdalready told readers to use that exact key.What was missing is that nothing, at any of the four places it appears, said it is published. The template, AGENTS.md and
knowledge/test-harness.mdnow state plainly that the key is public, that any rig using it is unauthenticated (anyone reachable can sign as the witness and spend the genesis balance), and that it must never be reused on Mainnet, Nile, or any network carrying value.No secrets found
The audit scanned every tracked file for token patterns, bare 64-hex,
password/secret/api_keyassignments, IPs, emails and internal ticket references.security@tron.network.knowledge/snapshots.md:103already documents.Verification
make test-o yaml/--log-format xml-o jsonnetwork --helpupgrade rowsoutput.ExitPartialSuccessknowledge/vsinternal/knowledge/files/Go files touched:
cmd/root.go,cmd/network/network.go,internal/output/exitcode.go, plus the new test. Localgolangci-lintflags pre-existingSA5011s ininternal/snapshot/snapshot_test.goandinternal/apply/network_create_support_test.go— neither file is touched here; they surface because the local linter is built with Go 1.26.3 while CI pins the analysis toolchain to go1.25.11.Not in this PR
SECURITY.mdpublishes a response SLA (48h acknowledgment, 5 business days to assessment, 30 days to fix for critical issues). That is a commitment to whoever staffssecurity@tron.networkfor this repository — worth confirming it is real before the first release makes it visible.