@ctrl-spc/cs 0.7.3 → 0.7.5

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.
@@ -130,6 +130,7 @@
130
130
  * how to write it travels with `write_report`'s own description, where ux.md
131
131
  * says the how belongs.
132
132
  */
133
+ import { FIREWALL_WRITING_RULE } from '../firewall.js';
133
134
  /**
134
135
  * ═══ WHAT EVERY LEVEL IS TOLD ABOUT THE THING IT SENDS BACK. ═══
135
136
  *
@@ -429,9 +430,12 @@ const projectCodebases = (codebases) => {
429
430
  * — which matters because the daemon writes it to `panel3_runs.brief`.
430
431
  *
431
432
  * ═══ `cardTitle` IS A NAME, NOT THE QUESTION, AND ITS LABEL SAYS SO. ═══ `say`
432
- * fixes it once, as the truncated first line of the FIRST message, and never
433
- * changes it. Labelled as what is being asked, a second turn would tell the
434
- * agent the current question is a stale half-sentence and then hand it the real
433
+ * writes it as the truncated first line of the FIRST message, and the launcher
434
+ * may replace it once, with `dispatch`'s `work_name`, so that it names the work
435
+ * rather than that sentence. Either way it names the CONVERSATION and not what
436
+ * is currently being asked: it is written before the first answer and nothing
437
+ * touches it after. Labelled as what is being asked, a second turn would tell
438
+ * the agent the current question is the opening line and then hand it the real
435
439
  * ones underneath — so the label names the conversation, which is all the title
436
440
  * has ever been.
437
441
  *
@@ -494,6 +498,18 @@ export function levelOnePrompt(cardTitle, messages, produced, attachments = [],
494
498
  '',
495
499
  'WHAT THIS CONVERSATION IS CALLED',
496
500
  cardTitle,
501
+ /* ═══ THE ONE MOMENT ANYTHING CAN NAME THE WORK. ═══ Until the owner is
502
+ sent, this is the truncated first line of the person's first message, and
503
+ sending the owner cuts the branch for the work from it and stamps that
504
+ branch for good. The launcher is the only thing that runs in between, and
505
+ it has the messages in front of it, so it is the only thing that can say
506
+ what the work is before both are fixed. */
507
+ 'This is the first line of what they typed, so it names their sentence rather than the work. If',
508
+ 'the person pointed this conversation at a work item, that item is already its name and there is',
509
+ 'nothing to do. Otherwise pass `work_name` to `dispatch`: a few words, six at most, naming the',
510
+ 'work itself, such as "Fix the sign-out checklist bug". The conversation is called that from',
511
+ 'then on, and the branch the work goes on is cut from it, both as you send the owner. This is',
512
+ 'the only moment either can be named.',
497
513
  '',
498
514
  'WHAT HAS ALREADY BEEN MADE HERE',
499
515
  'Everything this conversation has produced so far, whatever it was that made it, with the id to',
@@ -648,6 +664,22 @@ export function workBrief(level, responsibility, boundary, workItemId, attachmen
648
664
  'first stage only, and do not start the next stage until the one before it has come',
649
665
  'back. When you send somebody for a stage, put that stage\'s own document into what you',
650
666
  'give them, in full: they cannot read the workflow themselves.',
667
+ /* ═══ 38-panel3-steps: THE STAGES LAND ON THE WORK ITEM, WHERE THE
668
+ PERSON WATCHES. ═══ Without these sentences a panel run follows a
669
+ workflow and the work item's Steps section stays empty: nothing
670
+ starts the workflow on the item and nothing writes a step. The
671
+ owner starts it once, hands each worker the work item, and reads
672
+ the record before sending the next stage, because "the stage is
673
+ finished" is what `up_next` moving on means and nothing else
674
+ enforces the order. */
675
+ 'Before you send anybody for the first stage, call `start_workflow` with the workflow and',
676
+ 'the work item, once: it puts the stages on the work item, where the person watches. Pass',
677
+ '`work_item_id` when you send somebody for a stage. When somebody comes back, call',
678
+ '`list_steps` before you send the next stage. If `up_next` still names the stage you sent',
679
+ 'them for, that stage is not finished: send somebody back for what is left, or ask the',
680
+ 'person. Send the next stage only when `up_next` has moved on. A stage you work yourself',
681
+ 'gets the same record: `list_steps`, then `create_step` for each unit of work, then',
682
+ '`update_step` as you go.',
651
683
  ]
652
684
  : []),
653
685
  'What you have already sent somebody to do is written down, and you are handed that list',
@@ -669,6 +701,25 @@ export function workBrief(level, responsibility, boundary, workItemId, attachmen
669
701
  '',
670
702
  'Somebody else may be working in this same copy of the codebase at the same time as you, on',
671
703
  'a different piece. Stay inside what you were given and leave the rest of it alone.',
704
+ /* ═══ 38-panel3-steps: A WORKER'S STAGE IS WRITTEN DOWN AS STEPS. ═══
705
+ Printed only when a workflow is on the card, like the owner's clause
706
+ above. The wording is the one v2's `start_workflow` reminder already
707
+ uses, which a walked agent follows: decompose before working, tick as
708
+ you go, only done moves the record on. It names no sequencing rule,
709
+ because a worker sends nobody. */
710
+ ...(hasWorkflow
711
+ ? [
712
+ '',
713
+ 'THIS WORK FOLLOWS A WORKFLOW, AND ITS STEPS ARE WRITTEN DOWN WHERE THE PERSON WATCHES.',
714
+ 'Your stage is the first unfinished one on the work item: call `list_steps` with the work',
715
+ 'item id and read `up_next`. Before you do the stage\'s work, record its steps with',
716
+ '`create_step`, one per unit of work, in order. Then `update_step` each to `in_progress`',
717
+ 'when you pick it up and `done` when it is finished; only done lets the next one start. If',
718
+ 'you cannot go on without an answer, `update_step` the step you are on to `blocked` with a',
719
+ '`next_action` saying what you need, then `escalate`, then stop. Never create a second step',
720
+ 'to report on the first.',
721
+ ]
722
+ : []),
672
723
  ]),
673
724
  '',
674
725
  'WHAT YOU OWN',
@@ -727,6 +778,9 @@ export function workBrief(level, responsibility, boundary, workItemId, attachmen
727
778
  'not what you were halfway through. Notes written at the end of the work are notes that were',
728
779
  'never written.',
729
780
  '',
781
+ 'ANYTHING YOU SAVE GOES THROUGH A FIREWALL',
782
+ FIREWALL_WRITING_RULE,
783
+ '',
730
784
  ...WHILE_YOU_ARE_WORKING,
731
785
  '',
732
786
  ...(level === 2