Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

Task Complete: Fixed Task Frontmatter Printing Issue

Summary

Successfully fixed the issue where task frontmatter was being incorrectly printed in the output. Task frontmatter is now properly used for filtering and metadata purposes only, without being included in the generated context.

Changes Made

Code Changes

  • main.go: Removed task frontmatter printing in normal mode
  • main.go: Removed task frontmatter printing in writeRules mode
  • main.go: Removed unused yaml import
  • integration_test.go: Updated TestPrintTaskFrontmatter to verify frontmatter is NOT printed
  • integration_test.go: Fixed TestExpanderSecurityIntegration to work without frontmatter delimiter
  • context.go: Skills are included in the Prompt between rules and task content

Documentation Updates

  • README.md: Updated diagram to show correct order (rules → skills → task)
  • README.md: Rewrote "Task Frontmatter" section with correct behavior
  • SPECIFICATION.md: Updated assembly order to reflect rules → skills → task
  • SPECIFICATION.md: Updated output format examples to show correct order
  • SPECIFICATION.md: Clarified frontmatter usage (metadata only)

Verification

  • All unit tests pass (including updated TestPrintTaskFrontmatter)
  • All integration tests pass (including fixed TestExpanderSecurityIntegration)
  • Linter passes (make lint)
  • Manual testing confirms correct behavior and ordering
  • Code review passed (one minor nitpick about hardcoded text)
  • Security scan (CodeQL) passed with no alerts

Output Order

Correct order (after fix):

  1. Rules content (markdown)
  2. Skills metadata (XML, optional - in Prompt)
  3. Task content (markdown)

Skills are part of the result.Prompt field and appear between rules and task content as intended.

Security Summary

No security vulnerabilities were discovered or introduced by these changes.

Original prompt

I noted in the readme that task front matter is printed. This should not be true. Can you check the source code?


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 25, 2025
Copilot AI and others added 2 commits December 25, 2025 18:42
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix printing of task front matter in code Remove task frontmatter from output Dec 25, 2025
Copilot AI requested a review from alexec December 25, 2025 18:50
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

@please check the ordering of rules and skills. I think skills are printed after rules.

Skills were being printed twice (once in main.go and once in the Prompt).
Removed skills from the Prompt so they are only printed once in main.go,
maintaining the correct order: skills -> rules -> task.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@please check the ordering of rules and skills. I think skills are printed after rules.

Fixed in b1c10e6. Skills were being printed twice - once in main.go and once inside the Prompt. Removed skills from the Prompt so they're only printed once, maintaining correct order: skills → rules → task.

Copilot AI requested a review from alexec December 25, 2025 18:57
@alexec
Copy link
Contributor

alexec commented Dec 25, 2025

@copilot the correct order is rules, skills, task. Keeps the skills in the resume.prompt field.

Corrected the output order to be rules, then skills, then task.
Skills are now part of the Prompt (result.Prompt field) as intended,
appearing between rules and task content. Updated documentation to
reflect the correct order.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@copilot the correct order is rules, skills, task. Keeps the skills in the resume.prompt field.

Fixed in 3fcddbe. Corrected the order to rules → skills → task. Skills are now in result.Prompt (between rules and task) as intended.

@alexec alexec marked this pull request as ready for review December 25, 2025 19:20
Copilot AI review requested due to automatic review settings December 25, 2025 19:20
@alexec alexec enabled auto-merge (squash) December 25, 2025 19:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where task frontmatter was incorrectly being printed in the output. Task frontmatter is now properly used only for filtering and metadata purposes, keeping the generated context focused on actionable content.

Key changes:

  • Removed task frontmatter printing logic from both normal and writeRules modes in main.go
  • Updated test to verify frontmatter is NOT printed instead of verifying it IS printed
  • Updated documentation across README.md and SPECIFICATION.md to reflect correct behavior and ordering (rules → skills → task)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
main.go Removed YAML encoding and printing of task frontmatter, removed unused yaml import
integration_test.go Updated TestPrintTaskFrontmatter to verify frontmatter is excluded from output
examples/.agents Added new agents directory marker file
SPECIFICATION.md Updated assembly order, output format examples, and frontmatter usage documentation
README.md Updated diagram and Task Frontmatter section to reflect correct behavior
Comments suppressed due to low confidence (1)

examples/.agents:1

  • This file appears to contain only the text 'agents' without any explanation of its purpose. Consider adding a comment or README to explain what this marker file is for and why it exists in the examples directory.

@alexec
Copy link
Contributor

alexec commented Dec 25, 2025

@copilot The tests failed when run on GitHub actions. Please rerun the tests and fix the broken integration test.

Updated the test to identify stdout by filtering out stderr log lines
(lines starting with "time=") instead of looking for the frontmatter
delimiter "---" which is no longer printed.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
auto-merge was automatically disabled December 25, 2025 19:35

Head branch was pushed to by a user without write access

Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@copilot The tests failed when run on GitHub actions. Please rerun the tests and fix the broken integration test.

Fixed in fcdf06e. The test was looking for the frontmatter delimiter --- to identify stdout, but since task frontmatter is no longer printed, the test needed to be updated to filter out stderr log lines (starting with time=) instead. All tests now pass.

Copilot AI requested a review from alexec December 25, 2025 19:36
@alexec alexec enabled auto-merge (squash) December 25, 2025 19:42
@alexec alexec merged commit e74668b into main Dec 25, 2025
1 check passed
@alexec alexec deleted the copilot/fix-printed-task-front-matter branch December 25, 2025 19:42
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