Skip to content

add quality verification for chain system#42

Draft
arbuzz202 wants to merge 1 commit intoDeevsDeevs:mainfrom
arbuzz202:chain-system-qol
Draft

add quality verification for chain system#42
arbuzz202 wants to merge 1 commit intoDeevsDeevs:mainfrom
arbuzz202:chain-system-qol

Conversation

@arbuzz202
Copy link
Copy Markdown

After creating a chain file spawns an empty context session, loads chain file into it, interrogates the agent for an understanding of a context, then assesses his answers and based off that decides whether to add more info to the chain file in specific places

…tains quality info for the new sessions by spawning empty context agent and interrogating it whether the provided context is sufficient for continuing hte project
1. Detects the file is a chain link
2. Runs `chain-system/scripts/chain-verify.sh` — spawns an **isolated CLI process** (`claude --print --bare`) with zero shared context
3. The isolated process reads ONLY the chain link content and answers 10 verification questions
4. Scores each answer 0-100
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

явно нужны критерии по которым оценивать ответ, не просто "70-89 = missing some detail, 50-69 = significant gaps, 0-49 = cannot answer"
всегда лучше накидывать баллы, а не снимать

**If score < 85**: Hook exits 2, **write is blocked**. The gaps are fed back to you as feedback. You must:
- Read the gap analysis in the hook feedback
- Re-examine the conversation for the missing information
- Rewrite the chain link addressing the specific gaps
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe append to?

- Read the gap analysis in the hook feedback
- Re-examine the conversation for the missing information
- Rewrite the chain link addressing the specific gaps
- Save again (which re-triggers the hook automatically)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

which re-triggers the hook automatically

obvious?

- Rewrite the chain link addressing the specific gaps
- Save again (which re-triggers the hook automatically)

This loop continues until the chain link passes or you've addressed all available information from the conversation.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

obvious?

# Use a simple, deterministic question set derived from the 9 required sections.
# These probe whether each section is present and substantive.
cat > "$QUESTIONS_FILE" << 'EOF'
1. What is the user's primary request? Describe the exact goal, not a vague summary.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the exact goal, not a vague summary

examples?

6. Are there any unresolved issues or blockers? If so, what solutions were attempted and why did they fail?
7. What tasks remain to be done? Are they specific enough to act on without guessing?
8. What was actively in progress when this chain link was saved? Include file names, line numbers, and code context.
9. What is the exact next step? Is it a single, unambiguous action that a new session can execute immediately?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

single, unambiguous action

harmful for chaining without planning (as before)

that a new session can execute immediately

sounds like to narrow for your exact use-cases @arbuzz202

7. What tasks remain to be done? Are they specific enough to act on without guessing?
8. What was actively in progress when this chain link was saved? Include file names, line numbers, and code context.
9. What is the exact next step? Is it a single, unambiguous action that a new session can execute immediately?
10. Could you resume this work right now with ONLY the information in this chain link, without asking any clarifying questions? If not, what would you need to ask?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

potentially harmful too

exit 0
fi

# Extract the aggregate score from the verification output
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

comments might be deleted, in fact. Code is clear.

CHAIN_CONTENT="$(cat "$CHAIN_LINK_FILE")"
QUESTIONS="$(cat "$QUESTIONS_FILE")"

SYSTEM_PROMPT="You are a developer resuming work from a chain link. You have NO other context besides what is provided in this prompt. You must answer each question using ONLY the chain link content given. If you cannot answer a question or the answer is incomplete/ambiguous, say INSUFFICIENT and explain what is missing."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You have NO other context besides what is provided in this prompt

Makes the use-case when we do /plan after chaining impossible: agents can scavenge the repo additionally.


## Instructions

Answer each question using ONLY the chain link content above. For each question respond with:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

but the new agents HAVE the new context like wtf?

Maybe something like "using ONLY the context mined from repo and the chain link content above", but this will make the chaining over-complicated.

@yk4r2
Copy link
Copy Markdown
Collaborator

yk4r2 commented Mar 25, 2026

Needs hard re-work: current instructions are vague while being too restrictive for some use-cases.
The idea is strong though.

@yk4r2 yk4r2 marked this pull request as draft March 25, 2026 11:16
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.

2 participants