Skip to content

Docs: add CONTRIBUTING.md guide, ADRs, E2E sandbox, and onboarding tests - #222

Merged
AbdulmalikAlayande merged 2 commits into
TegoLabs:mainfrom
dunnidev:docs/contributing-guide-and-adrs
Jun 26, 2026
Merged

AbdulmalikAlayande merged 2 commits into
TegoLabs:mainfrom
dunnidev:docs/contributing-guide-and-adrs

Conversation

@dunnidev

Copy link
Copy Markdown
Contributor

Closes #207

@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@dunnidev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Reworked contributing guidance for easier navigation, clearer workflow steps, updated testing commands, improved code conventions, and expanded PR checklist.
    • Added new decision records covering storage, module format, CLI structure, polling behavior, and testing approach.
    • Published a fuller end-to-end sandbox guide with setup, troubleshooting, and verification steps.
  • Tests

    • Added documentation checks to ensure key guides, references, headings, and cross-links stay complete and consistent.

Walkthrough

CONTRIBUTING.md is substantially rewritten with a Table of Contents, updated project structure, expanded code conventions, and an ADR reference table. Six new Architecture Decision Records (ADR-001 through ADR-006) are added under docs/adr/. A new docs/e2e-sandbox.md guide is introduced. A Vitest test suite (tests/docs/onboarding.test.ts) is added to enforce structural completeness and cross-reference integrity across all documentation.

Changes

Contributor Onboarding Documentation and Validation

Layer / File(s) Summary
Six new Architecture Decision Records
docs/adr/ADR-001-use-sqlite-for-local-storage.md, docs/adr/ADR-002-use-esm-modules.md, docs/adr/ADR-003-use-commander-js-for-cli.md, docs/adr/ADR-004-polling-daemon-architecture.md, docs/adr/ADR-005-use-typescript-over-rust.md, docs/adr/ADR-006-in-memory-sqlite-for-testing.md
Adds ADR-001 through ADR-006 covering SQLite local storage, ESM module system, Commander.js CLI framework, polling daemon architecture, TypeScript language choice, and in-memory SQLite for testing. Each ADR contains decision drivers, options comparison table, outcome, consequences, and validation notes.
E2E sandbox guide
docs/e2e-sandbox.md
New guide with three workflow options (local Docker Stellar Quickstart, testnet, and CI-style automated bash script), operational commands, ledger-advance instructions for TTL changes, troubleshooting guidance, and a verification checklist.
CONTRIBUTING.md rewrite and expanded conventions
CONTRIBUTING.md
Rewrites the file with a new intro and full Table of Contents, updated directory tree and core/ vs commands/ architectural rule, refreshed npm test examples, a new linting/type-checking section, ESM import-ordering rules with explicit .js extensions, a typed error-handling code example, an ADR reference table, E2E sandbox pointer, rewritten PR checklist, and removal of older "What we look for in PRs" and "Architecture decisions worth knowing" sections.
Onboarding documentation test suite
tests/docs/onboarding.test.ts
Vitest suite that asserts required files and directories exist, verifies CONTRIBUTING.md section headings and command strings, validates each ADR's structural headings and topic keywords, checks docs/e2e-sandbox.md for required sections and command references, and enforces cross-reference integrity by parsing ADR links and anchor slugs against actual file headers.
Stdout fixture update
stdout
Adds a second monitoring-cycle log block with Unix-style stack trace paths, updated hostname/pid/timestamps, and threshold-crossing, resolution, and error log entries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • AbdulmalikAlayande/sorokeep#7: Directly modifies CONTRIBUTING.md with Sorokeep-specific wording and links, the same file substantially rewritten in this PR.

Poem

🐇 A rabbit once scribbled all day and all night,
Six ADR scrolls and a guide shining bright.
"Contribute!" it said, with a checklist in paw,
"Here's SQLite, ESM, Commander—no flaw!"
The tests check the docs so the links never stray,
And onboarding bunnies hop joyfully today! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main documentation and test additions in the pull request.
Description check ✅ Passed The description is related to the changeset because it references the linked issue this PR closes.
Linked Issues check ✅ Passed The PR adds the contributing guide, ADRs, E2E sandbox docs, and validation tests required by issue #207.
Out of Scope Changes check ✅ Passed The changes appear aligned with the documentation and onboarding goals, with no clear unrelated scope introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 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 `@docs/adr/ADR-006-in-memory-sqlite-for-testing.md`:
- Line 33: Correct the ADR so it matches the actual behavior in
src/db/database.ts: remove the claim that getDatabaseForTesting enables WAL
mode, since the implementation only enables foreign keys and initializes the
schema, and fix the statement about export status because getDatabaseForTesting
is explicitly exported. Update the description in the ADR section that
references getDatabaseForTesting to reflect the real implementation and avoid
contradictory claims.

In `@docs/e2e-sandbox.md`:
- Line 21: The e2e sandbox is pinning two different
stellar/quickstart:soroban-dev image digests in the same workflow, which should
be standardized. Update the references in docs/e2e-sandbox.md so the same pinned
digest is used consistently at both locations, using the existing quickstart
image constant/reference to keep local and scripted setup reproducible.

In `@tests/docs/onboarding.test.ts`:
- Around line 167-173: The ADR completeness test in the onboarding suite is too
permissive because it accepts files with either “### Consequences” or “##
Validation” instead of requiring both. Update the assertion in the test that
iterates over adrFiles so it checks for both sections in each ADR, using the
existing readFile, hasConsequences, and hasValidation logic in the test block.
Keep the test name aligned with the stricter contract and make the expectation
fail unless both required sections are present.
- Around line 285-288: The README-to-CONTRIBUTING test in onboarding.test.ts
only checks for the raw string and can pass even if it is not a real link.
Update the existing “README.md link to CONTRIBUTING.md is valid” test to parse
the README content and assert that the CONTRIBUTING reference is an actual
resolvable Markdown link target, using the existing readFile and path/project
root setup in the test suite. Focus the fix around the README.md assertion logic
so it verifies the link destination rather than simple text presence.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8d7d3221-998b-4521-9afa-1050def9eb16

📥 Commits

Reviewing files that changed from the base of the PR and between c465cc7 and 82b18e1.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • CONTRIBUTING.md
  • docs/adr/ADR-001-use-sqlite-for-local-storage.md
  • docs/adr/ADR-002-use-esm-modules.md
  • docs/adr/ADR-003-use-commander-js-for-cli.md
  • docs/adr/ADR-004-polling-daemon-architecture.md
  • docs/adr/ADR-005-use-typescript-over-rust.md
  • docs/adr/ADR-006-in-memory-sqlite-for-testing.md
  • docs/e2e-sandbox.md
  • stdout
  • tests/docs/onboarding.test.ts
📜 Review details
🧰 Additional context used
🪛 ast-grep (0.44.0)
tests/docs/onboarding.test.ts

[warning] 12-12: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(p, "utf-8")
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename-typescript)

🪛 LanguageTool
docs/adr/ADR-006-in-memory-sqlite-for-testing.md

[style] ~58-~58: Specify a number, remove phrase, use “a few”, or use “some”
Context: ...le cleanup, etc.). These are covered by a small number of integration tests in `tests/utils/confi...

(SMALL_NUMBER_OF)

CONTRIBUTING.md

[style] ~35-~35: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...first. If there's no issue for what you want to do, open one and describe the change be...

(REP_WANT_TO_VB)

🪛 markdownlint-cli2 (0.22.1)
CONTRIBUTING.md

[warning] 70-70: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 OpenGrep (1.23.0)
tests/docs/onboarding.test.ts

[ERROR] 296-296: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 302-302: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)

🔇 Additional comments (5)
stdout (1)

53-78: LGTM!

docs/adr/ADR-001-use-sqlite-for-local-storage.md (1)

1-53: LGTM!

docs/adr/ADR-002-use-esm-modules.md (1)

1-50: LGTM!

docs/adr/ADR-003-use-commander-js-for-cli.md (1)

1-51: LGTM!

CONTRIBUTING.md (1)

5-296: LGTM!


**Chosen option: In-memory SQLite via `getDatabaseForTesting()`**

`getDatabaseForTesting()` opens a `better-sqlite3` connection to `:memory:`, initializes the schema, enables WAL mode, and returns the database handle. Each call produces an independent, empty database.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Fix implementation claims that contradict src/db/database.ts.

Line 33 states WAL mode is enabled, but src/db/database.ts:62-67 only enables foreign keys and initializes schema.
Line 65 states getDatabaseForTesting is not exported from src/db/database.ts, but the function is explicitly exported there.

Also applies to: 65-65

🤖 Prompt for 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.

In `@docs/adr/ADR-006-in-memory-sqlite-for-testing.md` at line 33, Correct the ADR
so it matches the actual behavior in src/db/database.ts: remove the claim that
getDatabaseForTesting enables WAL mode, since the implementation only enables
foreign keys and initializes the schema, and fix the statement about export
status because getDatabaseForTesting is explicitly exported. Update the
description in the ADR section that references getDatabaseForTesting to reflect
the real implementation and avoid contradictory claims.

Comment thread docs/e2e-sandbox.md
docker run --rm -it \
-p 8000:8000 \
--name soroban-local \
stellar/quickstart:soroban-dev@sha256:9f5c75ce2e920a9b9a6e7e8d0b3a2c8f6e9b7c5d4a3b2c1d0e9f8a7b6c5d4e3f \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use one consistent pinned Quickstart image digest.

Line 21 and Line 147 pin different stellar/quickstart:soroban-dev@sha256:... digests for the same workflow. Standardize to a single digest to keep local and scripted setups reproducible.

Also applies to: 147-147

🤖 Prompt for 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.

In `@docs/e2e-sandbox.md` at line 21, The e2e sandbox is pinning two different
stellar/quickstart:soroban-dev image digests in the same workflow, which should
be standardized. Update the references in docs/e2e-sandbox.md so the same pinned
digest is used consistently at both locations, using the existing quickstart
image constant/reference to keep local and scripted setup reproducible.

Comment on lines +167 to +173
it("all ADRs have a consequences section or validation section", () => {
for (const file of adrFiles) {
const content = readFile(path.join(ADR_DIR, file));
const hasConsequences = content.includes("### Consequences");
const hasValidation = content.includes("## Validation");
expect(hasConsequences || hasValidation).toBe(true);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Strengthen ADR completeness assertion to require both sections.

Line 167 currently allows ADRs missing either ### Consequences or ## Validation, which weakens the stated completeness contract.

Suggested fix
-    it("all ADRs have a consequences section or validation section", () => {
+    it("all ADRs have both consequences and validation sections", () => {
         for (const file of adrFiles) {
             const content = readFile(path.join(ADR_DIR, file));
             const hasConsequences = content.includes("### Consequences");
             const hasValidation = content.includes("## Validation");
-            expect(hasConsequences || hasValidation).toBe(true);
+            expect(hasConsequences).toBe(true);
+            expect(hasValidation).toBe(true);
         }
     });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it("all ADRs have a consequences section or validation section", () => {
for (const file of adrFiles) {
const content = readFile(path.join(ADR_DIR, file));
const hasConsequences = content.includes("### Consequences");
const hasValidation = content.includes("## Validation");
expect(hasConsequences || hasValidation).toBe(true);
}
it("all ADRs have both consequences and validation sections", () => {
for (const file of adrFiles) {
const content = readFile(path.join(ADR_DIR, file));
const hasConsequences = content.includes("### Consequences");
const hasValidation = content.includes("## Validation");
expect(hasConsequences).toBe(true);
expect(hasValidation).toBe(true);
}
});
🤖 Prompt for 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.

In `@tests/docs/onboarding.test.ts` around lines 167 - 173, The ADR completeness
test in the onboarding suite is too permissive because it accepts files with
either “### Consequences” or “## Validation” instead of requiring both. Update
the assertion in the test that iterates over adrFiles so it checks for both
sections in each ADR, using the existing readFile, hasConsequences, and
hasValidation logic in the test block. Keep the test name aligned with the
stricter contract and make the expectation fail unless both required sections
are present.

Comment on lines +285 to +288
it("README.md link to CONTRIBUTING.md is valid", () => {
const readme = readFile(path.join(PROJECT_ROOT, "README.md"));
expect(readme).toContain("CONTRIBUTING.md");
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Validate the README→CONTRIBUTING reference as an actual resolvable link.

Line 285 only checks raw text presence, so a broken/non-link mention still passes.

Suggested fix
     it("README.md link to CONTRIBUTING.md is valid", () => {
         const readme = readFile(path.join(PROJECT_ROOT, "README.md"));
-        expect(readme).toContain("CONTRIBUTING.md");
+        const match = readme.match(/\[[^\]]+\]\(([^)]*CONTRIBUTING\.md)\)/i);
+        expect(match).not.toBeNull();
+        if (match) {
+            expect(fileExists(path.join(PROJECT_ROOT, match[1]))).toBe(true);
+        }
     });
🤖 Prompt for 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.

In `@tests/docs/onboarding.test.ts` around lines 285 - 288, The
README-to-CONTRIBUTING test in onboarding.test.ts only checks for the raw string
and can pass even if it is not a real link. Update the existing “README.md link
to CONTRIBUTING.md is valid” test to parse the README content and assert that
the CONTRIBUTING reference is an actual resolvable Markdown link target, using
the existing readFile and path/project root setup in the test suite. Focus the
fix around the README.md assertion logic so it verifies the link destination
rather than simple text presence.

@gitguardian

gitguardian Bot commented Jun 26, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic High Entropy Secret 7efd589 tests/commands/channels.test.ts View secret
- - Generic High Entropy Secret 617e5cd tests/rpc/client.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@AbdulmalikAlayande
AbdulmalikAlayande merged commit 41b256b into TegoLabs:main Jun 26, 2026
2 checks passed
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.

docs: write contributor onboarding and architecture guides

2 participants