@besales/ops-framework 0.1.0

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 (70) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +328 -0
  3. package/bin/build-check-context.mjs +67 -0
  4. package/bin/build-execution-ledger.mjs +54 -0
  5. package/bin/estimate-llm-input.mjs +160 -0
  6. package/bin/guard-task.mjs +384 -0
  7. package/bin/hash-task-artifacts.mjs +44 -0
  8. package/bin/init-project.mjs +49 -0
  9. package/bin/intake-execution-feedback.mjs +207 -0
  10. package/bin/intake-feedback.test.mjs +73 -0
  11. package/bin/learning-loop.mjs +658 -0
  12. package/bin/learning-loop.test.mjs +175 -0
  13. package/bin/lib/bootstrap-utils.mjs +542 -0
  14. package/bin/lib/bootstrap-utils.test.mjs +156 -0
  15. package/bin/lib/check-context-utils.mjs +1448 -0
  16. package/bin/lib/check-context-utils.test.mjs +497 -0
  17. package/bin/lib/execution-ledger-utils.mjs +162 -0
  18. package/bin/lib/execution-ledger-utils.test.mjs +74 -0
  19. package/bin/lib/llm-input-pack-utils.mjs +663 -0
  20. package/bin/lib/llm-input-pack-utils.test.mjs +262 -0
  21. package/bin/lib/project-config.mjs +229 -0
  22. package/bin/lib/project-config.test.mjs +102 -0
  23. package/bin/lib/task-manifest-utils.mjs +512 -0
  24. package/bin/lib/task-manifest-utils.test.mjs +218 -0
  25. package/bin/lib/task-metrics-utils.mjs +63 -0
  26. package/bin/lib/task-metrics-utils.test.mjs +40 -0
  27. package/bin/lib/test-setup.mjs +37 -0
  28. package/bin/new-task.mjs +42 -0
  29. package/bin/ops-agent.mjs +81 -0
  30. package/bin/preflight.mjs +56 -0
  31. package/bin/providers/external-cli-checker.mjs +190 -0
  32. package/bin/providers/openai-checker.mjs +62 -0
  33. package/bin/quality-gates.mjs +92 -0
  34. package/bin/run-check.mjs +559 -0
  35. package/bin/run-plan-check-loop.mjs +392 -0
  36. package/bin/run-verify.mjs +627 -0
  37. package/bin/self-lint.mjs +88 -0
  38. package/bin/supervisor-turn.mjs +146 -0
  39. package/bin/supervisor-turn.test.mjs +72 -0
  40. package/bin/task-manifest.mjs +57 -0
  41. package/bin/task-metrics.mjs +48 -0
  42. package/bin/transition.mjs +94 -0
  43. package/bin/validate-check-artifacts.mjs +418 -0
  44. package/config/default-agents.json +100 -0
  45. package/package.json +28 -0
  46. package/playbooks/checker-context.md +9 -0
  47. package/playbooks/complexity-performance.md +13 -0
  48. package/playbooks/production-rollout.md +9 -0
  49. package/playbooks/source-sync-provider.md +9 -0
  50. package/playbooks/ui-acceptance.md +9 -0
  51. package/prompts/checker.md +170 -0
  52. package/prompts/executor.md +54 -0
  53. package/prompts/planner.md +128 -0
  54. package/prompts/researcher.md +44 -0
  55. package/prompts/supervisor.md +337 -0
  56. package/prompts/verifier.md +128 -0
  57. package/templates/brief.md +15 -0
  58. package/templates/check-resolution.md +69 -0
  59. package/templates/check-result.json +32 -0
  60. package/templates/check.md +46 -0
  61. package/templates/execution-feedback.md +25 -0
  62. package/templates/execution.md +101 -0
  63. package/templates/human-gate-summary.md +49 -0
  64. package/templates/orchestration-log.md +8 -0
  65. package/templates/plan.md +86 -0
  66. package/templates/research.md +13 -0
  67. package/templates/retrospective.md +48 -0
  68. package/templates/status.md +53 -0
  69. package/templates/verify-result.json +19 -0
  70. package/templates/verify.md +41 -0
@@ -0,0 +1,74 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import {
3
+ mergeChangedFiles,
4
+ parseGitStatusLine,
5
+ } from './execution-ledger-utils.mjs';
6
+
7
+ describe('execution ledger utils', () => {
8
+ it('parses git status lines including untracked and renamed files', () => {
9
+ expect(parseGitStatusLine(' M ops/agent-pipeline/bin/run-verify.mjs')).toEqual({
10
+ status: ' M',
11
+ path: 'ops/agent-pipeline/bin/run-verify.mjs',
12
+ originalPath: null,
13
+ });
14
+ expect(parseGitStatusLine('?? ops/agent-pipeline/tasks/TASK-999-example/')).toEqual({
15
+ status: '??',
16
+ path: 'ops/agent-pipeline/tasks/TASK-999-example/',
17
+ originalPath: null,
18
+ });
19
+ expect(parseGitStatusLine('R old/path.ts -> new/path.ts')).toEqual({
20
+ status: 'R ',
21
+ path: 'new/path.ts',
22
+ originalPath: 'old/path.ts',
23
+ });
24
+ });
25
+
26
+ it('classifies task artifacts, ops framework files and unrelated dirty files', () => {
27
+ const changedFiles = mergeChangedFiles({
28
+ taskRelativePath: 'ops/agent-pipeline/tasks/TASK-999-example',
29
+ statusEntries: [
30
+ { status: ' M', path: 'web/app/src/page.tsx', originalPath: null },
31
+ { status: ' M', path: 'ops/agent-pipeline/bin/run-verify.mjs', originalPath: null },
32
+ { status: ' M', path: 'ops/agent-pipeline/memory/project-context-digest.md', originalPath: null },
33
+ { status: ' M', path: 'ops/agent-pipeline/playbooks/ui-acceptance.md', originalPath: null },
34
+ { status: ' M', path: 'ops/agent-pipeline/tasks/TASK-999-example/execution.md', originalPath: null },
35
+ { status: ' M', path: 'shared-platform/packages/ops-framework/bin/ops-agent.mjs', originalPath: null },
36
+ ],
37
+ unstagedDiff: ['web/app/src/page.tsx', 'ops/agent-pipeline/bin/run-verify.mjs'],
38
+ stagedDiff: [],
39
+ });
40
+
41
+ expect(changedFiles).toEqual([
42
+ expect.objectContaining({
43
+ path: 'ops/agent-pipeline/bin/run-verify.mjs',
44
+ isTaskArtifact: false,
45
+ isOpsFrameworkFile: true,
46
+ }),
47
+ expect.objectContaining({
48
+ path: 'ops/agent-pipeline/memory/project-context-digest.md',
49
+ isTaskArtifact: false,
50
+ isOpsFrameworkFile: false,
51
+ }),
52
+ expect.objectContaining({
53
+ path: 'ops/agent-pipeline/playbooks/ui-acceptance.md',
54
+ isTaskArtifact: false,
55
+ isOpsFrameworkFile: false,
56
+ }),
57
+ expect.objectContaining({
58
+ path: 'ops/agent-pipeline/tasks/TASK-999-example/execution.md',
59
+ isTaskArtifact: true,
60
+ isOpsFrameworkFile: false,
61
+ }),
62
+ expect.objectContaining({
63
+ path: 'shared-platform/packages/ops-framework/bin/ops-agent.mjs',
64
+ isTaskArtifact: false,
65
+ isOpsFrameworkFile: true,
66
+ }),
67
+ expect.objectContaining({
68
+ path: 'web/app/src/page.tsx',
69
+ isTaskArtifact: false,
70
+ isOpsFrameworkFile: false,
71
+ }),
72
+ ]);
73
+ });
74
+ });