@doist/doistbot-cli 1.0.8 → 1.0.10

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.
Files changed (40) hide show
  1. package/dist/actions/auth.js +6 -4
  2. package/dist/actions/review.js +1 -0
  3. package/dist/auth.js +67 -35
  4. package/dist/config.js +6 -3
  5. package/dist/input.js +11 -11
  6. package/dist/terminal.js +1 -0
  7. package/package.json +5 -4
  8. package/sandbox/_node_modules/doistbot-repo-config/dist/index.d.ts +1 -1
  9. package/sandbox/_node_modules/doistbot-repo-config/dist/index.js +1 -1
  10. package/sandbox/dist/core/datadog-metrics.js +2 -0
  11. package/sandbox/dist/core/pi.js +13 -3
  12. package/sandbox/dist/core/shared.js +9 -9
  13. package/sandbox/dist/core/span-test-helpers.js +13 -0
  14. package/sandbox/dist/core/tracing.js +1 -1
  15. package/sandbox/dist/main.js +3 -0
  16. package/sandbox/dist/providers/index.js +1 -0
  17. package/sandbox/dist/tasks/issue-summarize/model.js +4 -4
  18. package/sandbox/dist/tasks/issue-triage/autofix-capabilities.js +22 -0
  19. package/sandbox/dist/tasks/issue-triage/fix-attempt.js +6 -0
  20. package/sandbox/dist/tasks/issue-triage/routing.js +124 -15
  21. package/sandbox/dist/tasks/issue-triage/triage.js +2 -0
  22. package/sandbox/dist/tasks/review/engines/multi-focus.js +23 -15
  23. package/sandbox/dist/tasks/review/engines/shared.js +2 -0
  24. package/sandbox/dist/tasks/review/multi-focus-prompt.js +2 -0
  25. package/sandbox/dist/tasks/review/review-summary.js +2 -2
  26. package/sandbox/dist/tasks/review/review.js +5 -3
  27. package/sandbox/dist/tasks/review/summary-model.js +5 -4
  28. package/sandbox/dist/tasks/review/thinking-level.js +2 -0
  29. package/sandbox/dist/tasks/review-slice-plan/context.js +69 -0
  30. package/sandbox/dist/tasks/review-slice-plan/plan.js +209 -0
  31. package/sandbox/dist/tasks/review-slice-plan/prompt.js +59 -0
  32. package/sandbox/dist/tasks/review-slice-plan/review-slice-plan.js +470 -0
  33. package/sandbox/node_modules/doistbot-repo-config/dist/index.d.ts +1 -1
  34. package/sandbox/node_modules/doistbot-repo-config/dist/index.js +1 -1
  35. package/sandbox/src/tasks/review/prompts/review-focus-prompts/efficiency.md +10 -12
  36. package/sandbox/src/tasks/review/prompts/review-focus-prompts/general.md +24 -7
  37. package/sandbox/src/tasks/review/prompts/review-focus-prompts/quality.md +14 -22
  38. package/sandbox/src/tasks/review/prompts/review-focus-prompts/reuse.md +13 -0
  39. package/sandbox/src/tasks/review/prompts/review-focus-prompts/security.md +18 -0
  40. package/sandbox/src/tasks/review/prompts/review-focus-prompts/tests.md +12 -22
@@ -1,28 +1,20 @@
1
1
  ## Review Focus: Quality
2
2
 
3
- For this pass, focus only on design quality, architecture, type safety, missed reuse, duplicated logic, and consistency with established patterns.
3
+ For this pass, focus only on quality issues introduced by the diff.
4
4
 
5
- Flag findings when:
5
+ Review the changes for potential quality issues, such as:
6
6
 
7
- - logic lives in the wrong layer or breaks an existing abstraction boundary
8
- - the diff introduces redundant state, brittle APIs, or stringly-typed code
9
- - the change deviates from surrounding patterns or documented guidance in a way that creates ongoing maintenance cost
10
- - a concrete type-safety or design issue should be fixed even if the code “works”
11
- - the diff reinvents a helper, utility, abstraction, or repeated block that already exists nearby
12
- - state duplicates existing state, cached values could be derived, or observers/effects could be direct calls
13
- - the diff adds new parameters to a function instead of generalizing or restructuring existing ones
14
- - near-duplicate code blocks are copied with slight variation and should be unified with a shared abstraction
15
- - internal details are exposed that should be encapsulated, or existing abstraction boundaries are broken
16
- - raw strings are used where constants, enums (string unions), or branded types already exist in the codebase
17
- - the diff adds wrappers or abstractions without clear reuse value instead of using a simple, direct solution
18
- - ternary chains, deeply nested if/else blocks, or nested switches obscure distinct cases, duplicate branches, or make error/edge paths easy to miss
19
- - broad try/catch blocks, fallback/null guard/logging paths, or safe wrappers are added without a real trust boundary or documented failure mode
20
- - logging-and-continue patterns hide errors where explicit failures or predictable failure modes would be better
21
- - errors are checked against message strings instead of codes or stable identifiers
22
- - broad any/type-ignore casts, sleeps/timeouts, fake success returns, removed checks, or path mutation hide a real failure
23
-
24
- Only report a design-quality finding when the maintenance cost is concrete: name the abstraction boundary, existing pattern, type contract, caller impact, helper, module, or repeated changed block that makes the change costly. Do not turn a naming, formatting, or preference nit into a [P1] or [P2].
25
-
26
- Do not repeat generic correctness bugs already covered by the general pass unless the design concern is distinct.
7
+ 1. Redundant state: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls.
8
+ 2. Parameter sprawl: adding new parameters to a function instead of generalizing or restructuring existing ones.
9
+ 3. Copy-paste with slight variation: near-duplicate code blocks that should be unified with a shared abstraction.
10
+ 4. Layering and leaky abstractions: logic that lives in the wrong layer, exposes internal details that should be encapsulated, or breaks existing abstraction boundaries.
11
+ 5. Stringly-typed code: using raw strings where constants, enums (string unions), or branded types already exist in the codebase.
12
+ 6. Simplicity/YAGNI: prefer simple, direct solutions over wrappers, abstractions, configuration, options, extensibility, or scaffolding without clear reuse value or explicit need. Prefer deletion or direct code until the second use appears.
13
+ 7. Shrinkage: flag code that preserves behavior with fewer branches, lines, moving parts, or custom helpers. Do not shrink away input validation at trust boundaries, data-loss error handling, security measures, or accessibility basics.
14
+ 8. Nested conditionals: ternary chains, deeply nested if/else blocks, or nested switches should be simplified when they obscure distinct cases, duplicate branches, or make error/edge paths easy to miss.
15
+ 9. Over-defensive code: broad try/catch blocks, fallback/null guard/logging paths, or safe wrappers that are not tied to a real trust boundary or documented failure mode.
16
+ 10. Fail-fast: favor explicit failures over logging-and-continue patterns that hide errors. Prefer predictable failure modes over silent degradation.
17
+ 11. Error classification: ensure errors are checked against codes or stable identifiers, never error message strings.
18
+ 12. Band-aid code: broad any/type-ignore casts, sleeps/timeouts, fake success returns, removed checks, or path mutation that hides a real failure.
27
19
 
28
20
  If the diff does not introduce any findings for this focus, return an empty comments array.
@@ -0,0 +1,13 @@
1
+ ## Review Focus: Reuse
2
+
3
+ For this pass, focus only on reuse issues introduced by the diff.
4
+
5
+ Review the changes for potential reuse issues, such as:
6
+
7
+ 1. Search for existing capabilities that could replace newly written code: standard library APIs, native platform features, already-installed dependencies, and existing utilities/helpers. Search for relevant names and behavior, then go beyond string matches by inspecting adjacent files, utility files and directories, and shared modules.
8
+ 2. Flag any new function that duplicates existing functionality. Suggest the existing function, API, or feature to use instead.
9
+ 3. Flag any inline logic that could use an existing capability — hand-rolled standard-library behavior, string manipulation, manual path handling, custom environment checks, ad-hoc type guards, native platform features, and similar patterns are common candidates.
10
+ 4. Flag new dependencies when the standard library, runtime/platform, or an already-installed dependency provides the same capability or behavior.
11
+ 5. Flag duplicate modules, thin pass-through wrappers, and manual registries when they duplicate an existing source of truth or local pattern. Prefer deleting, consolidating, or reusing the existing path.
12
+
13
+ If the diff does not introduce any findings for this focus, return an empty comments array.
@@ -0,0 +1,18 @@
1
+ ## Review Focus: Security
2
+
3
+ For this pass, focus only on security issues introduced by the diff.
4
+
5
+ Review the changes for potential security issues, such as:
6
+
7
+ 1. Auth and permissions: changed routes, commands, jobs, or data access must preserve required authentication, authorization, tenant isolation, and ownership checks.
8
+ 2. Untrusted input: SQL or command construction must be parameterized; path, URL, shell, and HTML output must be escaped or encoded for the target context.
9
+ 3. Filesystem and process boundaries: user-controlled paths and process arguments must not allow traversal, arbitrary file access, command injection, or unsafe environment changes.
10
+ 4. Server-side fetches: server requests to user-controlled URLs must block localhost, private/link-local IP ranges, cloud metadata endpoints, and internal hostnames, including after DNS resolution and redirects.
11
+ 5. Redirects and navigation: user-controlled destinations must be same-origin relative paths or explicitly allowlisted origins.
12
+ 6. Secrets: new logging, errors, telemetry, files, or API responses must not expose tokens, keys, credentials, cookies, or sensitive identifiers.
13
+ 7. Serialization and parsing: avoid unsafe deserialization, dynamic code execution, prototype pollution, XML external entities, YAML custom object construction, and parser modes that load external resources.
14
+ 8. Dependencies: newly added dependencies that touch input parsing, networking, auth, crypto, secrets, or code execution need an explicit security reason.
15
+
16
+ Only flag issues with a concrete exploit path or trust-boundary failure introduced by the reviewed changes.
17
+
18
+ If the diff does not introduce any findings for this focus, return an empty comments array.
@@ -2,27 +2,17 @@
2
2
 
3
3
  For this pass, focus only on test quality and test-design issues introduced by the diff.
4
4
 
5
- Flag findings when:
6
-
7
- - the new tests are disproportionately complex for the behavior being covered
8
- - the tests rely on unnecessary mocking or deep implementation knowledge
9
- - the change duplicates existing coverage instead of extending nearby tests
10
- - the highest-value, practically testable scenario introduced by the diff is still untested
11
- - the tests are brittle in a way that will create avoidable maintenance cost
12
-
13
- Only report a missing-test finding when all of the following are true:
14
-
15
- - you can name the specific behavior or regression path introduced by this PR
16
- - the behavior is important enough that a regression would create real user, data, integration, or maintenance risk
17
- - there is an existing, practical test path nearby: same module, adjacent tests, established fixture, or test harness already used for similar behavior
18
- - the requested test would be reasonably scoped and would not require setting up a new test framework, major harness, large fixture system, or unrelated infrastructure first
19
-
20
- Do not ask for tests solely because code changed. Avoid missing-test findings for CI scripts, one-off developer tooling, thin wrappers, mechanical config changes, or helper utilities unless the diff introduces meaningful branching, parsing, persistence, security-sensitive behavior, or another high-risk path with an existing practical test seam.
21
-
22
- If a change is worth testing but the module is not currently testable without significant setup work, do not file a blocking test finding. You may mention the testability gap only when it is the core design issue introduced by the diff.
23
-
24
- Do not ask for broad "more coverage" or tests for behavior that is already covered by adjacent tests.
25
-
26
- Do not report production-code issues here unless they are directly tied to a test-quality problem.
5
+ Review the changes for potential testing issues, such as:
6
+
7
+ 1. High-signal suite: favor a smaller test suite over exhaustive coverage. Treat tests as carrying maintenance cost. Each test should protect important behavior, a realistic failure mode, or a stable shared contract.
8
+ 2. Low-value coverage: flag tests added only to cover implementation trivia. Examples include trivial getters/wrappers/constants, exact internal formatting, incidental telemetry/log details or events, timer internals, framework wiring with no behavior of its own, synthetic edge cases with no realistic breakage story, or behavior already covered by a higher-value test.
9
+ 3. Test bloat: redundant cases, copy-paste matrices, excessive or repeated setup that should use or extract a fixture/helper, gratuitous snapshots, or unparameterized variations that increase maintenance cost without clear regression signal. Suggest consolidation or deletion in these cases.
10
+ 4. Missing coverage: important behavior that can break without a test failing. Only ask for new tests when you can name the public/user-visible contract, security/privacy boundary, data-loss risk, serialization/wire contract, state transition, permission check, concurrency issue, or prior regression being protected.
11
+ 5. Weak assertions: tests that do not check observable behavior or invariants.
12
+ 6. Implementation-coupled tests: tests that assert private details, internal calls, or branch structure instead of behavior. Logs are worth testing only when logging itself is required behavior.
13
+ 7. Over-mocking: mocks that erase the behavior under test, hide integration behavior, or only prove mocks were called/configured. Prefer real fixtures or recorded external-service interactions when local practice supports them.
14
+ 8. Flaky patterns: time, random data, network calls, ordering, concurrency, or shared state that is not controlled by fixtures, clocks, cleanup, or deterministic assertions.
15
+
16
+ Do not ask for tests just because code changed. Only flag a missing test when you can name the important behavior or failure mode that could break. Only flag test removal/simplification when the remaining suite still protects the important intended behavior.
27
17
 
28
18
  If the diff does not introduce any findings for this focus, return an empty comments array.