Repository navigation
docs: consolidate contributor and security documentation - #18276
denyspakizh-tob wants to merge 10 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true📝 Walkthrough
Pre-merge checks:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AGENTS.md`:
- Line 29: Update the Nx cache troubleshooting command in AGENTS.md to use the
repository-local binary via yarn nx reset instead of yarn dlx nx reset, matching
the pinned dependency and CI behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ed19f502-b1ba-4119-83ef-59c079530148
📒 Files selected for processing (2)
AGENTS.mdTHREAT_MODEL.md
|
@SippieCup would like to see your thoughts on this as well. I've been in contact with the author already, although I haven't fully reviewed it yet |
|
One thing within this at first glance is that in agents.md it is directing the agents to create pull requests for the tests on potential security issues, rather than keeping it as a private communication with maintainers. We will just end up with PRs containing the exploit that an agent might just automatically put out into the wild when there is a careless operator. I would explicitly state that all pull requests that show or test PoCs should be kept private and privately shared with maintainers through the proper channels, and to never publicly disclose any regression tests or PoC code until the responsible disclosure timeline has past. Secondly, we should set responsible disclosure timeline at 6-12 months. Just due to us being.. rather busy with work. Sometimes things take a bit of time as this is all done in spare time. |
|
Best way to validate agents is with agents as well. So I used a "couple" security models I have access to, to see how they interpret it and what it sees. It caught a few other things that are actually meaningful, Definitely fix all 4 before we merge. 5 is really more of a "this makes context rot" kind of thing, might be good to keep just for when actual people read it, and for explicit guardrails around the model, so I think most of the content should stay personally. see below.
|
|
Oh there is one more thing. this doesnt really tell the model to rebuild between tests. I would explicitly add that to agents.md, as they are very dumb and just try to do the same thing against the same codebase every time. Most agents can't fathom the idea of needing to build for JS tests. |
There was a problem hiding this comment.
Thank you for this — it's a substantial piece of work and the project needs it. I spot-checked around 18 of the technical claims against main (logging defaults, logQueryParameters, connection destruction, replication routing, bind/replacement error behaviour, context-aware bind parsing, sql template escaping, the destroy/update where-guards, the undot.ts guard, CLI config validation, and every build/test command) and found no false statement about Sequelize behaviour. That's unusual and worth saying.
My hesitation isn't accuracy — it's that the document does two different jobs, and only one of them is a docs change.
The descriptive parts — scope, trust labels, invariants, trust boundaries, actor table, entry-point classification, threat scenarios, controls, verification — are exactly what a threat model should be, and I'd like them merged.
The disposition and severity methodology is policy, not documentation. Statements like "Such findings cannot exceed Low severity" and "cap severity at Low" read as binding rules, in a root-level file reporters and triagers will cite. SECURITY.md currently says nothing about severity or disposition, so this would become the project's rating policy by merge rather than by decision — and it would immediately apply to reports already in the pipeline.
That isn't hypothetical — we have already seen cases where this rubric would conflict with how a report was actually assessed, including scenarios this document lists as out of scope. Adopting it as written would mean revisiting those assessments or carving out exceptions on day one.
What we'd like: keep the methodology in this PR, but retitle it so it reads as a heuristic rather than policy — e.g. an appendix headed "Non-normative: heuristics for automated security review". A separate issue will be opened to reflect on it properly and potentially adopt it as policy later. The rubric is reasonable and worth improving; it just shouldn't be citable as the rule while it's unratified.
Two other blocking items and one duplication concern are inline.
One observation that argues for this document: the current process does not clearly separate "not yet assessed" from "assessed and resolved but not yet closed out", which makes the state of any given report hard to read at a glance. A written process is exactly what fixes that, so whatever ships here would ideally include a state model alongside the severity rubric.
Reviewed by Opus 5 with Claude Code, supervised by @WikiRik.
|
Claude didn't include @SippieCup I think, but I have read through that as well and I agree with those remarks. For the private PoC, as I mentioned in Slack I think that's only required for when the library is reponsible. And on disclosure timeline, let's do 6 months. That's long enough |
|
I addressed private handling of security reports and PoCs, the prototype-pollution actor model, Docker test services, rebuild requirements, disposition names, v6 scope, and dependency ownership. The requested |
acc5baf to
a99f21c
Compare
Takes over sequelize#18276 and extends it to the surrounding contributor docs. AGENTS.md becomes the single agent instruction file, replacing .github/copilot-instructions.md, with CLAUDE.md importing it so Claude Code loads the same content in sessions that cannot read AGENTS.md directly. Restructured commands-first and corrected against the tree: the supported Node lines are 22, 24 and 26; sync-exports generates src/index.ts, not src/index.mjs, and @sequelize/core and @sequelize/validator.js have no such script; the default 'drop' reset mode unregisters every model after each test, which breaks a beforeAll2 suite that does not opt out; CI covers oldest and latest for five dialects only. THREAT_MODEL.md keeps its Sequelize-specific content — invariants, non-guarantees, trust boundaries, actors, entry-point rules, threat scenarios, controls and verification — and drops the generic triage methodology. The unratified disposition and severity rubric is gone rather than merely demoted; sequelize#18280 tracks whether to adopt one. OUT-02 and TXN-02 gain the actor lists OUT-01 already received, so a privileged-only actor list no longer invalidates them by construction. SECURITY.md gains an at-a-glance scope section, a normative report lifecycle with exit criteria, closeout requirements, and an explicit statement of when a reporter may publish. Reports and everything demonstrating them stay private, including when an automated tool or agent produces them. The disclosure window is 6 months. CONTRIBUTING.md is corrected against the repository: database versions now point at the compose files rather than restating tags that rot, Oracle is listed everywhere it was missing, and the .mocharc.jsonc path, the yarn setup-* scripts, the anchors, the Node range and the Yarn v1 global install no longer describe things that do not exist. README.md drops the maintainer recruitment block. Co-Authored-By: Claude Opus 5 <[email protected]>
174193f to
3cb6923
Compare
Takes over sequelize#18276 and extends it to the surrounding contributor docs. AGENTS.md becomes the single agent instruction file, replacing .github/copilot-instructions.md, with CLAUDE.md importing it so Claude Code loads the same content in sessions that cannot read AGENTS.md directly. Restructured commands-first and corrected against the tree: the supported Node lines are 22, 24 and 26; sync-exports generates src/index.ts, not src/index.mjs, and @sequelize/core and @sequelize/validator.js have no such script; the default 'drop' reset mode unregisters every model after each test, which breaks a beforeAll2 suite that does not opt out; CI covers oldest and latest for five dialects only. THREAT_MODEL.md keeps its Sequelize-specific content — invariants, non-guarantees, trust boundaries, actors, entry-point rules, threat scenarios, controls and verification — and drops the generic triage methodology. The unratified disposition and severity rubric is gone rather than merely demoted; sequelize#18280 tracks whether to adopt one. OUT-02 and TXN-02 gain the actor lists OUT-01 already received, so a privileged-only actor list no longer invalidates them by construction. SECURITY.md gains an at-a-glance scope section, a normative report lifecycle with exit criteria, closeout requirements, and an explicit statement of when a reporter may publish. Reports and everything demonstrating them stay private, including when an automated tool or agent produces them. The disclosure window is 6 months. CONTRIBUTING.md is corrected against the repository: database versions now point at the compose files rather than restating tags that rot, Oracle is listed everywhere it was missing, and the .mocharc.jsonc path, the yarn setup-* scripts, the anchors, the Node range and the Yarn v1 global install no longer describe things that do not exist. README.md drops the maintainer recruitment block. Co-Authored-By: Claude Opus 5 <[email protected]>
- Move the disposition and severity methodology into a non-normative appendix of THREAT_MODEL.md and link it to sequelize#18280 - Align the v6 wording with SECURITY.md - Add a 6 month disclosure timeline and private PoC handling to SECURITY.md - Merge .github/copilot-instructions.md into AGENTS.md and remove it Co-Authored-By: Claude Fable 5.1 <[email protected]>
Takes over sequelize#18276 and extends it to the surrounding contributor docs. AGENTS.md becomes the single agent instruction file, replacing .github/copilot-instructions.md, with CLAUDE.md importing it so Claude Code loads the same content in sessions that cannot read AGENTS.md directly. Restructured commands-first and corrected against the tree: the supported Node lines are 22, 24 and 26; sync-exports generates src/index.ts, not src/index.mjs, and @sequelize/core and @sequelize/validator.js have no such script; the default 'drop' reset mode unregisters every model after each test, which breaks a beforeAll2 suite that does not opt out; CI covers oldest and latest for five dialects only. THREAT_MODEL.md keeps its Sequelize-specific content — invariants, non-guarantees, trust boundaries, actors, entry-point rules, threat scenarios, controls and verification — and drops the generic triage methodology. The unratified disposition and severity rubric is gone rather than merely demoted; sequelize#18280 tracks whether to adopt one. OUT-02 and TXN-02 gain the actor lists OUT-01 already received, so a privileged-only actor list no longer invalidates them by construction. SECURITY.md gains an at-a-glance scope section, a normative report lifecycle with exit criteria, closeout requirements, and an explicit statement of when a reporter may publish. Reports and everything demonstrating them stay private, including when an automated tool or agent produces them. The disclosure window is 6 months. CONTRIBUTING.md is corrected against the repository: database versions now point at the compose files rather than restating tags that rot, Oracle is listed everywhere it was missing, and the .mocharc.jsonc path, the yarn setup-* scripts, the anchors, the Node range and the Yarn v1 global install no longer describe things that do not exist. README.md drops the maintainer recruitment block. Co-Authored-By: Claude Opus 5 <[email protected]>
Moves the testing conventions out of AGENTS.md into a TESTING.md shared by human and agent contributors, and links it from CONTRIBUTING.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Suites are named Class.staticMethod or Class#instanceMethod, kept flat, and use the sequelize instance without aliasing it. - The destroy reset mode does not reset identity columns, and whether truncate does depends on the dialect. The example relied on the first row getting id 1; it now uses the instance it creates. - Sinon stubs shared through beforeAll2 are restored in after, as sinon.restore() in afterEach would remove them after the first test. - Explain that only yarn test-typings type-checks tests, how to mark intentionally invalid input, and why a missing allowDeprecationsInSuite can pass in the full run but fail alone. - The conversion steps cover typing, hollow assertions and comparing test counts per dialect. AGENTS.md mentions the suite naming, and the CONTRIBUTING.md hint for running a test against every dialect includes oracle. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Dialect-specific tests go in packages/core/test/{unit,integration}/dialects:
colocated dialect package tests have no database or core helpers, and
oracle, db2-ibmi and snowflake have no script that runs them.
- Prefer the destroy reset mode: truncate fails on referenced tables on
dialects that can neither cascade nor disable foreign key checks. Rows
are deleted after every test, so don't seed them in beforeAll2.
- The Chai plugins are registered by core's support file only.
- Error expectations only compare messages, and an empty one matches
anything.
- Server-version checks may use this.skip() in a regular-function before
hook.
- expectPerDialect accepts async functions (sequelize#18569).
- Smaller corrections to the Sinon, helper and expectsql descriptions,
and to the conversion checklist.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
0890038 to
1dbee95
Compare
Pull Request Checklist
Description of Changes
Opened by @denyspakizh-tob adding
AGENTS.mdandTHREAT_MODEL.md. We have taken it over to finish the outstanding review feedback rather than keep passing comments back and forth. The original three commits are preserved with their authorship; the branch has been rebased onto currentmain.The scope has grown beyond the two new files. Working through the review showed that most of the remaining problems were contradictions between the new documents and the contributor documentation already in the repository, so fixing them in isolation was not possible.
AGENTS.md+CLAUDE.mdAGENTS.mdbecomes the only agent instruction file..github/copilot-instructions.mdis removed and everything still accurate from it is merged in, since Copilot readsAGENTS.mdnow and two files would drift.CLAUDE.mdcontains a single@AGENTS.mdimport, which covers the sessions where Claude Code cannot readAGENTS.mddirectly.It has been restructured commands-first and checked line by line against the repository. Several claims were wrong and are corrected, including the supported Node versions, the direction in which
sync-exportsgenerates files, the CI dialect coverage, and the uniformity of the per-dialect package layout. It also now documents the default test reset mode, which unregisters every model after each test and otherwise silently breaks any suite using thebeforeAll2idiom the file itself teaches.THREAT_MODEL.mdReduced from 296 to 159 lines. The Sequelize-specific content is kept in full — the security contract with its invariants and explicit non-guarantees, trust boundaries, actors, entry-point rules, threat scenarios, required controls and verification. The generic vulnerability-triage methodology is removed, per @SippieCup's review.
One honest caveat on that: the "roughly 200 of 297 lines are generic methodology" estimate does not hold up when measured. Those lines are short, and the tables that are unambiguously worth keeping are single lines of over a thousand characters each. The threat-scenario table alone is a third of the document by volume. The cut is real but it is about 25% by size, not 80%.
The unratified disposition and severity rubric has been removed rather than demoted to a non-normative appendix. #18280 tracks whether the project wants such a rubric at all; it is no longer something that could be cited from a merged file in the meantime. The two rules from that section that were genuinely Sequelize-specific rather than generic — what a finding must state, and that the absence of a documented resource control is not grounds for dismissal — are kept as §9.
The threat scenarios previously listed only a privileged actor for
OUT-02andTXN-02, which meant a reviewer following the document would dismiss them by construction. Both now carry the same actor listOUT-01was given.As before, the document states required behaviour and is explicit that it is not an assertion that every requirement is currently satisfied.
SECURITY.mdGains a scope section that can be read at a glance, and a report lifecycle: what states a report moves through, what each one means, and what has to be true for it to leave. The gap this closes is that nothing previously distinguished a report nobody had looked at from one that was fixed but not closed out, which made any open advisory unreadable from the outside.
It also states that reports and everything demonstrating them stay private — explicitly including when an automated tool or agent produced them — when a reporter may publish, and that the disclosure window is six months.
CONTRIBUTING.mdandREADME.mdCorrected against the repository. The database versions named in prose had drifted by as much as a major release, so they now point at the compose files instead. Oracle was missing everywhere it should have appeared. The instructions referenced a
.mocharc.jsoncthat no longer exists inpackages/core,yarn setup-*scripts that never existed, a Yarn v1 global install, and two broken anchors.README.mddrops the maintainer recruitment block.TESTING.mdNew. It describes how tests should be written: where they live, naming and style, the support helpers, database reset modes, dialect differences, SQL generation tests, and how to convert a legacy
.jstest.AGENTS.mdandCONTRIBUTING.mdpoint to it instead of repeating it.It has been checked against the repository and against the conversion of
test/unit/instance,test/unit/modelandtest/unit/sqlto TypeScript (#18563, #18564, #18565):Class.staticMethodorClass#instanceMethod, kept flat, and usesequelizewithout aliasing it. This follows the review of meta(core): convert unit/instance tests to TypeScript #18563.destroydoes not reset identity columns, and whethertruncatedoes depends on the dialect. The worked example relied on the first row getting id1, which breaks once a suite has a second test. It now uses the instance it creates. I ran the example, with a second test added, against sqlite3.beforeAll2are restored inafter, sincesinon.restore()inafterEachwould remove them after the first test.yarn test-typings),@ts-expect-errorfor intentionally invalid input, and why a missingallowDeprecationsInSuitecan pass in the full run but fail when the file runs alone.Still to do
Keeping this as a draft.
THREAT_MODEL.mdstill needs a read-through in its condensed form, and a few security-policy questions are open.List of Breaking Changes
None. Documentation only.