docs(contributing): make first-contribution cost visible and smaller - #5086
Open
huangruiteng wants to merge 1 commit into
Open
huangruiteng wants to merge 1 commit into
huangruiteng wants to merge 1 commit into
Conversation
- state the Node.js >= 22.22.3 runtime in pyproject metadata and in the CONTRIBUTING prerequisites, with npm ci as a one-time setup step - collapse the missing-npm-dependency failures into one named remedy: the TypeScript semantic scan detects a missing typescript package or node binary, and pytest prints one loopx setup line at the end - map all 14 workflows to trigger, merge blocking and purpose; only Sign-off and merge-gate block a merge - define when a change needs an RFC and how a compact RFC is sized - add a Code Map convention for capability READMEs, starting with decision_context, guarded so a map cannot go stale - guard Node minimum consistency across README, CONTRIBUTING, pyproject, install guide, entrypoint, package.json and workflow pins Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
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.
Why
The core LoopX contracts are worth their cost. But a first contribution pays several costs that are not written down anywhere, or are larger than they need to be:
pyproject.tomlsaysdependencies = []and "lightweight", yet everyloopxcommand and the test suite need a system Node.js 22.22.3+.CONTRIBUTING.mdnever mentioned Node.js ornpm ci.npm ci, 91 of 777 architecture tests fail. Each one prints its own traceback, and the remedy is buried inside them. Ifnodeis not on PATH at all, the scanner crashes with an uncaughtFileNotFoundError.decision_contextis 17 modules, about 6.5K lines. No README maps modules to steps.This PR does not remove any of the rigor. It makes these costs visible up front and, where possible, smaller.
What changes
Node.js is visible before install
pyproject.toml: the description drops "lightweight" and states "(requires Node.js 22.22.3+)". A comment next todependencies = []explains that pip cannot install the Node.js runtime.CONTRIBUTING.md: a new Prerequisites and one-time setup section covers Python 3.11+ viauv, Node.js 22.22.3+ (24 LTS recommended), andnpm ci --ignore-scriptsas a once-per-worktree step.A missing
npm ciproduces one message, not 91loopx/semantics/production.py:nodeis on PATH before running the scan;ERR_MODULE_NOT_FOUNDfortypescriptand raises one named error,NPM_DEV_DEPENDENCIES_MISSING. The parser's stderr is still never echoed.tests/conftest.py: when thetypescriptpackage cannot be resolved, pytest prints a header line. After the final totals line it prints:90 failure(s) share one cause: repository npm dev dependencies are not installed (the typescript package is missing); run npm ci --ignore-scripts once from the repository root.The remaining failure, the retrodiction baseline, is an indirect consequence and passes once
npm cihas run. With dependencies installed, the architecture suite passes (777).Which CI checks matter
CONTRIBUTING.mdgains What CI runs on a pull request:Sign-offandmerge-gateblock a merge, per themainruleset;merge-gateaggregates;When a change needs an RFC
docs/architecture/rfcs/README.mdgains When a change needs an RFC:Not applicable: <reason>and adds appendices only once they have content. The mirror keeps the same compact shape.TEMPLATE.mdor the bilingual-mirror policy itself.Capability code maps
loopx/capabilities/README.mddefines an optional## Code Mapconvention.decision_contextgets the first one, in the English README and the zh-CN mirror. It has one row per module, in pipeline order, plus an add an observable field route that lists which files to touch for a per-source fact, a decision-level field, a capture-only fact, the CLI, docs, and tests.Guards so this does not drift
tests/test_contributing_guide.pychecks three things:Node.js X.Y.Zin the README (en/zh), CONTRIBUTING, pyproject, the install guide, and the entrypoint equalsMINIMUM_NODE_VERSION;package.jsonengines is>=that version; exact workflow pins equal it;.github/workflows;merge-gatedependency.tests/test_capability_code_maps.pyrequires any code map to list exactly the package's modules, and the Chinese map to name the same set.tests/architecture/test_semantic_production.pycovers both new scanner diagnostics (Node missing,typescriptmissing) and checks that stderr does not leak into them.Interaction with open PRs
decision_context/freshness.py. Whichever PR lands second adds one Code Map row, which the new guard will point out.TEMPLATE.mdand other hunks of the RFCREADME.md. This PR only inserts one new subsection after the opening paragraph, with no overlapping lines.Not in this PR
Splitting large modules, merging workflows, and relaxing the bilingual mirror policy for small RFCs are larger structural or policy decisions for maintainers.
Validation
test_delegation_result_use[file] and [sqlite], also fail on the unmodified merge base.tests/architecturein a fresh worktree withoutnode_modules: 91 failed, with a singleloopx setupremedy line at the end. Afternpm ci --ignore-scripts: 777 passed.ruffon the touched Python files,mypy: clean.examples/docs-governance-smoke.py,examples/semantic-vocabulary-drift-smoke.py,examples/decision-context-contract-smoke.py: ok.loopx check --scan-pathon every touched file: errors=0.git diff --check: clean.