Skip to content

Pack instruction contracts into the first 8,000 UTF-8 bytes - #77481

Merged
pelikhan merged 4 commits into
mainfrom
pelikhan/instruction-density-audit
Nov 13, 2026
Merged

pelikhan merged 4 commits into
mainfrom
pelikhan/instruction-density-audit

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Why

Copilot CLI prompt-file queries may expose only the first 8,000 UTF-8 bytes, including metadata. Existing entry points could lose required rules, task routing and completion checks beyond that cutoff. This change reserves the first 7,500 bytes for a complete execution contract, leaving 500 bytes of headroom.

Approach

  • Add a UTF-8 byte-budget checker, boundary regressions, and lint/pre-publication integration for 15 maintained entry points. Longer references must mark an early contract boundary; semantic completeness still requires review.
  • Repack core instructions using explicit, concise wording and front-loaded constraints, routing, verification and stop conditions. Reduce the creator entry point from 27,071 to 7,461 bytes, with linked design, evaluation and validation guides each below 7,500 bytes. Move the generated skill inventory after its execution contract and synchronize the embedded fallback inventory.
  • Update six maintenance/research workflows to prioritize prefix information density. Persona exploration gains an isolated full-versus-prefix comparison, with unavailable/contaminated probes kept separate from quality scores. Start a new experiment cohort because whole-run cost and duration include the added probe.

Validation

  • make check-instruction-prefixes: all 15 execution contracts fit within 7,500 bytes.
  • Prefix checker unit tests: 5 passed; guidance regressions: 78 passed, with one additional pre-existing diagnostic-code coverage failure reproduced using the baseline test source.
  • Focused CLI skill-generation and fallback-inventory tests passed; validation-gate script regressions passed.
  • make recompile: all 366 workflows compiled; regenerated locks for the six modified workflows are included. No workflows were dispatched.
  • make agent-report-progress completed build and script checks, then stopped on pre-existing ci-front-door-researcher lock-file drift. The unrelated lock and diagnostic-code guidance were left unchanged.

Add UTF-8 prefix checks, update instruction and skill maintenance workflows, and compare full versus prefix-only persona guidance. Split creator guidance into bounded topic files and front-load core instruction contracts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review November 13, 2026 14:44
Copilot AI adaptive review requested due to automatic review settings November 13, 2026 14:44
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The probe compares batched and single-scenario contexts, so its score delta confounds context changes with guidance truncation and cannot isolate prefix comprehension.

1 open issue
What changed in this PR

This PR makes gh-aw’s instruction entry points resilient to 8,000-byte prompt-file truncation by placing essential execution rules within the first 7,500 UTF-8 bytes.

Changes:

  • Adds byte-budget validation, boundary regressions, and lint/pre-publication checks.
  • Reorganizes core guidance and splits workflow creation instructions into focused references.
  • Updates six maintenance/research workflows to assess prefix completeness, including a paired persona probe and a new experiment cohort.
File Description
scripts/​test_check_instruction_prefixes.py Tests byte limits, markers, and invalid inputs.
scripts/​check-instruction-prefixes.py Validates execution-contract byte budgets.
scripts/​agent-report-progress.sh Adds prefix validation to publication gates.
scripts/​agent-report-progress_test.sh Checks that prefix violations block publication.
pkg/​cli/​data/​agentic_workflows_skill.md Moves generated inventory after essential routing.
pkg/​cli/​data/​agentic_workflows_fallback_aw_files.json Registers the three new creator references.
Makefile Integrates prefix checks and regression tests.
AGENTS.md Compresses global rules and adds packing guidance.
.github/​workflows/​workflow-skill-extractor.md Adds source-byte metrics and prefix-aware recommendations.
.github/​workflows/​workflow-skill-extractor.lock.yml Regenerates extractor configuration and evaluations.
.github/​workflows/​instructions-janitor.md Adds byte-budget and semantic-prefix audits.
.github/​workflows/​instructions-janitor.lock.yml Regenerates janitor tools and evaluations.
.github/​workflows/​evoskill-evolver.md Adds isolated prefix validation for skill candidates.
.github/​workflows/​evoskill-evolver.lock.yml Regenerates skill-evolution evaluations.
.github/​workflows/​daily-caveman-optimizer.md Prioritizes prefix completeness over prose reduction.
.github/​workflows/​daily-caveman-optimizer.lock.yml Regenerates optimizer metadata and evaluations.
.github/​workflows/​daily-ambient-context-optimizer.md Separates source-prefix audits from runtime measurements.
.github/​workflows/​daily-ambient-context-optimizer.lock.yml Regenerates ambient-context evaluations.
.github/​workflows/​agent-persona-explorer.md Adds paired prefix probes and a new experiment cohort.
.github/​workflows/​agent-persona-explorer.lock.yml Updates experiment wiring and probe evaluations.
.github/​skills/​prompt-token-efficiency/​SKILL.md Defines byte-aware instruction packing guidance.
.github/​skills/​agentic-workflows/​tests/​test_guidance.py Tests visible routes, links, and essential rules.
.github/​skills/​agentic-workflows/​SKILL.md Places task routes before the optional inventory.
.github/​aw/​instructions.md Adds repository-specific prefix requirements.
.github/​aw/​github-agentic-workflows.md Condenses authoring guidance and links detailed references.
.github/​aw/​debug-agentic-workflow.md Front-loads evidence and completion requirements.
.github/​aw/​create-agentic-workflow.md Condenses the creator into a routed execution contract.
.github/​aw/​create-agentic-workflow-validation.md Extracts output, scope, and completion checks.
.github/​aw/​create-agentic-workflow-evaluation.md Extracts scenario examples and failure handling.
.github/​aw/​create-agentic-workflow-design.md Extracts workflow design decisions and safety checks.
.github/​agents/​developer.instructions.md Front-loads development rules and verification routes.

Review effort: Balanced (dynamic)

Comment on lines +225 to +229
Use one successfully evaluated scenario as the full-guidance baseline; request
one additional, fresh isolated `persona-evaluator` invocation with
`guidance_mode: prefix_8000` and the identical scenario. Pass no full-response
rationale or shared conversation history. Do not add a scenario or alter the four initial
baseline tasks. If none succeeded, report the probe unavailable without scores.
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…density-audit

# Conflicts:
#	.github/workflows/agent-persona-explorer.lock.yml
#	.github/workflows/daily-ambient-context-optimizer.lock.yml
#	.github/workflows/daily-caveman-optimizer.lock.yml
#	.github/workflows/evoskill-evolver.lock.yml
#	.github/workflows/instructions-janitor.lock.yml
#	.github/workflows/workflow-skill-extractor.lock.yml

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Merged main and regenerated the six conflicted workflow lock files from the merged Markdown. The merge commit is ff5d522.

Copilot AI commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

main is already merged in commit ff5d522; it is still the current remote base, and there are no unresolved conflicts.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check push_ledger_changes (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "45087f8b072009d73788740b28f3a82b5b63f6fc",
  "kind": "requested",
  "schema_version": "1",
  "state": "e7be3ae8da17e051c139ae0696d82c4f7b071ffe78ed6dfa72d3c63dedd4691e",
  "work": [
    "2ec1c55a56c3bbc3d439b0f0d819e0f964a9c8ea5c8bbe45cc9676c7e7802a18"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

@pelikhan
pelikhan merged commit 85e84e1 into main Nov 13, 2026
65 of 67 checks passed
@pelikhan
pelikhan deleted the pelikhan/instruction-density-audit branch November 13, 2026 16:15
Copilot stopped work on behalf of gh-aw-bot due to an error November 13, 2026 16:16
Copilot AI requested a review from gh-aw-bot November 13, 2026 16:16
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.0

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.

4 participants