MCPcopy Create free account
hub / github.com/microsoft/SkillOpt / inject_empty_appendix_field

Function inject_empty_appendix_field

skillopt/optimizer/appendix.py:89–98  ·  view source on GitHub ↗

Add an empty appendix placeholder at the end of *skill* (idempotent). Mirrors ``inject_empty_slow_update_field``: called once at skill init so the protected region exists before any note is written.

(skill: str)

Source from the content-addressed store, hash-verified

87
88
89def inject_empty_appendix_field(skill: str) -> str:
90 """Add an empty appendix placeholder at the end of *skill* (idempotent).
91
92 Mirrors ``inject_empty_slow_update_field``: called once at skill init so the
93 protected region exists before any note is written.
94 """
95 if has_appendix_field(skill):
96 return skill
97 block = f"\n\n{APPENDIX_START}\n{APPENDIX_HEADING}\n{APPENDIX_END}\n"
98 return skill.rstrip() + block
99
100
101def extract_appendix_notes(skill: str) -> list[str]:

Callers 4

trainMethod · 0.90
test_appendix_moduleFunction · 0.90
test_appendix_protectionFunction · 0.90

Calls 1

has_appendix_fieldFunction · 0.85

Tested by 3

test_appendix_moduleFunction · 0.72
test_appendix_protectionFunction · 0.72