onecrawl 4.0.0-alpha.55 → 4.0.0-alpha.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,27 +5,55 @@ description: "Structured decision process between Non-Breaking and Breaking path
5
5
  # Breaking Change Decision Skill
6
6
 
7
7
  ## Purpose
8
- Run a structured, future-proof decision process between Non-Breaking and Breaking paths without relaxing quality gates.
8
+ Run a structured, future-proof decision process when a task may affect public contracts, APIs, schemas, or behavioral compatibility.
9
9
 
10
10
  ## Use when
11
11
  - A task may affect public contracts, APIs, schemas, or behavioral compatibility
12
- - Root-cause fixes suggest architectural reshaping
13
-
14
- ## Checklist
15
- - Explicitly classify impact: Non-Breaking vs Breaking.
16
- - Present both paths with:
17
- - pros/cons
18
- - risk level
19
- - migration steps
20
- - State explicitly: quality gates are unchanged for both paths.
21
- - Require green unit/integration/E2E/non-regression tests in both cases.
22
- - If Breaking is selected, include migration and compatibility notes before execution.
23
-
24
- ## Short examples
25
- - Non-Breaking path: adapter layer preserving old contract while introducing new internals.
26
- - Breaking path: remove deprecated endpoint + provide migration map + test updates.
12
+ - A root-cause fix implies architectural reshaping
13
+ - The user explicitly asks for breaking/non-breaking analysis
14
+
15
+ ## OneCrawl Contract Surfaces
16
+
17
+ | Surface | Breaking Impact | Examples |
18
+ |---------|----------------|----------|
19
+ | **CLI flags/args** | HIGH | Renaming `--headless` → `--head`, removing `--native` |
20
+ | **MCP tool names/schemas** | HIGH | Renaming tool actions, changing JSON schemas |
21
+ | **NAPI/PyO3 method signatures** | HIGH | Changing function names, param types, return types |
22
+ | **Config keys** | MEDIUM | Renaming `config.toml` keys, changing defaults |
23
+ | **Session file format** | MEDIUM | Changing `/tmp/onecrawl-session-*.json` structure |
24
+ | **Daemon protocol** | MEDIUM | Changing HTTP/WS API between CLI and daemon |
25
+ | **Internal crate APIs** | LOW | Changing `pub` functions in workspace crates |
26
+ | **CDP layer** | LOW | Internal CDP wrapper changes |
27
+
28
+ ## Decision Framework
29
+
30
+ ### Non-Breaking Path
31
+ - Add new flags/options alongside existing ones
32
+ - Deprecation warnings before removal (minimum 2 alpha releases)
33
+ - Backward-compatible config: new keys get defaults, old keys still work
34
+ - Additive MCP actions (new actions, not renamed ones)
35
+
36
+ ### Breaking Path (requires justification)
37
+ - Must document: what breaks, who is affected, migration steps
38
+ - Must provide: migration guide or automated migration tool
39
+ - Must bump: version increment that signals the break
40
+ - Quality gates unchanged: unit/integration/E2E/non-regression must still pass
41
+
42
+ ## Procedure
43
+ 1. Identify all contract surfaces affected.
44
+ 2. For each, classify as non-breaking or breaking.
45
+ 3. Present options via `ask_user` with the compatibility triad:
46
+ - Non-Breaking Path (additive/compatible)
47
+ - Breaking Path (with migration plan)
48
+ - Alternative Structural Path (redesign to avoid the break)
49
+ 4. Document decision in commit message and CHANGELOG.
50
+
51
+ ## Done Criteria
52
+ - Decision documented with rationale.
53
+ - Migration steps provided for any breaking change.
54
+ - All quality gates pass.
27
55
 
28
56
  ## Anti-patterns
29
- - Assuming breaking path without explicit selection
30
- - Treating breaking changes as exempt from test gates
31
- - Missing migration guidance
57
+ - Silent breaking changes (no documentation)
58
+ - Breaking changes without version bump
59
+ - Assuming internal changes are safe (NAPI/PyO3 are public)
@@ -19,9 +19,30 @@ Enforce a mandatory quality gate for every Issue, Milestone, and PR with zero-er
19
19
  4. Required tests pass (unit, integration if applicable, E2E if applicable, non-regression).
20
20
  5. Full suite passes; coverage is not below baseline.
21
21
 
22
+ ## OneCrawl Gate Commands
23
+
24
+ Run these in order. Both must pass **twice consecutively** with zero output:
25
+
26
+ ```bash
27
+ # 1. Clippy (lint + static analysis) - 0 warnings required
28
+ cargo clippy --workspace --exclude onecrawl-e2e --exclude onecrawl-python -- -W clippy::all
29
+
30
+ # 2. Build check (fast compilation verification)
31
+ cargo check --workspace
32
+
33
+ # 3. Test suite (all tests, single-threaded for determinism)
34
+ cargo test --workspace --exclude onecrawl-e2e --exclude onecrawl-python -- --test-threads=1
35
+
36
+ # 4. Health check (binary runs correctly)
37
+ ./target/release/onecrawl health
38
+ ./target/release/onecrawl --version
39
+ ```
40
+
41
+ Acceptable warnings: `onecrawl-browser` vendor crate (1 warning, do not touch).
42
+
22
43
  ## Procedure
23
- 1. Run full review/check suite.
24
- 2. If any error/warning exists, fix and restart from step 1.
44
+ 1. Run all gate commands above.
45
+ 2. If any error/warning exists in owned crates, fix and restart from step 1.
25
46
  3. Repeat until two clean consecutive passes are recorded.
26
47
  4. Only then mark status `done`/merge.
27
48
 
@@ -32,4 +53,5 @@ Enforce a mandatory quality gate for every Issue, Milestone, and PR with zero-er
32
53
  ## Anti-patterns
33
54
  - Single-pass approval
34
55
  - Ignoring warnings
35
- - Deferring known issues to later
56
+ - Deferring known issues to "later"
57
+ - Excluding tests with `#[ignore]` to pass the gate
@@ -5,26 +5,49 @@ description: "Deterministic, CI-ready end-to-end validation for critical user fl
5
5
  # E2E Testing Skill
6
6
 
7
7
  ## Purpose
8
- Define deterministic, CI-ready end-to-end validation for critical user flows.
8
+ Ensure critical user flows work end-to-end with deterministic, CI-compatible execution.
9
9
 
10
10
  ## Use when
11
- - A user-facing flow changes
12
- - A critical integration path is introduced or modified
13
- - Regression risk is non-trivial
11
+ - A user-facing flow changes or a critical integration path is introduced/modified
12
+
13
+ ## OneCrawl E2E Architecture
14
+
15
+ E2E tests live in `packages/onecrawl-rust/crates/onecrawl-e2e/` and require a running Chrome instance.
16
+
17
+ ```bash
18
+ # Run E2E tests (requires Chrome)
19
+ cargo test -p onecrawl-e2e -- --test-threads=1
20
+
21
+ # Manual E2E verification (quick smoke test)
22
+ onecrawl session start -H # Headless Chrome
23
+ onecrawl navigate https://example.com # Navigate
24
+ onecrawl get title # Verify page loaded
25
+ onecrawl screenshot --full # Visual verification
26
+ onecrawl session close # Cleanup
27
+ ```
28
+
29
+ ## Critical Flows to Test
30
+ 1. **Session lifecycle**: start → navigate → interact → close
31
+ 2. **Daemon mode**: daemon start → session start → exec → daemon stop
32
+ 3. **Multi-agent isolation**: session start -s a1 → session start -s a2 → verify isolation
33
+ 4. **Profile management**: profile create → session start --profile → profile delete
34
+ 5. **Config management**: config set → config show → verify change persists
35
+ 6. **Auth persistence**: auth-state save → session close → session start → auth-state load
36
+ 7. **Stealth**: session start → stealth detection-audit → verify 0% headless detection
14
37
 
15
38
  ## Checklist
16
- - Cover at least one E2E scenario per critical flow.
17
- - Include happy path + key error/edge cases.
18
- - Use programmatic execution only (CI-compatible, non-interactive).
19
- - Prefer stable selectors (for example, `data-testid`).
20
- - Keep tests deterministic and isolated with proper setup/teardown.
21
- - Ensure E2E is part of non-regression validation before completion.
39
+ - [ ] Happy path covered for each critical flow
40
+ - [ ] Edge cases: invalid input, missing Chrome, concurrent sessions
41
+ - [ ] Cleanup: sessions closed, temp files removed, profiles deleted
42
+ - [ ] Deterministic: no timing-dependent assertions
43
+ - [ ] Stable selectors: use `data-testid` or semantic selectors
44
+ - [ ] CI-compatible: headless mode, no GUI dependencies
22
45
 
23
- ## Short examples
24
- - Checkout flow: payment success + payment failure retry path.
25
- - Auth flow: valid login + expired token refresh path.
46
+ ## Done Criteria
47
+ - All critical flows pass in headless mode.
48
+ - No leaked browser processes after test completion.
26
49
 
27
50
  ## Anti-patterns
28
- - Manual-only E2E verification
29
- - Flaky timing-based waits without stable signals
30
- - Skipping E2E updates after flow changes
51
+ - Hard-coded sleep/timeouts instead of wait-for conditions
52
+ - Tests that depend on network state
53
+ - Shared mutable state between test cases
@@ -5,35 +5,49 @@ description: "Keep local plan and GitHub project artifacts perfectly aligned wit
5
5
  # GitHub Sync Skill
6
6
 
7
7
  ## Purpose
8
- Keep local plan and GitHub project artifacts perfectly aligned (milestones, issues, labels, statuses, dependencies).
8
+ Keep local plan and GitHub project artifacts perfectly aligned.
9
9
 
10
10
  ## Use when
11
- - Creating/updating plan
11
+ - Creating or updating a plan
12
12
  - Changing issue status
13
13
  - Completing milestones
14
14
 
15
+ ## OneCrawl Repository
16
+ - Owner: `giulio-leone`
17
+ - Repo: `onecrawl`
18
+ - Branch: `main`
19
+ - Tags: `v4.0.0-alpha.XX`
20
+
15
21
  ## Naming Rules
16
- - Milestone: `M<id> <description>`
17
- - Issue: `[M<milestone_id>] I<issue_id> <task>`
22
+ - Milestones: `MX: <Title>` (e.g., `M14: Deep Audit`)
23
+ - Issues: `<type>: <description>` (e.g., `fix: session name path traversal`)
24
+ - Branches: `<type>/<short-description>` (e.g., `fix/session-path-traversal`)
25
+ - Tags: `v4.0.0-alpha.XX` (SemVer pre-release)
18
26
 
19
- ## Required Metadata
20
- - Priority label: `P-critical|P-high|P-medium|P-low`
21
- - Type label: `feat|fix|refactor|chore|test`
22
- - Status label: `in-progress|review|blocked`
23
- - Milestone link
24
- - Dependency note: `depends on #<issue_number>`
25
- - Parent/child note: `part of #<issue_number>`
27
+ ## Required Labels
28
+ - Priority: `P0-critical`, `P1-high`, `P2-medium`, `P3-low`
29
+ - Type: `bug`, `feature`, `refactor`, `docs`, `chore`
30
+ - Status: `todo`, `in-progress`, `review`, `done`, `blocked`
26
31
 
27
32
  ## Procedure
28
- 1. On plan create/update, create/update corresponding GitHub milestones/issues.
29
- 2. On local issue status change, sync GitHub status + labels immediately.
30
- 3. Close milestone when all linked issues are done.
31
- 4. Ensure no orphan issues (every issue belongs to a milestone).
33
+ 1. Create GitHub milestone matching local plan milestone.
34
+ 2. Create issues for each task, linked to milestone.
35
+ 3. Apply labels (priority + type + status).
36
+ 4. Update issue status as work progresses.
37
+ 5. Close milestone when all issues are done.
38
+
39
+ ## OneCrawl Release Sync
40
+ After each alpha release:
41
+ 1. Tag: `git tag v4.0.0-alpha.XX && git push origin main --tags`
42
+ 2. npm: `npm publish --tag alpha --access public`
43
+ 3. CHANGELOG: update with release notes
32
44
 
33
45
  ## Done Criteria
34
- - Local plan == GitHub state (titles, labels, status, dependencies).
46
+ - All plan items have matching GitHub artifacts.
47
+ - Labels are applied consistently.
48
+ - Milestones reflect actual progress.
35
49
 
36
50
  ## Anti-patterns
37
- - Local-only tracking
38
- - Orphan issues
39
- - Stale labels/status
51
+ - Local plan diverges from GitHub state
52
+ - Missing labels on issues
53
+ - Stale milestones with no issues
@@ -354,6 +354,9 @@ daemon exec goto url=https://example.com --session linkedin
354
354
  daemon exec evaluate expression="1+1" --session work
355
355
  daemon status # Daemon health + session list
356
356
  daemon stop # Stop daemon
357
+ session start --auto-connect # Attach to existing Chrome with CDP
358
+ session start --profile work # Launch with named profile
359
+ session start -s my-agent # Named session for multi-agent
357
360
  ```
358
361
 
359
362
  ### 26. Agent Automation
@@ -366,6 +369,38 @@ agent chain "<js actions>" # Execute pre-written action sequences
366
369
  agent observe # Get annotated page state with coordinates
367
370
  ```
368
371
 
372
+ ### 27. Profile Management
373
+ ```bash
374
+ profile list # List all named profiles with size/date
375
+ profile create <name> # Create isolated Chrome user-data-dir
376
+ profile delete <name> # Remove a named profile
377
+ profile info <name> # Show profile details (cookies, logins, prefs)
378
+ profile gc # Remove profiles not accessed in 30 days
379
+ profile gc --days 7 # Custom age threshold
380
+ ```
381
+
382
+ ### 28. Config CLI
383
+ ```bash
384
+ config show # Display all config values (formatted)
385
+ config show --raw # Output raw TOML
386
+ config set <key> <value> # Modify a config value
387
+ config path # Print config file path
388
+ config init # Reset to defaults (creates .bak backup)
389
+ ```
390
+
391
+ ### 29. Tab Management
392
+ ```bash
393
+ tab list # Human-readable tab list with active marker (◀)
394
+ tab find <query> # Search tabs by URL or title (case-insensitive)
395
+ tab activate <id> # Switch to tab by ID
396
+ tab close <id> # Close tab by ID
397
+ ```
398
+
399
+ ### 30. Health Check
400
+ ```bash
401
+ health # Enhanced: daemon + sessions + config + profiles
402
+ ```
403
+
369
404
  ## Anti-Patterns (Don't Do This)
370
405
 
371
406
  | ❌ Bad (eval) | ✅ Good (primitive) |
@@ -396,13 +431,20 @@ daemon = true # daemon mode by default
396
431
  daemon_headless = true
397
432
  session_name = "default"
398
433
  session_auto_isolate = true # auto-unique session names per agent
434
+ auto_connect = false # auto-discover running Chrome with CDP
399
435
  persist_cookies = "" # auto-persist path, empty = disabled
400
436
  chrome_profile = "" # empty = auto (~/.onecrawl/chrome-profile/)
401
437
  user_agent = "" # empty = auto
402
438
  daemon_idle_timeout = 1800 # 30 minutes
403
439
  daemon_max_sessions = 8
440
+ daemon_shutdown_grace_secs = 5
441
+ daemon_max_log_mb = 50
442
+ daemon_ws_proxy_port = 0 # 0 = disabled
443
+ daemon_event_buffer = 1000
404
444
  daemon_pool_size = 0 # pre-warmed sessions (0 = disabled)
405
445
  daemon_rate_limit = 0 # per-second (0 = unlimited)
446
+ lightpanda_host = "127.0.0.1"
447
+ lightpanda_port = 9222
406
448
  ```
407
449
 
408
450
  CLI flags always override config values.
@@ -2,7 +2,7 @@
2
2
  name: planning-tracking
3
3
  description: "Execution plan with milestone/issue hierarchy, explicit dependencies, and safe parallelism."
4
4
  ---
5
- # Planning & Tracking Skill
5
+ # Planning and Tracking Skill
6
6
 
7
7
  ## Purpose
8
8
  Create and maintain an execution plan with milestone/issue hierarchy, explicit dependencies, and safe parallelism.
@@ -19,13 +19,36 @@ interface Milestone { id: string; description: string; priority: "critical"|"hig
19
19
  interface Issue { id: string; task: string; priority: "critical"|"high"|"medium"|"low"; status: "todo"|"in_progress"|"review"|"done"|"blocked"; depends_on: string[]; children: Record<string, Issue>; }
20
20
  ```
21
21
 
22
+ ## OneCrawl Workspace Parallelism Rules
23
+
24
+ Safe to parallelize:
25
+ - Changes in different crates (e.g., `onecrawl-cdp` + `onecrawl-parser`)
26
+ - NAPI + PyO3 bindings (independent build targets)
27
+ - Documentation + code changes
28
+
29
+ NOT safe to parallelize:
30
+ - Changes in a crate + its dependents (e.g., `onecrawl-cdp` + `onecrawl-cli-rs`)
31
+ - Multiple changes to the same file
32
+ - Version bumps (must be sequential: Cargo.toml then package.json)
33
+
34
+ ## OneCrawl Crate Dependency Graph
35
+ ```
36
+ onecrawl-cli-rs
37
+ -> onecrawl-mcp-rs -> onecrawl-cdp -> onecrawl-browser
38
+ -> onecrawl-server -> onecrawl-cdp
39
+ -> onecrawl-core
40
+ -> onecrawl-crypto
41
+ -> onecrawl-parser
42
+ -> onecrawl-storage
43
+ ```
44
+
22
45
  ## Procedure
23
46
  1. Build plan before implementation.
24
47
  2. Assign unique IDs to milestones/issues.
25
- 3. Declare dependencies for every issue (`depends_on`).
26
- 4. Execute by dependency order, then priority (`critical` `high` `medium` `low`).
48
+ 3. Declare dependencies for every issue.
49
+ 4. Execute by dependency order, then priority (critical then high then medium then low).
27
50
  5. Run independent same-priority milestones in parallel when safe.
28
- 6. Update statuses continuously and append concise progress summaries.
51
+ 6. Update statuses continuously.
29
52
 
30
53
  ## Done Criteria
31
54
  - Plan exists, is up-to-date, and reflects actual execution state.
@@ -8,22 +8,45 @@ description: "Detect and remove contradictions across agent policies before exec
8
8
  Detect and remove contradictions across agent policies before execution.
9
9
 
10
10
  ## Use when
11
- - Updating `AGENTS.MD`
11
+ - Updating AGENTS.md or runtime adapters
12
12
  - Merging new workflow rules
13
13
  - Noticing behavioral ambiguity during execution
14
14
 
15
- ## Checklist
16
- - Language coherence: English-only wording.
17
- - Interaction coherence: one question + 5-option model is consistently respected.
18
- - Gate coherence: completion gates apply to both Non-Breaking and Breaking paths.
19
- - Scope coherence: avoid wording that causes uncontrolled scope creep.
20
- - Reference coherence: every mentioned skill path exists.
15
+ ## OneCrawl Policy Files
21
16
 
22
- ## Short examples
23
- - Fix mixed language term: "TASSATIVO" -> "MANDATORY".
24
- - Fix model mismatch: "propose one option" -> explicit 5-option decision set.
17
+ | File | Purpose |
18
+ |------|---------|
19
+ | `AGENTS.md` | Root dispatcher, skill catalog |
20
+ | `AGENTS.vscode.MD` | VS Code runtime adapter |
21
+ | `AGENTS.copilot-cli.MD` | Copilot CLI runtime adapter |
22
+ | `.github/copilot-instructions.md` | Build, test, architecture reference |
23
+ | `.github/skills/*/SKILL.md` | 14 operational skills |
24
+
25
+ ## Audit Checklist
26
+
27
+ 1. Language: Are all policies in English?
28
+ 2. Interaction model: Is ask_user (CLI) vs vscode_askQuestions (VS Code) correctly bound?
29
+ 3. Freeform invariant: Is option 4 always Freeform in all 5-option prompts?
30
+ 4. Completion gates: Do all skills reference the same gate procedure?
31
+ 5. Scope: Are skills non-overlapping? No duplicate procedures?
32
+ 6. Skill references: Do AGENTS.md catalog entries match actual SKILL.md files?
33
+ 7. Tool names: Are MCP tool references correct (onecrawl run, not chrome-devtools)?
34
+ 8. Build commands: Are cargo/npm commands consistent across all skills?
35
+ 9. Version: Are version references up-to-date?
36
+ 10. Stop condition: Is "I am satisfied" the only stop phrase in all loop references?
37
+
38
+ ## Procedure
39
+ 1. Read all policy files listed above.
40
+ 2. Run each checklist item.
41
+ 3. Document any contradictions found.
42
+ 4. Fix contradictions (update the owning file).
43
+ 5. Verify fix does not introduce new contradictions.
44
+
45
+ ## Done Criteria
46
+ - All checklist items pass.
47
+ - No contradictions between any two policy files.
25
48
 
26
49
  ## Anti-patterns
27
- - Leaving ambiguous precedence between structural and surgical strategies
28
- - Contradictory clauses in different sections
29
- - Referencing non-existent skill files
50
+ - Duplicating procedures across skills and AGENTS files
51
+ - Mixing tool names across runtimes
52
+ - Updating one file without checking cross-references
@@ -2,35 +2,54 @@
2
2
  name: rollback-rca
3
3
  description: "Stop ineffective iteration loops and choose a controlled recovery path after repeated gate failures."
4
4
  ---
5
- # Rollback & RCA Skill
5
+ # Rollback and RCA Skill
6
6
 
7
7
  ## Purpose
8
- Stop ineffective iteration loops and choose a controlled recovery path after repeated gate failures.
8
+ Stop ineffective iteration loops after repeated completion gate failures and choose a controlled recovery path.
9
9
 
10
10
  ## Use when
11
- - An issue fails completion gate 3 consecutive times
12
-
13
- ## Procedure
14
- 1. Stop work on the issue immediately.
15
- 2. Run root cause analysis:
16
- - Architecture mismatch?
17
- - Dependency/environment problem?
18
- - Scope too broad?
19
- 3. Present options via `ask_user`:
20
- - Rescope (split into smaller sub-issues)
21
- - Rollback (revert to last known good commit)
22
- - Redesign (change architecture)
23
- 4. Execute selected path and document rationale in session log.
24
-
25
- ## Rollback Rules
26
- - Keep history clean and revertible.
27
- - Roll back only to the last commit that passed gate.
28
- - Record rollback cause and follow-up plan.
11
+ - An issue fails the completion gate 3 consecutive times
12
+
13
+ ## OneCrawl Common Failure Modes
14
+
15
+ | Failure | Root Cause | Recovery |
16
+ |---------|-----------|----------|
17
+ | Clippy warnings persist | Vendor crate or structural pattern | Add targeted allow with justification |
18
+ | Test timeout | Browser not running or port conflict | Check daemon status |
19
+ | Linker error PyO3 | PyO3 test mode linker conflict | Exclude onecrawl-python from test runs |
20
+ | CDP connection refused | Daemon crashed or wrong port | Restart daemon |
21
+ | Memory growth in tests | Unbounded Vec or HashMap | Cap with VecDeque |
22
+ | Send compile error | rand rng across await | Scope RNG in sync block before await |
23
+
24
+ ## RCA Procedure
25
+ 1. Reproduce: Run the exact failing command and capture full output.
26
+ 2. Classify: Is it architecture, dependency, scope, or environment?
27
+ 3. Analyze:
28
+ - Architecture: Does the fix require structural changes across crates?
29
+ - Dependency: Is a third-party crate causing the issue?
30
+ - Scope: Was the original issue too broadly defined?
31
+ - Environment: Is it platform or toolchain specific?
32
+
33
+ ## Recovery Options (present via ask_user)
34
+ 1. Rescope: Break the issue into smaller, independently-completable pieces.
35
+ 2. Rollback: git stash or git checkout to last known-good state, then retry with different approach.
36
+ 3. Redesign: Rethink the approach, maybe the breaking change path is needed.
37
+
38
+ ## OneCrawl Rollback Commands
39
+
40
+ ```bash
41
+ git stash push -m "rollback: issue-id"
42
+ git checkout v4.0.0-alpha.XX
43
+ cargo check --workspace
44
+ cargo test --workspace --exclude onecrawl-e2e --exclude onecrawl-python -- --test-threads=1
45
+ ```
29
46
 
30
47
  ## Done Criteria
31
- - Issue has an approved recovery path and documented rationale.
48
+ - Root cause identified and documented.
49
+ - Recovery option selected and executed.
50
+ - Gate passes after recovery.
32
51
 
33
52
  ## Anti-patterns
34
- - Blindly retrying same failing strategy
35
- - Silent rollback without traceability
36
- - Continuing without user alignment
53
+ - Continuing to iterate without analyzing root cause
54
+ - Ignoring test failures to move forward
55
+ - Rolling back without understanding what went wrong
@@ -8,32 +8,62 @@ description: "Accurate, auditable execution journal for each working session."
8
8
  Maintain an accurate, auditable execution journal for each working session.
9
9
 
10
10
  ## Use when
11
- - Starting/ending a session
12
- - Completing issues/milestones
11
+ - Starting or ending a session
12
+ - Completing issues or milestones
13
13
  - Syncing GitHub status
14
14
 
15
- ## Required File
16
- `sessions-<ISO-date>.md`
15
+ ## OneCrawl Session Template
17
16
 
18
- ## Required Sections
19
- - Status (milestone states)
20
- - Work Completed (`[mX/iY]` references)
21
- - Completion Gate Passed (include ✅ and consecutive-pass evidence)
22
- - Decisions Made
23
- - Blockers
24
- - GitHub Sync (created/closed/updated issue IDs)
25
- - Branch
26
- - Date (ISO timestamp)
17
+ ```markdown
18
+ # Session: YYYY-MM-DD
27
19
 
28
- ## Procedure
29
- 1. Create/update the session file at session start and after meaningful milestones.
30
- 2. Keep entries factual and aligned with plan/GitHub state.
31
- 3. Record gate-pass evidence per completed issue.
20
+ ## Status
21
+ - Branch: main
22
+ - Version: v4.0.0-alpha.XX
23
+ - Mode: Autonomous / Interactive
24
+
25
+ ## Work Completed
26
+ - [ ] Issue/feature description
27
+ - [ ] Tests added/updated
28
+
29
+ ## Completion Gate Evidence
30
+ - Clippy: 0 warnings (1 vendor)
31
+ - Tests: XX passed, 0 failed
32
+ - Build: cargo check clean
33
+
34
+ ## Decisions
35
+ - Decision 1: rationale
36
+
37
+ ## Blockers
38
+ - None / description
39
+
40
+ ## GitHub Sync
41
+ - Commits pushed: X
42
+ - Tags: vX.X.X-alpha.XX
43
+ - npm: published vX.X.X-alpha.XX
44
+
45
+ ## OneCrawl Health
46
+ - CLI: vX.X.X-alpha.XX
47
+ - Binary: XXM
48
+ - Daemon: running/stopped
49
+ - Sessions: X active
50
+ ```
51
+
52
+ ## OneCrawl Version Bump Checklist
53
+ 1. Update version in `packages/onecrawl-rust/Cargo.toml`
54
+ 2. `cargo check --workspace` (propagates to all crates)
55
+ 3. Commit with `chore: bump version to vX.X.X-alpha.XX`
56
+ 4. `git tag vX.X.X-alpha.XX`
57
+ 5. `git push origin main --tags`
58
+ 6. Update `packages/onecrawl/package.json` version
59
+ 7. `node scripts/sync-assets.js`
60
+ 8. `npm publish --tag alpha --access public`
32
61
 
33
62
  ## Done Criteria
34
- - Session file reflects real progress and traceable references.
63
+ - Session journal file exists with all required sections.
64
+ - All status fields are accurate.
35
65
 
36
66
  ## Anti-patterns
37
- - Retroactive guesswork
38
- - Missing gate evidence
39
- - Inconsistent milestone/issue IDs
67
+ - Missing completion gate evidence
68
+ - Undocumented decisions
69
+ - Stale version numbers
@@ -47,10 +47,10 @@ Replace blind trial-and-error debugging with a structured, evidence-based proces
47
47
  - Terminal: `node app.js 2>&1 | tee debug-data.log`
48
48
  - Test runner: `npm test 2>&1 | tee debug-data.log`
49
49
  - Browser: copy console output into `debug-data.log`
50
- 3. If using MCP tools, also collect:
51
- - `chrome-devtools` `list_console_messages` → append to `debug-data.log`
52
- - `chrome-devtools` `list_network_requests` → append failed/relevant requests
53
- - `next-devtools` `nextjs_call("get_errors")` → append runtime errors
50
+ 3. If using OneCrawl MCP tools, also collect:
51
+ - `onecrawl run browser get_console_messages` → append to `debug-data.log`
52
+ - `onecrawl har drain` → append failed/relevant requests
53
+ - `onecrawl health` → append daemon/session state
54
54
 
55
55
  ### Step 5 — Analyze
56
56
  1. Read `debug-data.log` and correlate with hypotheses.
@@ -73,20 +73,22 @@ Replace blind trial-and-error debugging with a structured, evidence-based proces
73
73
 
74
74
  ## MCP Tool Integration
75
75
 
76
- When available, prefer MCP tools over manual instrumentation:
76
+ When available, prefer OneCrawl MCP tools over manual instrumentation:
77
77
 
78
78
  | Tool | Use for |
79
79
  |------|---------|
80
- | `chrome-devtools` `list_console_messages` | Capture browser console output |
81
- | `chrome-devtools` `evaluate_script` | Test hypotheses live in browser context |
82
- | `chrome-devtools` `list_network_requests` | Debug API/network failures |
83
- | `chrome-devtools` `get_network_request` | Inspect specific request/response bodies |
84
- | `chrome-devtools` `take_screenshot` | Visual/layout bug evidence |
85
- | `chrome-devtools` `take_memory_snapshot` | Memory leak investigation |
86
- | `next-devtools` `nextjs_call("get_errors")` | Next.js runtime error collection |
87
- | `lighthouse` performance audits | Performance regression debugging |
88
- | Terminal `run_command` | Execute tests, capture output |
89
- | File system `grep_search` | Trace error messages to source code |
80
+ | `onecrawl run browser get_console_messages` | Capture browser console output |
81
+ | `onecrawl eval "<expression>"` | Test hypotheses live in browser context |
82
+ | `onecrawl run browser get_network_log` | Debug API/network failures |
83
+ | `onecrawl har drain` | Inspect request/response bodies |
84
+ | `onecrawl screenshot` | Visual/layout bug evidence |
85
+ | `onecrawl stealth detection-audit` | Verify stealth patches are working |
86
+ | `onecrawl health` | Check CLI/daemon/session state |
87
+ | `onecrawl config show` | Verify configuration values |
88
+ | `onecrawl page-watcher drain` | Monitor DOM changes |
89
+ | `onecrawl network-log drain` | Live network traffic |
90
+ | `cargo test -p <crate> -- test_name` | Run specific failing test |
91
+ | `RUST_LOG=debug cargo test` | Verbose test output |
90
92
 
91
93
  ## Escalation
92
94
  If after **2 instrumentation → analysis cycles** the root cause is still unclear:
@@ -17,21 +17,55 @@ Guarantee deterministic, CI-ready quality verification with no regressions and n
17
17
  - E2E tests (user-facing/critical flows, when applicable)
18
18
  - Non-regression checks (previously passing tests must remain green)
19
19
 
20
+ ## OneCrawl Test Commands
21
+
22
+ ```bash
23
+ # Full test suite (excludes E2E and PyO3 — known linker issue in test mode)
24
+ cargo test --workspace --exclude onecrawl-e2e --exclude onecrawl-python -- --test-threads=1
25
+
26
+ # Single crate (fast iteration)
27
+ cargo test -p onecrawl-cli-rs -- --test-threads=1
28
+ cargo test -p onecrawl-cdp -- --test-threads=1
29
+ cargo test -p onecrawl-mcp-rs -- --test-threads=1
30
+
31
+ # Run specific test
32
+ cargo test -p onecrawl-cli-rs -- test_name --test-threads=1
33
+
34
+ # Clippy as static analysis layer
35
+ cargo clippy --workspace --exclude onecrawl-e2e --exclude onecrawl-python -- -W clippy::all
36
+ ```
37
+
38
+ ## Workspace Crate Map
39
+
40
+ | Crate | Tests | Scope |
41
+ |-------|-------|-------|
42
+ | `onecrawl-cli-rs` | Unit | CLI dispatch, config, parsing |
43
+ | `onecrawl-cdp` | Unit | CDP protocol, stealth, JS evaluation |
44
+ | `onecrawl-mcp-rs` | Unit | MCP server, tool dispatch |
45
+ | `onecrawl-core` | Unit | Shared types, utilities |
46
+ | `onecrawl-crypto` | Unit | Encryption, TOTP, PKCE |
47
+ | `onecrawl-parser` | Unit + Doc | HTML parsing, accessibility tree |
48
+ | `onecrawl-storage` | Unit | KV storage, encrypted store |
49
+ | `onecrawl-server` | Unit | HTTP API server |
50
+ | `onecrawl-e2e` | E2E | **Excluded** — requires running Chrome |
51
+ | `onecrawl-python` | Unit | **Excluded** — PyO3 linker issue |
52
+
20
53
  ## Procedure
21
- 1. **Before changes**: run full suite and record baseline (totals + line/branch coverage).
54
+ 1. **Before changes**: run full suite and record baseline.
22
55
  2. Implement changes and add/update tests.
23
- 3. **After changes**: rerun full suite and produce diff (added/removed/broken tests + coverage delta).
24
- 4. If any previously passing test breaks or coverage drops, fix before completion.
56
+ 3. **After changes**: rerun full suite and verify no regressions.
57
+ 4. If any previously passing test breaks, fix before completion.
25
58
  5. Ensure tests are deterministic, isolated, non-interactive, and CI-compatible.
26
59
 
27
- ## E2E Notes
28
- - Cover happy path + key edge/error cases for each critical flow.
29
- - Prefer stable selectors (`data-testid`) over fragile CSS/DOM coupling.
60
+ ## Key Rules
61
+ - Use `--test-threads=1` some tests share browser state.
62
+ - Never use `#[ignore]` to skip failing tests.
63
+ - VecDeque: use `.back()` not `.last()`, `.iter().skip(n)` not `[n..]`.
30
64
 
31
65
  ## Done Criteria
32
- - Full suite green, no regressions, coverage >= baseline.
66
+ - Full suite green, no regressions.
33
67
 
34
68
  ## Anti-patterns
35
69
  - Manual-only validation
36
70
  - Flaky timeout-driven E2E
37
- - Merging with coverage regression
71
+ - Merging with failing tests
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onecrawl",
3
- "version": "4.0.0-alpha.55",
3
+ "version": "4.0.0-alpha.57",
4
4
  "description": "Browser automation engine — CLI, MCP server, and agent skills installer",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Giulio Leone <giulio@onecrawl.dev>",